internal CalculatePriceResponseProperties(CalculatePriceResponsePropertiesBillingCurrencyTotal billingCurrencyTotal, double?netTotal, double?taxTotal, double?grandTotal, bool?isTaxIncluded, bool?isBillingPartnerManaged, string reservationOrderId, string skuTitle, string skuDescription, CalculatePriceResponsePropertiesPricingCurrencyTotal pricingCurrencyTotal, IReadOnlyList <PaymentDetail> paymentSchedule)
 {
     BillingCurrencyTotal    = billingCurrencyTotal;
     NetTotal                = netTotal;
     TaxTotal                = taxTotal;
     GrandTotal              = grandTotal;
     IsTaxIncluded           = isTaxIncluded;
     IsBillingPartnerManaged = isBillingPartnerManaged;
     ReservationOrderId      = reservationOrderId;
     SkuTitle                = skuTitle;
     SkuDescription          = skuDescription;
     PricingCurrencyTotal    = pricingCurrencyTotal;
     PaymentSchedule         = paymentSchedule;
 }
        internal static CalculatePriceResponseProperties DeserializeCalculatePriceResponseProperties(JsonElement element)
        {
            Optional <CalculatePriceResponsePropertiesBillingCurrencyTotal> billingCurrencyTotal = default;
            Optional <double> netTotal                = default;
            Optional <double> taxTotal                = default;
            Optional <double> grandTotal              = default;
            Optional <bool>   isTaxIncluded           = default;
            Optional <bool>   isBillingPartnerManaged = default;
            Optional <string> reservationOrderId      = default;
            Optional <string> skuTitle                = default;
            Optional <string> skuDescription          = default;
            Optional <CalculatePriceResponsePropertiesPricingCurrencyTotal> pricingCurrencyTotal = default;
            Optional <IReadOnlyList <PaymentDetail> > paymentSchedule = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("billingCurrencyTotal"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    billingCurrencyTotal = CalculatePriceResponsePropertiesBillingCurrencyTotal.DeserializeCalculatePriceResponsePropertiesBillingCurrencyTotal(property.Value);
                    continue;
                }
                if (property.NameEquals("netTotal"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    netTotal = property.Value.GetDouble();
                    continue;
                }
                if (property.NameEquals("taxTotal"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    taxTotal = property.Value.GetDouble();
                    continue;
                }
                if (property.NameEquals("grandTotal"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    grandTotal = property.Value.GetDouble();
                    continue;
                }
                if (property.NameEquals("isTaxIncluded"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    isTaxIncluded = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("isBillingPartnerManaged"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    isBillingPartnerManaged = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("reservationOrderId"))
                {
                    reservationOrderId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("skuTitle"))
                {
                    skuTitle = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("skuDescription"))
                {
                    skuDescription = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("pricingCurrencyTotal"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    pricingCurrencyTotal = CalculatePriceResponsePropertiesPricingCurrencyTotal.DeserializeCalculatePriceResponsePropertiesPricingCurrencyTotal(property.Value);
                    continue;
                }
                if (property.NameEquals("paymentSchedule"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <PaymentDetail> array = new List <PaymentDetail>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(PaymentDetail.DeserializePaymentDetail(item));
                    }
                    paymentSchedule = array;
                    continue;
                }
            }
            return(new CalculatePriceResponseProperties(billingCurrencyTotal.Value, Optional.ToNullable(netTotal), Optional.ToNullable(taxTotal), Optional.ToNullable(grandTotal), Optional.ToNullable(isTaxIncluded), Optional.ToNullable(isBillingPartnerManaged), reservationOrderId.Value, skuTitle.Value, skuDescription.Value, pricingCurrencyTotal.Value, Optional.ToList(paymentSchedule)));
        }