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));
        }
Esempio n. 2
0
        internal static ResourceGroupExportResult DeserializeResourceGroupExportResult(JsonElement element)
        {
            object template = default;
            ResourceManagementErrorWithDetails error = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("template"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    template = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("error"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    error = ResourceManagementErrorWithDetails.DeserializeResourceManagementErrorWithDetails(property.Value);
                    continue;
                }
            }
            return(new ResourceGroupExportResult(template, error));
        }
Esempio n. 3
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));
        }
Esempio n. 4
0
        internal static ResourceGroupExportResult DeserializeResourceGroupExportResult(JsonElement element)
        {
            Optional <object> template = default;
            Optional <ResourceManagementErrorWithDetails> error = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("template"))
                {
                    template = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("error"))
                {
                    error = ResourceManagementErrorWithDetails.DeserializeResourceManagementErrorWithDetails(property.Value);
                    continue;
                }
            }
            return(new ResourceGroupExportResult(template.Value, error.Value));
        }