# This file was generated by liblab | https://liblab.com/

from __future__ import annotations
from typing import List
from .utils.json_map import JsonMap
from .base import BaseModel
from .rated_shipment_disclaimer import RatedShipmentDisclaimer
from .rated_shipment_service import RatedShipmentService
from .rated_shipment_rated_shipment_alert import RatedShipmentRatedShipmentAlert
from .rated_shipment_billing_weight import RatedShipmentBillingWeight
from .rated_shipment_transportation_charges import RatedShipmentTransportationCharges
from .rated_shipment_base_service_charge import RatedShipmentBaseServiceCharge
from .rated_shipment_itemized_charges import RatedShipmentItemizedCharges
from .rated_shipment_frs_shipment_data import RatedShipmentFrsShipmentData
from .rated_shipment_service_options_charges import RatedShipmentServiceOptionsCharges
from .rated_shipment_tax_charges import RatedShipmentTaxCharges
from .rated_shipment_total_charges import RatedShipmentTotalCharges
from .rated_shipment_total_charges_with_taxes import RatedShipmentTotalChargesWithTaxes
from .rated_shipment_negotiated_rate_charges import RatedShipmentNegotiatedRateCharges
from .rated_shipment_rated_package import RatedShipmentRatedPackage
from .rated_shipment_time_in_transit import RatedShipmentTimeInTransit


