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