Exemple #1
0
        StaticSiteARMResource IOperationSource <StaticSiteARMResource> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = StaticSiteARMResourceData.DeserializeStaticSiteARMResourceData(document.RootElement);

            return(new StaticSiteARMResource(_armClient, data));
        }
        internal static StaticSiteCollection DeserializeStaticSiteCollection(JsonElement element)
        {
            IReadOnlyList <StaticSiteARMResourceData> value = default;
            Optional <string> nextLink = default;

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