# 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 .shipment_shipper import ShipmentShipper
from .shipment_ship_to import ShipmentShipTo
from .shipment_ship_from import ShipmentShipFrom
from .shipment_alternate_delivery_address import ShipmentAlternateDeliveryAddress
from .shipment_shipment_indication_type import ShipmentShipmentIndicationType
from .shipment_payment_details import ShipmentPaymentDetails
from .shipment_frs_payment_information import ShipmentFrsPaymentInformation
from .shipment_freight_shipment_information import ShipmentFreightShipmentInformation
from .shipment_service import ShipmentService
from .shipment_shipment_total_weight import ShipmentShipmentTotalWeight
from .shipment_package import ShipmentPackage
from .shipment_shipment_service_options import ShipmentShipmentServiceOptions
from .shipment_shipment_rating_options import ShipmentShipmentRatingOptions
from .shipment_invoice_line_total import ShipmentInvoiceLineTotal
from .shipment_promotional_discount_information import (
    ShipmentPromotionalDiscountInformation,
)
from .shipment_delivery_time_information import ShipmentDeliveryTimeInformation


@JsonMap(
    {
        "origin_record_transaction_timestamp": "OriginRecordTransactionTimestamp",
        "shipper": "Shipper",
        "ship_to": "ShipTo",
        "ship_from": "ShipFrom",
        "alternate_delivery_address": "AlternateDeliveryAddress",
        "shipment_indication_type": "ShipmentIndicationType",
        "payment_details": "PaymentDetails",
        "frs_payment_information": "FRSPaymentInformation",
        "freight_shipment_information": "FreightShipmentInformation",
        "goods_not_in_free_circulation_indicator": "GoodsNotInFreeCirculationIndicator",
        "service": "Service",
        "num_of_pieces": "NumOfPieces",
        "shipment_total_weight": "ShipmentTotalWeight",
        "documents_only_indicator": "DocumentsOnlyIndicator",
        "package": "Package",
        "shipment_service_options": "ShipmentServiceOptions",
        "shipment_rating_options": "ShipmentRatingOptions",
        "invoice_line_total": "InvoiceLineTotal",
        "rating_method_requested_indicator": "RatingMethodRequestedIndicator",
        "tax_information_indicator": "TaxInformationIndicator",
        "promotional_discount_information": "PromotionalDiscountInformation",
        "delivery_time_information": "DeliveryTimeInformation",
        "master_carton_indicator": "MasterCartonIndicator",
        "wwe_shipment_indicator": "WWEShipmentIndicator",
    }
)
class RateRequestShipment(BaseModel):
    """Container for Shipment Information.

    :param origin_record_transaction_timestamp: The time that the request was made from the originating system. UTC time down to milliseconds. Example - 2016-07-14T12:01:33.999  Applicable only for HazMat request and with subversion greater than or equal to 1701., defaults to None
    :type origin_record_transaction_timestamp: str, optional
    :param shipper: Shipper container. Information associated with the UPS account number.
    :type shipper: ShipmentShipper
    :param ship_to: Ship To Container
    :type ship_to: ShipmentShipTo
    :param ship_from: Ship From Container., defaults to None
    :type ship_from: ShipmentShipFrom, optional
    :param alternate_delivery_address: Alternate Delivery Address container. Applies for deliveries to UPS Access Point™ locations. Required for the following ShipmentIndicationType values: - 01 - Hold for Pickup at UPS Access Point™ - 02 - UPS Access Point™ Delivery , defaults to None
    :type alternate_delivery_address: ShipmentAlternateDeliveryAddress, optional
    :param shipment_indication_type: shipment_indication_type, defaults to None
    :type shipment_indication_type: List[ShipmentShipmentIndicationType], optional
    :param payment_details: Payment details container for detailed shipment charges. The two shipment charges that are available for specification are Transportation charges and Duties and Taxes.  This container is used for Who Pays What functionality., defaults to None
    :type payment_details: ShipmentPaymentDetails, optional
    :param frs_payment_information: UPS Ground Freight Pricing (GFP) Payment Information container.  Required only for GFP and when the FRSIndicator is present., defaults to None
    :type frs_payment_information: ShipmentFrsPaymentInformation, optional
    :param freight_shipment_information: Container to hold Freight Shipment information., defaults to None
    :type freight_shipment_information: ShipmentFreightShipmentInformation, optional
    :param goods_not_in_free_circulation_indicator: Goods Not In Free Circulation indicator.  This is an empty tag, any value inside is ignored. This indicator is invalid for a package type of UPS Letter and DocumentsOnly., defaults to None
    :type goods_not_in_free_circulation_indicator: str, optional
    :param service: Service Container.  Only valid with RequestOption = Rate for both Small package and GFP Rating requests., defaults to None
    :type service: ShipmentService, optional
    :param num_of_pieces: Total number of pieces in all pallets. Required for UPS Worldwide Express Freight and UPS Worldwide Express Freight Midday shipments., defaults to None
    :type num_of_pieces: str, optional
    :param shipment_total_weight: Shipment Total Weight Container. This container is only applicable for "ratetimeintransit" and "shoptimeintransit" request options.  Required for all international shipments when retreiving time in transit information, including letters and documents shipments., defaults to None
    :type shipment_total_weight: ShipmentShipmentTotalWeight, optional
    :param documents_only_indicator: Valid values are Document and Non-document. If the indicator is present then the value is Document else Non-Document. Note: Not applicable for FRS rating  requests.  Empty Tag., defaults to None
    :type documents_only_indicator: str, optional
    :param package: package
    :type package: List[ShipmentPackage]
    :param shipment_service_options: Shipment level Accessorials are included in this container., defaults to None
    :type shipment_service_options: ShipmentShipmentServiceOptions, optional
    :param shipment_rating_options: Shipment Rating Options container., defaults to None
    :type shipment_rating_options: ShipmentShipmentRatingOptions, optional
    :param invoice_line_total: Container to hold InvoiceLineTotal Information.  Required if the shipment is from US/PR Outbound to non US/PR destination with the PackagingType of UPS PAK(04).Required for international shipments when using request option "ratetimeintransit" or "shoptimeintransit"., defaults to None
    :type invoice_line_total: ShipmentInvoiceLineTotal, optional
    :param rating_method_requested_indicator: Presence/Absence Indicator. Any value inside is ignored. RatingMethodRequestedIndicator is an indicator. If present, Billable Weight Calculation method and Rating Method information would be returned in response., defaults to None
    :type rating_method_requested_indicator: str, optional
    :param tax_information_indicator: Presence/Absence Indicator. Any value inside is ignored. TaxInformationIndicator is an indicator. The Tax related information includes any type of Taxes, corresponding Monetary Values, Total Charges with Taxes and disclaimers (if applicable) would be returned in response.  If present, any taxes that may be applicable to a shipment would be returned in response. If this indicator is requested with NegotiatedRatesIndicator, Tax related information, if applicable, would be returned only for Negotiated Rates and not for Published Rates., defaults to None
    :type tax_information_indicator: str, optional
    :param promotional_discount_information: PromotionalDiscountInformation container. This container contains discount information that the customer wants to request each time while placing a shipment., defaults to None
    :type promotional_discount_information: ShipmentPromotionalDiscountInformation, optional
    :param delivery_time_information: Container for requesting Time In Transit Information. Required to view time in transit information.  Required to view any time in transit information., defaults to None
    :type delivery_time_information: ShipmentDeliveryTimeInformation, optional
    :param master_carton_indicator: Presence/Absence Indicator. Any value inside is ignored. MasterCartonIndicator is an indicator and presence implies that shipment is Master Carton type.  If present, the shipment will be rated as a Master Carton Type. If this indicator is requested with NegotiatedRatesIndicator, rates would be returned only for Negotiated Rates and not for Published Rates., defaults to None
    :type master_carton_indicator: str, optional
    :param wwe_shipment_indicator: Presence/Absence Indicator. Any value inside is ignored. WWEShipmentIndicator is an indicator and presence implies that WWE service details requested for RequestOption=Shop or  RequestOption=Shoptimeintransit  RequestOption=Shop or  RequestOption=Shoptimeintransit, defaults to None
    :type wwe_shipment_indicator: str, optional
    """

    def __init__(
        self,
        shipper: ShipmentShipper,
        ship_to: ShipmentShipTo,
        package: List[ShipmentPackage],
        origin_record_transaction_timestamp: str = None,
        ship_from: ShipmentShipFrom = None,
        alternate_delivery_address: ShipmentAlternateDeliveryAddress = None,
        shipment_indication_type: List[ShipmentShipmentIndicationType] = None,
        payment_details: ShipmentPaymentDetails = None,
        frs_payment_information: ShipmentFrsPaymentInformation = None,
        freight_shipment_information: ShipmentFreightShipmentInformation = None,
        goods_not_in_free_circulation_indicator: str = None,
        service: ShipmentService = None,
        num_of_pieces: str = None,
        shipment_total_weight: ShipmentShipmentTotalWeight = None,
        documents_only_indicator: str = None,
        shipment_service_options: ShipmentShipmentServiceOptions = None,
        shipment_rating_options: ShipmentShipmentRatingOptions = None,
        invoice_line_total: ShipmentInvoiceLineTotal = None,
        rating_method_requested_indicator: str = None,
        tax_information_indicator: str = None,
        promotional_discount_information: ShipmentPromotionalDiscountInformation = None,
        delivery_time_information: ShipmentDeliveryTimeInformation = None,
        master_carton_indicator: str = None,
        wwe_shipment_indicator: str = None,
    ):
        if origin_record_transaction_timestamp is not None:
            self.origin_record_transaction_timestamp = (
                origin_record_transaction_timestamp
            )
        self.shipper = self._define_object(shipper, ShipmentShipper)
        self.ship_to = self._define_object(ship_to, ShipmentShipTo)
        if ship_from is not None:
            self.ship_from = self._define_object(ship_from, ShipmentShipFrom)
        if alternate_delivery_address is not None:
            self.alternate_delivery_address = self._define_object(
                alternate_delivery_address, ShipmentAlternateDeliveryAddress
            )
        if shipment_indication_type is not None:
            self.shipment_indication_type = self._define_list(
                shipment_indication_type, ShipmentShipmentIndicationType
            )
        if payment_details is not None:
            self.payment_details = self._define_object(
                payment_details, ShipmentPaymentDetails
            )
        if frs_payment_information is not None:
            self.frs_payment_information = self._define_object(
                frs_payment_information, ShipmentFrsPaymentInformation
            )
        if freight_shipment_information is not None:
            self.freight_shipment_information = self._define_object(
                freight_shipment_information, ShipmentFreightShipmentInformation
            )
        if goods_not_in_free_circulation_indicator is not None:
            self.goods_not_in_free_circulation_indicator = (
                goods_not_in_free_circulation_indicator
            )
        if service is not None:
            self.service = self._define_object(service, ShipmentService)
        if num_of_pieces is not None:
            self.num_of_pieces = num_of_pieces
        if shipment_total_weight is not None:
            self.shipment_total_weight = self._define_object(
                shipment_total_weight, ShipmentShipmentTotalWeight
            )
        if documents_only_indicator is not None:
            self.documents_only_indicator = documents_only_indicator
        self.package = self._define_list(package, ShipmentPackage)
        if shipment_service_options is not None:
            self.shipment_service_options = self._define_object(
                shipment_service_options, ShipmentShipmentServiceOptions
            )
        if shipment_rating_options is not None:
            self.shipment_rating_options = self._define_object(
                shipment_rating_options, ShipmentShipmentRatingOptions
            )
        if invoice_line_total is not None:
            self.invoice_line_total = self._define_object(
                invoice_line_total, ShipmentInvoiceLineTotal
            )
        if rating_method_requested_indicator is not None:
            self.rating_method_requested_indicator = rating_method_requested_indicator
        if tax_information_indicator is not None:
            self.tax_information_indicator = tax_information_indicator
        if promotional_discount_information is not None:
            self.promotional_discount_information = self._define_object(
                promotional_discount_information, ShipmentPromotionalDiscountInformation
            )
        if delivery_time_information is not None:
            self.delivery_time_information = self._define_object(
                delivery_time_information, ShipmentDeliveryTimeInformation
            )
        if master_carton_indicator is not None:
            self.master_carton_indicator = master_carton_indicator
        if wwe_shipment_indicator is not None:
            self.wwe_shipment_indicator = wwe_shipment_indicator
