internal static ApplicationGatewayBackendHealthHttpSettings DeserializeApplicationGatewayBackendHealthHttpSettings(JsonElement element) { Optional <ApplicationGatewayBackendHttpSettings> backendHttpSettings = default; Optional <IReadOnlyList <ApplicationGatewayBackendHealthServer> > servers = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("backendHttpSettings")) { backendHttpSettings = ApplicationGatewayBackendHttpSettings.DeserializeApplicationGatewayBackendHttpSettings(property.Value); continue; } if (property.NameEquals("servers")) { List <ApplicationGatewayBackendHealthServer> array = new List <ApplicationGatewayBackendHealthServer>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(ApplicationGatewayBackendHealthServer.DeserializeApplicationGatewayBackendHealthServer(item)); } servers = array; continue; } } return(new ApplicationGatewayBackendHealthHttpSettings(backendHttpSettings.Value, Optional.ToList(servers))); }
internal static ApplicationGatewayBackendHealthHttpSettings DeserializeApplicationGatewayBackendHealthHttpSettings(JsonElement element) { ApplicationGatewayBackendHttpSettings backendHttpSettings = default; IReadOnlyList <ApplicationGatewayBackendHealthServer> servers = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("backendHttpSettings")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } backendHttpSettings = ApplicationGatewayBackendHttpSettings.DeserializeApplicationGatewayBackendHttpSettings(property.Value); continue; } if (property.NameEquals("servers")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } List <ApplicationGatewayBackendHealthServer> array = new List <ApplicationGatewayBackendHealthServer>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(ApplicationGatewayBackendHealthServer.DeserializeApplicationGatewayBackendHealthServer(item)); } } servers = array; continue; } } return(new ApplicationGatewayBackendHealthHttpSettings(backendHttpSettings, servers)); }