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