internal static ListVirtualHubsResult DeserializeListVirtualHubsResult(JsonElement element)
        {
            Optional <IReadOnlyList <VirtualHub> > value = default;
            Optional <string> nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    List <VirtualHub> array = new List <VirtualHub>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(VirtualHub.DeserializeVirtualHub(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new ListVirtualHubsResult(Optional.ToList(value), nextLink.Value));
        }
예제 #2
0
        internal static ListVirtualHubsResult DeserializeListVirtualHubsResult(JsonElement element)
        {
            IReadOnlyList <VirtualHub> value = default;
            string nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <VirtualHub> array = new List <VirtualHub>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(VirtualHub.DeserializeVirtualHub(item));
                        }
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new ListVirtualHubsResult(value, nextLink));
        }