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

from __future__ import annotations
from .utils.json_map import JsonMap
from .base import BaseModel
from .shipment_charge_bill_shipper import ShipmentChargeBillShipper
from .shipment_charge_bill_receiver import ShipmentChargeBillReceiver
from .shipment_charge_bill_third_party import ShipmentChargeBillThirdParty


@JsonMap(
    {
        "type_": "Type",
        "bill_shipper": "BillShipper",
        "bill_receiver": "BillReceiver",
        "bill_third_party": "BillThirdParty",
        "consignee_billed_indicator": "ConsigneeBilledIndicator",
    }
)
class PaymentDetailsShipmentCharge(BaseModel):
    """Shipment charge container.  If Duty and Tax charges are applicable to a shipment and a payer is not specified, the default payer of Duty and Tax charges is Bill to Receiver. There will be no default payer of Duty and Tax charges for DDU and DDP service.

    :param type_: Values are 01 = Transportation, 02 = Duties and Taxes
    :type type_: str
    :param bill_shipper: Container for the BillShipper billing option.  This element or its sibling element, BillReceiver, BillThirdParty or ConsigneeBilledIndicator, must be present but no more than one can be present., defaults to None
    :type bill_shipper: ShipmentChargeBillShipper, optional
    :param bill_receiver: Container for the BillReceiver billing option.  This element or its sibling element, BillShipper, BillThirdParty or Consignee Billed, must be present but no more than one can be present. For a return shipment, Bill Receiver is invalid for Transportation charges., defaults to None
    :type bill_receiver: ShipmentChargeBillReceiver, optional
    :param bill_third_party: Container for the third party billing option.  This element or its sibling element, BillShipper, BillReceiver or Consignee Billed, must be present but no more than one can be present., defaults to None
    :type bill_third_party: ShipmentChargeBillThirdParty, optional
    :param consignee_billed_indicator: Consignee Billing payment option indicator. The presence indicates consignee billing option is selected. The absence indicates one of the other payment options is selected.  Empty Tag. This element or its sibling element, BillShipper, BillReceiver or BillThirdParty, must be present but no more than one can be present. This billing option is valid for a shipment charge type of Transportation only. Only applies to US/PR and PR/US shipment origins and destination., defaults to None
    :type consignee_billed_indicator: str, optional
    """

    def __init__(
        self,
        type_: str,
        bill_shipper: ShipmentChargeBillShipper = None,
        bill_receiver: ShipmentChargeBillReceiver = None,
        bill_third_party: ShipmentChargeBillThirdParty = None,
        consignee_billed_indicator: str = None,
    ):
        self.type_ = type_
        if bill_shipper is not None:
            self.bill_shipper = self._define_object(
                bill_shipper, ShipmentChargeBillShipper
            )
        if bill_receiver is not None:
            self.bill_receiver = self._define_object(
                bill_receiver, ShipmentChargeBillReceiver
            )
        if bill_third_party is not None:
            self.bill_third_party = self._define_object(
                bill_third_party, ShipmentChargeBillThirdParty
            )
        if consignee_billed_indicator is not None:
            self.consignee_billed_indicator = consignee_billed_indicator
