Exemple #1
0
        internal static CassandraKeyspaceData DeserializeCassandraKeyspaceData(JsonElement element)
        {
            IDictionary <string, string> tags = default;
            Location           location       = default;
            ResourceIdentifier id             = default;
            string             name           = default;
            ResourceType       type           = default;
            Optional <CassandraKeyspacePropertiesResource> resource = default;
            Optional <CassandraKeyspacePropertiesOptions>  options  = 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("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("resource"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            resource = CassandraKeyspacePropertiesResource.DeserializeCassandraKeyspacePropertiesResource(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("options"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            options = CassandraKeyspacePropertiesOptions.DeserializeCassandraKeyspacePropertiesOptions(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new CassandraKeyspaceData(id, name, type, tags, location, resource.Value, options.Value));
        }
 internal CassandraKeyspaceData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, CassandraKeyspacePropertiesResource resource, CassandraKeyspacePropertiesOptions options) : base(id, name, type, systemData, tags, location)
 {
     Resource = resource;
     Options  = options;
 }