Beispiel #1
0
        internal static AcquiredPhoneNumbers DeserializeAcquiredPhoneNumbers(JsonElement element)
        {
            IReadOnlyList <AcquiredPhoneNumber> phoneNumbers = default;
            Optional <string> nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("phoneNumbers"))
                {
                    List <AcquiredPhoneNumber> array = new List <AcquiredPhoneNumber>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(AcquiredPhoneNumber.DeserializeAcquiredPhoneNumber(item));
                    }
                    phoneNumbers = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new AcquiredPhoneNumbers(phoneNumbers, nextLink.Value));
        }
Beispiel #2
0
        internal static AcquiredPhoneNumbers DeserializeAcquiredPhoneNumbers(JsonElement element)
        {
            Optional <IReadOnlyList <AcquiredPhoneNumber> > phoneNumbers = default;
            Optional <string> nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("phoneNumbers"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <AcquiredPhoneNumber> array = new List <AcquiredPhoneNumber>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(AcquiredPhoneNumber.DeserializeAcquiredPhoneNumber(item));
                    }
                    phoneNumbers = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new AcquiredPhoneNumbers(Optional.ToList(phoneNumbers), nextLink.Value));
        }