internal static AppBuilderProperties DeserializeAppBuilderProperties(JsonElement element) { Optional <AppBuilderProvisioningState> provisioningState = default; Optional <StackProperties> stack = default; Optional <IList <BuildpacksGroupProperties> > buildpackGroups = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("provisioningState")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } provisioningState = new AppBuilderProvisioningState(property.Value.GetString()); continue; } if (property.NameEquals("stack")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } stack = StackProperties.DeserializeStackProperties(property.Value); continue; } if (property.NameEquals("buildpackGroups")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List <BuildpacksGroupProperties> array = new List <BuildpacksGroupProperties>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(BuildpacksGroupProperties.DeserializeBuildpacksGroupProperties(item)); } buildpackGroups = array; continue; } } return(new AppBuilderProperties(Optional.ToNullable(provisioningState), stack.Value, Optional.ToList(buildpackGroups))); }
internal AppBuilderProperties(AppBuilderProvisioningState?provisioningState, StackProperties stack, IList <BuildpacksGroupProperties> buildpackGroups) { ProvisioningState = provisioningState; Stack = stack; BuildpackGroups = buildpackGroups; }