GalleryImageVersion IOperationSource <GalleryImageVersion> .CreateResult(Response response, CancellationToken cancellationToken) { using var document = JsonDocument.Parse(response.ContentStream); var data = GalleryImageVersionData.DeserializeGalleryImageVersionData(document.RootElement); return(new GalleryImageVersion(_armClient, data)); }
internal static GalleryImageVersionList DeserializeGalleryImageVersionList(JsonElement element) { IReadOnlyList <GalleryImageVersionData> value = default; Optional <string> nextLink = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value")) { List <GalleryImageVersionData> array = new List <GalleryImageVersionData>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(GalleryImageVersionData.DeserializeGalleryImageVersionData(item)); } value = array; continue; } if (property.NameEquals("nextLink")) { nextLink = property.Value.GetString(); continue; } } return(new GalleryImageVersionList(value, nextLink.Value)); }