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