internal static DeploymentValidateResult DeserializeDeploymentValidateResult(JsonElement element)
        {
            ResourceManagementErrorWithDetails error      = default;
            DeploymentPropertiesExtended       properties = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("error"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    error = ResourceManagementErrorWithDetails.DeserializeResourceManagementErrorWithDetails(property.Value);
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    properties = DeploymentPropertiesExtended.DeserializeDeploymentPropertiesExtended(property.Value);
                    continue;
                }
            }
            return(new DeploymentValidateResult(error, properties));
        }
        internal static DeploymentExtended DeserializeDeploymentExtended(JsonElement element)
        {
            string id   = default;
            string name = default;
            DeploymentPropertiesExtended 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"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    properties = DeploymentPropertiesExtended.DeserializeDeploymentPropertiesExtended(property.Value);
                    continue;
                }
            }
            return(new DeploymentExtended(id, name, properties));
        }
예제 #3
0
        internal static DeploymentExtended DeserializeDeploymentExtended(JsonElement element)
        {
            Optional <string> id   = default;
            string            name = default;
            Optional <DeploymentPropertiesExtended> 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("properties"))
                {
                    properties = DeploymentPropertiesExtended.DeserializeDeploymentPropertiesExtended(property.Value);
                    continue;
                }
            }
            return(new DeploymentExtended(id.Value, name, properties.Value));
        }
 internal DeploymentExtended(string id, string name, string type, string location, DeploymentPropertiesExtended properties, IReadOnlyDictionary <string, string> tags)
 {
     Id         = id;
     Name       = name;
     Type       = type;
     Location   = location;
     Properties = properties;
     Tags       = tags;
 }
예제 #5
0
        internal static DeploymentValidateResult DeserializeDeploymentValidateResult(JsonElement element)
        {
            Optional <ResourceManagementErrorWithDetails> error      = default;
            Optional <DeploymentPropertiesExtended>       properties = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("error"))
                {
                    error = ResourceManagementErrorWithDetails.DeserializeResourceManagementErrorWithDetails(property.Value);
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    properties = DeploymentPropertiesExtended.DeserializeDeploymentPropertiesExtended(property.Value);
                    continue;
                }
            }
            return(new DeploymentValidateResult(error.Value, properties.Value));
        }
예제 #6
0
 internal DeploymentExtended(string id, string name, DeploymentPropertiesExtended properties)
 {
     Id         = id;
     Name       = name;
     Properties = properties;
 }
예제 #7
0
        internal static DeploymentExtended DeserializeDeploymentExtended(JsonElement element)
        {
            string id       = default;
            string name     = default;
            string type     = default;
            string location = default;
            DeploymentPropertiesExtended         properties = default;
            IReadOnlyDictionary <string, string> tags       = 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("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    properties = DeploymentPropertiesExtended.DeserializeDeploymentPropertiesExtended(property.Value);
                    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;
                }
            }
            return(new DeploymentExtended(id, name, type, location, properties, tags));
        }