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

from typing import List
from .utils.json_map import JsonMap
from .base import BaseModel


@JsonMap(
    {
        "address_line": "AddressLine",
        "city": "City",
        "state_province_code": "StateProvinceCode",
        "postal_code": "PostalCode",
        "country_code": "CountryCode",
    }
)
class ShipFromAddress(BaseModel):
    """Address container for Ship From.  Address Container

    :param address_line: The origin street address including name and number (when applicable).  Length is not validated.
    :type address_line: List[str]
    :param city: Origin city.  Required if country or territory does not utilize postal codes. Length is not validated., defaults to None
    :type city: str, optional
    :param state_province_code: Origin state code.  A StateProvinceCode and valid account number are required when requesting negotiated rates. Otherwise the StateProvinceCode is optional. If the TaxInformationIndicator flag is present in the request, a StateProvinceCode must be entered for tax charges to be accurately calculated in the response. , defaults to None
    :type state_province_code: str, optional
    :param postal_code: Origin postal code.  Required if country or territory utilizes postal codes (e.g. US and PR)., defaults to None
    :type postal_code: str, optional
    :param country_code: Origin country or territory code. Refer to the Supported Country or Territory Tables located in the Appendix.  Required, but defaults to US.
    :type country_code: str
    """

    def __init__(
        self,
        address_line: List[str],
        country_code: str,
        city: str = None,
        state_province_code: str = None,
        postal_code: str = None,
    ):
        self.address_line = address_line
        if city is not None:
            self.city = city
        if state_province_code is not None:
            self.state_province_code = state_province_code
        if postal_code is not None:
            self.postal_code = postal_code
        self.country_code = country_code
