public KeyVaultCertificateSourceParameters(KeyVaultCertificateSourceParametersOdataType odataType, string subscriptionId, string resourceGroupName, string vaultName, string secretName, UpdateRule updateRule, DeleteRule deleteRule)
        {
            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));
            }

            OdataType         = odataType;
            SubscriptionId    = subscriptionId;
            ResourceGroupName = resourceGroupName;
            VaultName         = vaultName;
            SecretName        = secretName;
            UpdateRule        = updateRule;
            DeleteRule        = deleteRule;
        }
Ejemplo n.º 2
0
        internal static KeyVaultCertificateSourceParameters DeserializeKeyVaultCertificateSourceParameters(JsonElement element)
        {
            KeyVaultCertificateSourceParametersTypeName typeName = default;
            string            subscriptionId    = default;
            string            resourceGroupName = default;
            string            vaultName         = default;
            string            secretName        = default;
            Optional <string> secretVersion     = default;
            UpdateRule        updateRule        = default;
            DeleteRule        deleteRule        = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("typeName"))
                {
                    typeName = new KeyVaultCertificateSourceParametersTypeName(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;
                }
                if (property.NameEquals("updateRule"))
                {
                    updateRule = new UpdateRule(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("deleteRule"))
                {
                    deleteRule = new DeleteRule(property.Value.GetString());
                    continue;
                }
            }
            return(new KeyVaultCertificateSourceParameters(typeName, subscriptionId, resourceGroupName, vaultName, secretName, secretVersion.Value, updateRule, deleteRule));
        }
Ejemplo n.º 3
0
 internal KeyVaultCertificateSourceParameters(KeyVaultCertificateSourceParametersTypeName typeName, string subscriptionId, string resourceGroupName, string vaultName, string secretName, string secretVersion, UpdateRule updateRule, DeleteRule deleteRule)
 {
     TypeName          = typeName;
     SubscriptionId    = subscriptionId;
     ResourceGroupName = resourceGroupName;
     VaultName         = vaultName;
     SecretName        = secretName;
     SecretVersion     = secretVersion;
     UpdateRule        = updateRule;
     DeleteRule        = deleteRule;
 }
Ejemplo n.º 4
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("@odata.type");
     writer.WriteStringValue(OdataType.ToString());
     writer.WritePropertyName("subscriptionId");
     writer.WriteStringValue(SubscriptionId);
     writer.WritePropertyName("resourceGroupName");
     writer.WriteStringValue(ResourceGroupName);
     writer.WritePropertyName("vaultName");
     writer.WriteStringValue(VaultName);
     writer.WritePropertyName("secretName");
     writer.WriteStringValue(SecretName);
     if (Optional.IsDefined(SecretVersion))
     {
         writer.WritePropertyName("secretVersion");
         writer.WriteStringValue(SecretVersion);
     }
     writer.WritePropertyName("updateRule");
     writer.WriteStringValue(UpdateRule.ToString());
     writer.WritePropertyName("deleteRule");
     writer.WriteStringValue(DeleteRule.ToString());
     writer.WriteEndObject();
 }