@JsonMap(
    {
        "disclaimer": "Disclaimer",
        "service": "Service",
        "rate_chart": "RateChart",
        "rated_shipment_alert": "RatedShipmentAlert",
        "billable_weight_calculation_method": "BillableWeightCalculationMethod",
        "rating_method": "RatingMethod",
        "billing_weight": "BillingWeight",
        "transportation_charges": "TransportationCharges",
        "base_service_charge": "BaseServiceCharge",
        "itemized_charges": "ItemizedCharges",
        "frs_shipment_data": "FRSShipmentData",
        "service_options_charges": "ServiceOptionsCharges",
        "tax_charges": "TaxCharges",
        "total_charges": "TotalCharges",
        "total_charges_with_taxes": "TotalChargesWithTaxes",
        "negotiated_rate_charges": "NegotiatedRateCharges",
        "rated_package": "RatedPackage",
        "time_in_transit": "TimeInTransit",
        "scheduled_delivery_date": "ScheduledDeliveryDate",
        "roar_rated_indicator": "RoarRatedIndicator",
    }
)
class RateResponseRatedShipment(BaseModel):
    """RateResponseRatedShipment

    :param disclaimer: Disclaimer is used to provide more information to the shipper regarding the processed shipment. It is used to notify the shipper about possible taxes and duties that might have been added or might apply to the shipment. Refer to the Appendix for various disclaimers. This field may be returned only if TaxInformationIndicator is present in the request. **NOTE:** For versions >= v2403, this element will always be returned as an array. For requests using versions < v2403, this element will be returned as an array if there is more than one object and a single object if there is only 1. , defaults to None
    :type disclaimer: List[RatedShipmentDisclaimer], optional
    :param service: Service Container.
    :type service: RatedShipmentService
    :param rate_chart: Rate Type with which Shipment is rated. Possible RateChart values for different regions will be: US 48 origin: - 1 – Daily Rates - 3 – Standard List Rates - 4 – Retail Rates. Alaska/Hawaii origin: - 1 – Daily Rates - 3 – Standard List Rates - 4 – Retail Rates. All Other origins: - 1 – Rates - 5 - Regional Rates - 6 - General List Rates. - 3 and 4 do not apply , defaults to None
    :type rate_chart: str, optional
    :param rated_shipment_alert: Rated Shipment Alert container. There can be zero to many RatedShipmentAlert containers with code and description. **NOTE:** For versions >= v2403, this element will always be returned as an array. For requests using versions < v2403, this element will be returned as an array if there is more than one object and a single object if there is only 1. , defaults to None
    :type rated_shipment_alert: List[RatedShipmentRatedShipmentAlert], optional
    :param billable_weight_calculation_method: Indicates whether the billable weight calculation method is utilized at the package or shipment level.  This information will be returned only if RatingMethodRequestedIndicator is present in the request.  Possible values:01 = Shipment Billable Weight02 = Package Billable Weight, defaults to None
    :type billable_weight_calculation_method: str, optional
    :param rating_method: Indicates whether the Shipment was rated at the shipment-level or the package-level. This information will be returned only if RatingMethodRequestedIndicator is present in the request.  Possible values:01 = Shipment level02 = Package level, defaults to None
    :type rating_method: str, optional
    :param billing_weight: Billing Weight Container.
    :type billing_weight: RatedShipmentBillingWeight
    :param transportation_charges: Transportation Charges Container.
    :type transportation_charges: RatedShipmentTransportationCharges
    :param base_service_charge: Base Service Charge Container.  These charges would be returned only when subversion is greater than or equal to 1701, defaults to None
    :type base_service_charge: RatedShipmentBaseServiceCharge, optional
    :param itemized_charges: Itemized Charges are returned only when the subversion element is present and greater than or equal to '1601'. These charges would be returned only when subversion is greater than or equal to 1601. **NOTE:** For versions >= v2403, this element will always be returned as an array. For requests using versions < v2403, this element will be returned as an array if there is more than one object and a single object if there is only 1. , defaults to None
    :type itemized_charges: List[RatedShipmentItemizedCharges], optional
    :param frs_shipment_data: FRSShipmentData container.  Only returned when the FRSShipmentIIndicator is used. UPS Ground Freight Pricing Only., defaults to None
    :type frs_shipment_data: RatedShipmentFrsShipmentData, optional
    :param service_options_charges: Service Options Charges Container.
    :type service_options_charges: RatedShipmentServiceOptionsCharges
    :param tax_charges: TaxCharges container are returned only when TaxInformationIndicator is present in request and when Negotiated Rates are not applicable. TaxCharges container contains Tax information for a given shipment. **NOTE:** For versions >= v2403, this element will always be returned as an array. For requests using versions < v2403, this element will be returned as an array if there is more than one object and a single object if there is only 1. , defaults to None
    :type tax_charges: List[RatedShipmentTaxCharges], optional
    :param total_charges: Total Charges Container.
    :type total_charges: RatedShipmentTotalCharges
    :param total_charges_with_taxes: TotalChargesWithTaxes container would be returned only if TaxInformationIndicator is present in request and when Negotiated Rates are not applicable. TotalChargesWithTaxes contains total charges including total taxes applied to a shipment., defaults to None
    :type total_charges_with_taxes: RatedShipmentTotalChargesWithTaxes, optional
    :param negotiated_rate_charges: Negotiated Rate Charges Container.  For tiered rates and promotional discounts, if a particular shipment based on zone, origin, destination or even shipment size doesn't qualify for the existing discount then no negotiated rates container will be returned. Published rates will be the applicable rate., defaults to None
    :type negotiated_rate_charges: RatedShipmentNegotiatedRateCharges, optional
    :param rated_package: Rated Package Container. **NOTE:** For versions >= v2403, this element will always be returned as an array. For requests using versions < v2403, this element will be returned as an array if there is more than one object and a single object if there is only 1.
    :type rated_package: List[RatedShipmentRatedPackage]
    :param time_in_transit: Container for returned Time in Transit information.  Will only be returned if request option was either "ratetimeintransit" or "shoptimeintransit" and DeliveryTimeInformation container was present in request., defaults to None
    :type time_in_transit: RatedShipmentTimeInTransit, optional
    :param scheduled_delivery_date: The rated shipments scheduled delivery date, ScheduledDeliveryDate returned only when Subversion of 2205 was sent in the request and the customer has the specific contract., defaults to None
    :type scheduled_delivery_date: str, optional
    :param roar_rated_indicator: Informational only, defaults to None
    :type roar_rated_indicator: str, optional
    """

    def __init__(
        self,
        service: RatedShipmentService,
        billing_weight: RatedShipmentBillingWeight,
        transportation_charges: RatedShipmentTransportationCharges,
        service_options_charges: RatedShipmentServiceOptionsCharges,
        total_charges: RatedShipmentTotalCharges,
        rated_package: List[RatedShipmentRatedPackage],
        disclaimer: List[RatedShipmentDisclaimer] = None,
        rate_chart: str = None,
        rated_shipment_alert: List[RatedShipmentRatedShipmentAlert] = None,
        billable_weight_calculation_method: str = None,
        rating_method: str = None,
        base_service_charge: RatedShipmentBaseServiceCharge = None,
        itemized_charges: List[RatedShipmentItemizedCharges] = None,
        frs_shipment_data: RatedShipmentFrsShipmentData = None,
        tax_charges: List[RatedShipmentTaxCharges] = None,
        total_charges_with_taxes: RatedShipmentTotalChargesWithTaxes = None,
        negotiated_rate_charges: RatedShipmentNegotiatedRateCharges = None,
        time_in_transit: RatedShipmentTimeInTransit = None,
        scheduled_delivery_date: str = None,
        roar_rated_indicator: str = None,
    ):
        if disclaimer is not None:
            self.disclaimer = self._define_list(disclaimer, RatedShipmentDisclaimer)
        self.service = self._define_object(service, RatedShipmentService)
        if rate_chart is not None:
            self.rate_chart = rate_chart
        if rated_shipment_alert is not None:
            self.rated_shipment_alert = self._define_list(
                rated_shipment_alert, RatedShipmentRatedShipmentAlert
            )
        if billable_weight_calculation_method is not None:
            self.billable_weight_calculation_method = billable_weight_calculation_method
        if rating_method is not None:
            self.rating_method = rating_method
        self.billing_weight = self._define_object(
            billing_weight, RatedShipmentBillingWeight
        )
        self.transportation_charges = self._define_object(
            transportation_charges, RatedShipmentTransportationCharges
        )
        if base_service_charge is not None:
            self.base_service_charge = self._define_object(
                base_service_charge, RatedShipmentBaseServiceCharge
            )
        if itemized_charges is not None:
            self.itemized_charges = self._define_list(
                itemized_charges, RatedShipmentItemizedCharges
            )
        if frs_shipment_data is not None:
            self.frs_shipment_data = self._define_object(
                frs_shipment_data, RatedShipmentFrsShipmentData
            )
        self.service_options_charges = self._define_object(
            service_options_charges, RatedShipmentServiceOptionsCharges
        )
        if tax_charges is not None:
            self.tax_charges = self._define_list(tax_charges, RatedShipmentTaxCharges)
        self.total_charges = self._define_object(
            total_charges, RatedShipmentTotalCharges
        )
        if total_charges_with_taxes is not None:
            self.total_charges_with_taxes = self._define_object(
                total_charges_with_taxes, RatedShipmentTotalChargesWithTaxes
            )
        if negotiated_rate_charges is not None:
            self.negotiated_rate_charges = self._define_object(
                negotiated_rate_charges, RatedShipmentNegotiatedRateCharges
            )
        self.rated_package = self._define_list(rated_package, RatedShipmentRatedPackage)
        if time_in_transit is not None:
            self.time_in_transit = self._define_object(
                time_in_transit, RatedShipmentTimeInTransit
            )
        if scheduled_delivery_date is not None:
            self.scheduled_delivery_date = scheduled_delivery_date
        if roar_rated_indicator is not None:
            self.roar_rated_indicator = roar_rated_indicator
