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

from __future__ import annotations
from .utils.json_map import JsonMap
from .base import BaseModel
from .shipper_address import ShipperAddress


@JsonMap(
    {
        "name": "Name",
        "attention_name": "AttentionName",
        "shipper_number": "ShipperNumber",
        "address": "Address",
    }
)
class ShipmentShipper(BaseModel):
    """Shipper container. Information associated with the UPS account number.

    :param name: Shipper's name or company name.  Length is not validated., defaults to None
    :type name: str, optional
    :param attention_name: Shipper's attention name.  Length is not validated., defaults to None
    :type attention_name: str, optional
    :param shipper_number: Shipper's UPS account number.  A valid account number is required to receive negotiated rates. Optional otherwise. Cannot be present when requesting UserLevelDiscount., defaults to None
    :type shipper_number: str, optional
    :param address: Address Container.  If the ShipFrom container is not present then this address will be used as the ShipFrom. If this address is used as the ShipFrom, the shipment will be rated from this origin address.
    :type address: ShipperAddress
    """

    def __init__(
        self,
        address: ShipperAddress,
        name: str = None,
        attention_name: str = None,
        shipper_number: str = None,
    ):
        if name is not None:
            self.name = name
        if attention_name is not None:
            self.attention_name = attention_name
        if shipper_number is not None:
            self.shipper_number = shipper_number
        self.address = self._define_object(address, ShipperAddress)
