# coding: utf-8

"""
    The Selling Partner API for FBA inbound operations.

    The Selling Partner API for Fulfillment By Amazon (FBA) Inbound. The FBA Inbound API enables building inbound workflows to create, manage, and send shipments into Amazon's fulfillment network. The API has interoperability with the Send-to-Amazon user interface.

    The version of the OpenAPI document: 2024-03-20
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


import pprint
import re  # noqa: F401

import six

from spapi.configuration import Configuration


class TransportationOption(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    swagger_types = {
        'carrier': 'Carrier',
        'carrier_appointment': 'CarrierAppointment',
        'preconditions': 'List[str]',
        'quote': 'Quote',
        'shipment_id': 'str',
        'shipping_mode': 'str',
        'shipping_solution': 'str',
        'transportation_option_id': 'str',
    }

    attribute_map = {
        'carrier': 'carrier',
        'carrier_appointment': 'carrierAppointment',
        'preconditions': 'preconditions',
        'quote': 'quote',
        'shipment_id': 'shipmentId',
        'shipping_mode': 'shippingMode',
        'shipping_solution': 'shippingSolution',
        'transportation_option_id': 'transportationOptionId',
    }

    def __init__(self, carrier=None, carrier_appointment=None, preconditions=None, quote=None, shipment_id=None, shipping_mode=None, shipping_solution=None, transportation_option_id=None, _configuration=None):  # noqa: E501
        """TransportationOption - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._carrier = None
        self._carrier_appointment = None
        self._preconditions = None
        self._quote = None
        self._shipment_id = None
        self._shipping_mode = None
        self._shipping_solution = None
        self._transportation_option_id = None
        self.discriminator = None

        self.carrier = carrier
        if carrier_appointment is not None:
            self.carrier_appointment = carrier_appointment
        self.preconditions = preconditions
        if quote is not None:
            self.quote = quote
        self.shipment_id = shipment_id
        self.shipping_mode = shipping_mode
        self.shipping_solution = shipping_solution
        self.transportation_option_id = transportation_option_id

    @property
    def carrier(self):
        """Gets the carrier of this TransportationOption.  # noqa: E501


        :return: The carrier of this TransportationOption.  # noqa: E501
        :rtype: Carrier
        """
        return self._carrier

    @carrier.setter
    def carrier(self, carrier):
        """Sets the carrier of this TransportationOption.


        :param carrier: The carrier of this TransportationOption.  # noqa: E501
        :type: Carrier
        """
        if self._configuration.client_side_validation and carrier is None:
            raise ValueError("Invalid value for `carrier`, must not be `None`")  # noqa: E501

        self._carrier = carrier

    @property
    def carrier_appointment(self):
        """Gets the carrier_appointment of this TransportationOption.  # noqa: E501


        :return: The carrier_appointment of this TransportationOption.  # noqa: E501
        :rtype: CarrierAppointment
        """
        return self._carrier_appointment

    @carrier_appointment.setter
    def carrier_appointment(self, carrier_appointment):
        """Sets the carrier_appointment of this TransportationOption.


        :param carrier_appointment: The carrier_appointment of this TransportationOption.  # noqa: E501
        :type: CarrierAppointment
        """

        self._carrier_appointment = carrier_appointment

    @property
    def preconditions(self):
        """Gets the preconditions of this TransportationOption.  # noqa: E501

        Identifies a list of preconditions for confirming the transportation option.  # noqa: E501

        :return: The preconditions of this TransportationOption.  # noqa: E501
        :rtype: List[str]
        """
        return self._preconditions

    @preconditions.setter
    def preconditions(self, preconditions):
        """Sets the preconditions of this TransportationOption.

        Identifies a list of preconditions for confirming the transportation option.  # noqa: E501

        :param preconditions: The preconditions of this TransportationOption.  # noqa: E501
        :type: List[str]
        """
        if self._configuration.client_side_validation and preconditions is None:
            raise ValueError("Invalid value for `preconditions`, must not be `None`")  # noqa: E501

        self._preconditions = preconditions

    @property
    def quote(self):
        """Gets the quote of this TransportationOption.  # noqa: E501


        :return: The quote of this TransportationOption.  # noqa: E501
        :rtype: Quote
        """
        return self._quote

    @quote.setter
    def quote(self, quote):
        """Sets the quote of this TransportationOption.


        :param quote: The quote of this TransportationOption.  # noqa: E501
        :type: Quote
        """

        self._quote = quote

    @property
    def shipment_id(self):
        """Gets the shipment_id of this TransportationOption.  # noqa: E501

        Identifier of a shipment. A shipment contains the boxes and units being inbounded.  # noqa: E501

        :return: The shipment_id of this TransportationOption.  # noqa: E501
        :rtype: str
        """
        return self._shipment_id

    @shipment_id.setter
    def shipment_id(self, shipment_id):
        """Sets the shipment_id of this TransportationOption.

        Identifier of a shipment. A shipment contains the boxes and units being inbounded.  # noqa: E501

        :param shipment_id: The shipment_id of this TransportationOption.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and shipment_id is None:
            raise ValueError("Invalid value for `shipment_id`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                shipment_id is not None and len(shipment_id) > 38):
            raise ValueError("Invalid value for `shipment_id`, length must be less than or equal to `38`")  # noqa: E501
        if (self._configuration.client_side_validation and
                shipment_id is not None and len(shipment_id) < 38):
            raise ValueError("Invalid value for `shipment_id`, length must be greater than or equal to `38`")  # noqa: E501
        if (self._configuration.client_side_validation and
                shipment_id is not None and not re.search(r'^[a-zA-Z0-9-]*$', shipment_id)):  # noqa: E501
            raise ValueError(r"Invalid value for `shipment_id`, must be a follow pattern or equal to `/^[a-zA-Z0-9-]*$/`")  # noqa: E501

        self._shipment_id = shipment_id

    @property
    def shipping_mode(self):
        """Gets the shipping_mode of this TransportationOption.  # noqa: E501

        Mode of shipment transportation that this option will provide.  Possible values: `GROUND_SMALL_PARCEL`, `FREIGHT_LTL`, `FREIGHT_FTL_PALLET`, `FREIGHT_FTL_NONPALLET`, `OCEAN_LCL`, `OCEAN_FCL`, `AIR_SMALL_PARCEL`, `AIR_SMALL_PARCEL_EXPRESS`.  # noqa: E501

        :return: The shipping_mode of this TransportationOption.  # noqa: E501
        :rtype: str
        """
        return self._shipping_mode

    @shipping_mode.setter
    def shipping_mode(self, shipping_mode):
        """Sets the shipping_mode of this TransportationOption.

        Mode of shipment transportation that this option will provide.  Possible values: `GROUND_SMALL_PARCEL`, `FREIGHT_LTL`, `FREIGHT_FTL_PALLET`, `FREIGHT_FTL_NONPALLET`, `OCEAN_LCL`, `OCEAN_FCL`, `AIR_SMALL_PARCEL`, `AIR_SMALL_PARCEL_EXPRESS`.  # noqa: E501

        :param shipping_mode: The shipping_mode of this TransportationOption.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and shipping_mode is None:
            raise ValueError("Invalid value for `shipping_mode`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                shipping_mode is not None and len(shipping_mode) > 1024):
            raise ValueError("Invalid value for `shipping_mode`, length must be less than or equal to `1024`")  # noqa: E501
        if (self._configuration.client_side_validation and
                shipping_mode is not None and len(shipping_mode) < 1):
            raise ValueError("Invalid value for `shipping_mode`, length must be greater than or equal to `1`")  # noqa: E501

        self._shipping_mode = shipping_mode

    @property
    def shipping_solution(self):
        """Gets the shipping_solution of this TransportationOption.  # noqa: E501

        Shipping program for the option. Possible values: `AMAZON_PARTNERED_CARRIER`, `USE_YOUR_OWN_CARRIER`.  # noqa: E501

        :return: The shipping_solution of this TransportationOption.  # noqa: E501
        :rtype: str
        """
        return self._shipping_solution

    @shipping_solution.setter
    def shipping_solution(self, shipping_solution):
        """Sets the shipping_solution of this TransportationOption.

        Shipping program for the option. Possible values: `AMAZON_PARTNERED_CARRIER`, `USE_YOUR_OWN_CARRIER`.  # noqa: E501

        :param shipping_solution: The shipping_solution of this TransportationOption.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and shipping_solution is None:
            raise ValueError("Invalid value for `shipping_solution`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                shipping_solution is not None and len(shipping_solution) > 1024):
            raise ValueError("Invalid value for `shipping_solution`, length must be less than or equal to `1024`")  # noqa: E501
        if (self._configuration.client_side_validation and
                shipping_solution is not None and len(shipping_solution) < 1):
            raise ValueError("Invalid value for `shipping_solution`, length must be greater than or equal to `1`")  # noqa: E501

        self._shipping_solution = shipping_solution

    @property
    def transportation_option_id(self):
        """Gets the transportation_option_id of this TransportationOption.  # noqa: E501

        Identifier of a transportation option. A transportation option represent one option for how to send a shipment.  # noqa: E501

        :return: The transportation_option_id of this TransportationOption.  # noqa: E501
        :rtype: str
        """
        return self._transportation_option_id

    @transportation_option_id.setter
    def transportation_option_id(self, transportation_option_id):
        """Sets the transportation_option_id of this TransportationOption.

        Identifier of a transportation option. A transportation option represent one option for how to send a shipment.  # noqa: E501

        :param transportation_option_id: The transportation_option_id of this TransportationOption.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and transportation_option_id is None:
            raise ValueError("Invalid value for `transportation_option_id`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                transportation_option_id is not None and len(transportation_option_id) > 38):
            raise ValueError("Invalid value for `transportation_option_id`, length must be less than or equal to `38`")  # noqa: E501
        if (self._configuration.client_side_validation and
                transportation_option_id is not None and len(transportation_option_id) < 38):
            raise ValueError("Invalid value for `transportation_option_id`, length must be greater than or equal to `38`")  # noqa: E501
        if (self._configuration.client_side_validation and
                transportation_option_id is not None and not re.search(r'^[a-zA-Z0-9-]*$', transportation_option_id)):  # noqa: E501
            raise ValueError(r"Invalid value for `transportation_option_id`, must be a follow pattern or equal to `/^[a-zA-Z0-9-]*$/`")  # noqa: E501

        self._transportation_option_id = transportation_option_id

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value
        if issubclass(TransportationOption, dict):
            for key, value in self.items():
                result[key] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, TransportationOption):
            return False

        return self.to_dict() == other.to_dict()

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        if not isinstance(other, TransportationOption):
            return True

        return self.to_dict() != other.to_dict()
