コード例 #1
0
        public KeyVaultSigningKeyParameters(KeyVaultSigningKeyParametersTypeName typeName, string subscriptionId, string resourceGroupName, string vaultName, string secretName, string secretVersion)
        {
            if (subscriptionId == null)
            {
                throw new ArgumentNullException(nameof(subscriptionId));
            }
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (vaultName == null)
            {
                throw new ArgumentNullException(nameof(vaultName));
            }
            if (secretName == null)
            {
                throw new ArgumentNullException(nameof(secretName));
            }
            if (secretVersion == null)
            {
                throw new ArgumentNullException(nameof(secretVersion));
            }

            TypeName          = typeName;
            SubscriptionId    = subscriptionId;
            ResourceGroupName = resourceGroupName;
            VaultName         = vaultName;
            SecretName        = secretName;
            SecretVersion     = secretVersion;
        }
コード例 #2
0
        internal static KeyVaultSigningKeyParameters DeserializeKeyVaultSigningKeyParameters(JsonElement element)
        {
            KeyVaultSigningKeyParametersTypeName typeName = default;
            string subscriptionId    = default;
            string resourceGroupName = default;
            string vaultName         = default;
            string secretName        = default;
            string secretVersion     = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("typeName"))
                {
                    typeName = new KeyVaultSigningKeyParametersTypeName(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("subscriptionId"))
                {
                    subscriptionId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("resourceGroupName"))
                {
                    resourceGroupName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("vaultName"))
                {
                    vaultName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("secretName"))
                {
                    secretName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("secretVersion"))
                {
                    secretVersion = property.Value.GetString();
                    continue;
                }
            }
            return(new KeyVaultSigningKeyParameters(typeName, subscriptionId, resourceGroupName, vaultName, secretName, secretVersion));
        }