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