示例#1
0
        GalleryApplicationVersion IOperationSource <GalleryApplicationVersion> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = GalleryApplicationVersionData.DeserializeGalleryApplicationVersionData(document.RootElement);

            return(new GalleryApplicationVersion(_armClient, data));
        }
        internal static GalleryApplicationVersionList DeserializeGalleryApplicationVersionList(JsonElement element)
        {
            IReadOnlyList <GalleryApplicationVersionData> value = default;
            Optional <string> nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    List <GalleryApplicationVersionData> array = new List <GalleryApplicationVersionData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(GalleryApplicationVersionData.DeserializeGalleryApplicationVersionData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new GalleryApplicationVersionList(value, nextLink.Value));
        }