internal static WebAppCollection DeserializeWebAppCollection(JsonElement element)
        {
            IReadOnlyList <WebSiteData> value    = default;
            Optional <string>           nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    List <WebSiteData> array = new List <WebSiteData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(WebSiteData.DeserializeWebSiteData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new WebAppCollection(value, nextLink.Value));
        }
Esempio n. 2
0
        WebSite IOperationSource <WebSite> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = WebSiteData.DeserializeWebSiteData(document.RootElement);

            return(new WebSite(_armClient, data));
        }
Esempio n. 3
0
 SiteSlot IOperationSource <SiteSlot> .CreateResult(Response response, CancellationToken cancellationToken)
 {
     using var document = JsonDocument.Parse(response.ContentStream);
     return(new SiteSlot(_operationBase, WebSiteData.DeserializeWebSiteData(document.RootElement)));
 }