internal static VirtualNetworkGatewayListResult DeserializeVirtualNetworkGatewayListResult(JsonElement element) { Optional <IReadOnlyList <VirtualNetworkGatewayData> > value = default; Optional <string> nextLink = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List <VirtualNetworkGatewayData> array = new List <VirtualNetworkGatewayData>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(VirtualNetworkGatewayData.DeserializeVirtualNetworkGatewayData(item)); } value = array; continue; } if (property.NameEquals("nextLink")) { nextLink = property.Value.GetString(); continue; } } return(new VirtualNetworkGatewayListResult(Optional.ToList(value), nextLink.Value)); }
VirtualNetworkGateway IOperationSource <VirtualNetworkGateway> .CreateResult(Response response, CancellationToken cancellationToken) { using var document = JsonDocument.Parse(response.ContentStream); var data = VirtualNetworkGatewayData.DeserializeVirtualNetworkGatewayData(document.RootElement); return(new VirtualNetworkGateway(_armClient, data)); }