# 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 .rate_response_response import RateResponseResponse
from .rate_response_rated_shipment import RateResponseRatedShipment


@JsonMap({"response": "Response", "rated_shipment": "RatedShipment"})
class RateResponse(BaseModel):
    """Rate Response Container.

    :param response: Response Container.
    :type response: RateResponseResponse
    :param rated_shipment: RatedShipment 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_shipment: List[RateResponseRatedShipment]
    """

    def __init__(
        self,
        response: RateResponseResponse,
        rated_shipment: List[RateResponseRatedShipment],
    ):
        self.response = self._define_object(response, RateResponseResponse)
        self.rated_shipment = self._define_list(
            rated_shipment, RateResponseRatedShipment
        )
