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)); }
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)); }