internal static ExpressRouteServiceProviderListResult DeserializeExpressRouteServiceProviderListResult(JsonElement element)
        {
            Optional <IReadOnlyList <ExpressRouteServiceProvider> > value = default;
            Optional <string> nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <ExpressRouteServiceProvider> array = new List <ExpressRouteServiceProvider>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ExpressRouteServiceProvider.DeserializeExpressRouteServiceProvider(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new ExpressRouteServiceProviderListResult(Optional.ToList(value), nextLink.Value));
        }
Ejemplo n.º 2
0
        internal static ExpressRouteServiceProviderListResult DeserializeExpressRouteServiceProviderListResult(JsonElement element)
        {
            IReadOnlyList <ExpressRouteServiceProvider> value = default;
            string nextLink = default;

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