public ThroughputSettingsUpdateOptions(AzureLocation location, ThroughputSettingsResource resource) : base(location)
        {
            if (resource == null)
            {
                throw new ArgumentNullException(nameof(resource));
            }

            Resource = resource;
        }
        public ThroughputSettingsUpdateParameters(ThroughputSettingsResource resource)
        {
            if (resource == null)
            {
                throw new ArgumentNullException(nameof(resource));
            }

            Resource = resource;
        }
Esempio n. 3
0
        internal static ThroughputSettingsUpdateParameters DeserializeThroughputSettingsUpdateParameters(JsonElement element)
        {
            Optional <string> id       = default;
            Optional <string> name     = default;
            Optional <string> type     = default;
            Optional <string> location = default;
            Optional <IDictionary <string, string> > tags = default;
            ThroughputSettingsResource resource           = 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"))
                {
                    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"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("resource"))
                        {
                            resource = ThroughputSettingsResource.DeserializeThroughputSettingsResource(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ThroughputSettingsUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource));
        }
 internal ThroughputSettingsUpdateOptions(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, ThroughputSettingsResource resource) : base(id, name, type, systemData, tags, location)
 {
     Resource = resource;
 }
        internal static ThroughputSettingsUpdateOptions DeserializeThroughputSettingsUpdateOptions(JsonElement element)
        {
            IDictionary <string, string> tags     = default;
            AzureLocation              location   = default;
            ResourceIdentifier         id         = default;
            string                     name       = default;
            ResourceType               type       = default;
            SystemData                 systemData = default;
            ThroughputSettingsResource resource   = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("tags"))
                {
                    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("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(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("systemData"))
                {
                    systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString());
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("resource"))
                        {
                            resource = ThroughputSettingsResource.DeserializeThroughputSettingsResource(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ThroughputSettingsUpdateOptions(id, name, type, systemData, tags, location, resource));
        }
 internal ThroughputSettingsUpdateParameters(string id, string name, string type, string location, IDictionary <string, string> tags, ThroughputSettingsResource resource) : base(id, name, type, location, tags)
 {
     Resource = resource;
 }