# 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 .response_response_status import ResponseResponseStatus
from .response_alert import ResponseAlert
from .response_alert_detail import ResponseAlertDetail
from .response_transaction_reference import ResponseTransactionReference


@JsonMap(
    {
        "response_status": "ResponseStatus",
        "alert": "Alert",
        "alert_detail": "AlertDetail",
        "transaction_reference": "TransactionReference",
    }
)
class RateResponseResponse(BaseModel):
    """Response Container.

    :param response_status: Response Status Container.
    :type response_status: ResponseResponseStatus
    :param alert: Alert Container.  There can be zero to many alert containers with code and description. **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. , defaults to None
    :type alert: List[ResponseAlert], optional
    :param alert_detail: Alert Detail Container. Currently applies to and returned only for request containing HazMat and SubVersion greater than or equal to 1701. **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. , defaults to None
    :type alert_detail: List[ResponseAlertDetail], optional
    :param transaction_reference: Transaction Reference Container., defaults to None
    :type transaction_reference: ResponseTransactionReference, optional
    """

    def __init__(
        self,
        response_status: ResponseResponseStatus,
        alert: List[ResponseAlert] = None,
        alert_detail: List[ResponseAlertDetail] = None,
        transaction_reference: ResponseTransactionReference = None,
    ):
        self.response_status = self._define_object(
            response_status, ResponseResponseStatus
        )
        if alert is not None:
            self.alert = self._define_list(alert, ResponseAlert)
        if alert_detail is not None:
            self.alert_detail = self._define_list(alert_detail, ResponseAlertDetail)
        if transaction_reference is not None:
            self.transaction_reference = self._define_object(
                transaction_reference, ResponseTransactionReference
            )
