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

from __future__ import annotations
from .utils.json_map import JsonMap
from .base import BaseModel
from .request_transaction_reference import RequestTransactionReference


@JsonMap(
    {
        "request_option": "RequestOption",
        "sub_version": "SubVersion",
        "transaction_reference": "TransactionReference",
    }
)
class RateRequestRequest(BaseModel):
    """Request container.  N/A

    :param request_option: Used to define the request type. Valid Values: - Rate = The server rates (The default Request option is Rate if a Request Option is not provided). - Shop = The server validates the shipment, and returns rates for all UPS products from the ShipFrom to the ShipTo addresses. - Ratetimeintransit = The server rates with transit time information - Shoptimeintransit = The server validates the shipment, and returns rates and transit times for all UPS products from the ShipFrom to the ShipTo addresses. Rate is the only valid request option for UPS Ground Freight Pricing requests.
    :type request_option: str
    :param sub_version: Indicates Rate API to display the new release features in Rate API response based on Rate release. See the What's New section for the latest Rate release. Supported values: 1601, 1607, 1701, 1707, 2108, 2205, defaults to None
    :type sub_version: str, optional
    :param transaction_reference: TransactionReference identifies transactions between client and server., defaults to None
    :type transaction_reference: RequestTransactionReference, optional
    """

    def __init__(
        self,
        request_option: str,
        sub_version: str = None,
        transaction_reference: RequestTransactionReference = None,
    ):
        self.request_option = request_option
        if sub_version is not None:
            self.sub_version = sub_version
        if transaction_reference is not None:
            self.transaction_reference = self._define_object(
                transaction_reference, RequestTransactionReference
            )
