internal static ReservationsListResult DeserializeReservationsListResult(JsonElement element)
        {
            Optional <IReadOnlyList <ReservationResponseData> > value = default;
            Optional <string>             nextLink = default;
            Optional <ReservationSummary> summary  = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <ReservationResponseData> array = new List <ReservationResponseData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ReservationResponseData.DeserializeReservationResponseData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("summary"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    summary = ReservationSummary.DeserializeReservationSummary(property.Value);
                    continue;
                }
            }
            return(new ReservationsListResult(Optional.ToList(value), nextLink.Value, summary.Value));
        }
 internal ReservationsListResult(IReadOnlyList <ReservationResponseData> value, string nextLink, ReservationSummary summary)
 {
     Value    = value;
     NextLink = nextLink;
     Summary  = summary;
 }