internal static AppDeploymentResourceData DeserializeAppDeploymentResourceData(JsonElement element) { Optional <DeploymentResourceProperties> properties = default; Optional <AppPlatformSku> sku = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } properties = DeploymentResourceProperties.DeserializeDeploymentResourceProperties(property.Value); continue; } if (property.NameEquals("sku")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } sku = AppPlatformSku.DeserializeAppPlatformSku(property.Value); 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 = new ResourceType(property.Value.GetString()); continue; } if (property.NameEquals("systemData")) { systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString()); continue; } } return(new AppDeploymentResourceData(id, name, type, systemData, properties.Value, sku.Value)); }
internal AppDeploymentResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DeploymentResourceProperties properties, AppPlatformSku sku) : base(id, name, resourceType, systemData) { Properties = properties; Sku = sku; }