internal static ListHubVirtualNetworkConnectionsResult DeserializeListHubVirtualNetworkConnectionsResult(JsonElement element) { Optional <IReadOnlyList <HubVirtualNetworkConnectionData> > 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 <HubVirtualNetworkConnectionData> array = new List <HubVirtualNetworkConnectionData>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(HubVirtualNetworkConnectionData.DeserializeHubVirtualNetworkConnectionData(item)); } value = array; continue; } if (property.NameEquals("nextLink")) { nextLink = property.Value.GetString(); continue; } } return(new ListHubVirtualNetworkConnectionsResult(Optional.ToList(value), nextLink.Value)); }
HubVirtualNetworkConnection IOperationSource <HubVirtualNetworkConnection> .CreateResult(Response response, CancellationToken cancellationToken) { using var document = JsonDocument.Parse(response.ContentStream); var data = HubVirtualNetworkConnectionData.DeserializeHubVirtualNetworkConnectionData(document.RootElement); return(new HubVirtualNetworkConnection(_armClient, data)); }