internal Vault(VaultProperties properties)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            Properties = properties;
        }
Exemple #2
0
 internal Vault(string id, string name, string type, string location, IReadOnlyDictionary <string, string> tags, VaultProperties properties)
 {
     Id         = id;
     Name       = name;
     Type       = type;
     Location   = location;
     Tags       = tags;
     Properties = properties;
 }
Exemple #3
0
        internal Vault(VaultProperties properties)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            Tags       = new ChangeTrackingDictionary <string, string>();
            Properties = properties;
        }
Exemple #4
0
        internal static Vault DeserializeVault(JsonElement element)
        {
            Optional <string> id       = default;
            Optional <string> name     = default;
            Optional <string> type     = default;
            Optional <string> location = default;
            Optional <IReadOnlyDictionary <string, string> > tags = default;
            VaultProperties properties = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    properties = VaultProperties.DeserializeVaultProperties(property.Value);
                    continue;
                }
            }
            return(new Vault(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), properties));
        }
        public VaultCreateOrUpdateContent(AzureLocation location, VaultProperties properties)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            Location   = location;
            Tags       = new ChangeTrackingDictionary <string, string>();
            Properties = properties;
        }
        public VaultCreateOrUpdateParameters(string location, VaultProperties properties)
        {
            if (location == null)
            {
                throw new ArgumentNullException(nameof(location));
            }
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            Location   = location;
            Properties = properties;
        }
        internal static Vault DeserializeVault(JsonElement element)
        {
            string id       = default;
            string name     = default;
            string type     = default;
            string location = default;
            IReadOnlyDictionary <string, string> tags = default;
            VaultProperties properties = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.Value.ValueKind == JsonValueKind.Null)
                        {
                            dictionary.Add(property0.Name, null);
                        }
                        else
                        {
                            dictionary.Add(property0.Name, property0.Value.GetString());
                        }
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    properties = VaultProperties.DeserializeVaultProperties(property.Value);
                    continue;
                }
            }
            return(new Vault(id, name, type, location, tags, properties));
        }
 internal VaultCreateOrUpdateParameters(string location, IDictionary <string, string> tags, VaultProperties properties)
 {
     Location   = location;
     Tags       = tags;
     Properties = properties;
 }