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

from __future__ import annotations
from .utils.json_map import JsonMap
from .base import BaseModel
from .rate_request_request import RateRequestRequest
from .rate_request_pickup_type import RateRequestPickupType
from .rate_request_customer_classification import RateRequestCustomerClassification
from .rate_request_shipment import RateRequestShipment


@JsonMap(
    {
        "request": "Request",
        "pickup_type": "PickupType",
        "customer_classification": "CustomerClassification",
        "shipment": "Shipment",
    }
)
class RateRequest(BaseModel):
    """Rate Request container.

    :param request: Request container.  N/A
    :type request: RateRequestRequest
    :param pickup_type: Pickup Type container tag., defaults to None
    :type pickup_type: RateRequestPickupType, optional
    :param customer_classification: Customer classification container. Valid if ShipFrom country or territory  is "US", defaults to None
    :type customer_classification: RateRequestCustomerClassification, optional
    :param shipment: Container for Shipment Information.
    :type shipment: RateRequestShipment
    """

    def __init__(
        self,
        request: RateRequestRequest,
        shipment: RateRequestShipment,
        pickup_type: RateRequestPickupType = None,
        customer_classification: RateRequestCustomerClassification = None,
    ):
        self.request = self._define_object(request, RateRequestRequest)
        if pickup_type is not None:
            self.pickup_type = self._define_object(pickup_type, RateRequestPickupType)
        if customer_classification is not None:
            self.customer_classification = self._define_object(
                customer_classification, RateRequestCustomerClassification
            )
        self.shipment = self._define_object(shipment, RateRequestShipment)
