# coding: utf-8

"""
    Selling Partner API for Retail Procurement Orders

    The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data.

    The version of the OpenAPI document: v1
    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 ImportDetails(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 = {
        'method_of_payment': 'str',
        'international_commercial_terms': 'str',
        'port_of_delivery': 'str',
        'import_containers': 'str',
        'shipping_instructions': 'str',
    }

    attribute_map = {
        'method_of_payment': 'methodOfPayment',
        'international_commercial_terms': 'internationalCommercialTerms',
        'port_of_delivery': 'portOfDelivery',
        'import_containers': 'importContainers',
        'shipping_instructions': 'shippingInstructions',
    }

    def __init__(self, method_of_payment=None, international_commercial_terms=None, port_of_delivery=None, import_containers=None, shipping_instructions=None, _configuration=None):  # noqa: E501
        """ImportDetails - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._method_of_payment = None
        self._international_commercial_terms = None
        self._port_of_delivery = None
        self._import_containers = None
        self._shipping_instructions = None
        self.discriminator = None

        if method_of_payment is not None:
            self.method_of_payment = method_of_payment
        if international_commercial_terms is not None:
            self.international_commercial_terms = international_commercial_terms
        if port_of_delivery is not None:
            self.port_of_delivery = port_of_delivery
        if import_containers is not None:
            self.import_containers = import_containers
        if shipping_instructions is not None:
            self.shipping_instructions = shipping_instructions

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

        If the recipient requests, contains the shipment method of payment. This is for import PO's only.  # noqa: E501

        :return: The method_of_payment of this ImportDetails.  # noqa: E501
        :rtype: str
        """
        return self._method_of_payment

    @method_of_payment.setter
    def method_of_payment(self, method_of_payment):
        """Sets the method_of_payment of this ImportDetails.

        If the recipient requests, contains the shipment method of payment. This is for import PO's only.  # noqa: E501

        :param method_of_payment: The method_of_payment of this ImportDetails.  # noqa: E501
        :type: str
        """
        allowed_values = ["PaidByBuyer", "CollectOnDelivery", "DefinedByBuyerAndSeller", "FOBPortOfCall", "PrepaidBySeller", "PaidBySeller"]  # noqa: E501
        if (self._configuration.client_side_validation and
                method_of_payment not in allowed_values):
            raise ValueError(
                "Invalid value for `method_of_payment` ({0}), must be one of {1}"  # noqa: E501
                .format(method_of_payment, allowed_values)
            )

        self._method_of_payment = method_of_payment

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

        Incoterms (International Commercial Terms) are used to divide transaction costs and responsibilities between buyer and seller and reflect state-of-the-art transportation practices. This is for import purchase orders only.   # noqa: E501

        :return: The international_commercial_terms of this ImportDetails.  # noqa: E501
        :rtype: str
        """
        return self._international_commercial_terms

    @international_commercial_terms.setter
    def international_commercial_terms(self, international_commercial_terms):
        """Sets the international_commercial_terms of this ImportDetails.

        Incoterms (International Commercial Terms) are used to divide transaction costs and responsibilities between buyer and seller and reflect state-of-the-art transportation practices. This is for import purchase orders only.   # noqa: E501

        :param international_commercial_terms: The international_commercial_terms of this ImportDetails.  # noqa: E501
        :type: str
        """
        allowed_values = ["ExWorks", "FreeCarrier", "FreeOnBoard", "FreeAlongSideShip", "CarriagePaidTo", "CostAndFreight", "CarriageAndInsurancePaidTo", "CostInsuranceAndFreight", "DeliveredAtTerminal", "DeliveredAtPlace", "DeliverDutyPaid"]  # noqa: E501
        if (self._configuration.client_side_validation and
                international_commercial_terms not in allowed_values):
            raise ValueError(
                "Invalid value for `international_commercial_terms` ({0}), must be one of {1}"  # noqa: E501
                .format(international_commercial_terms, allowed_values)
            )

        self._international_commercial_terms = international_commercial_terms

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

        The port where goods on an import purchase order must be delivered by the vendor. This should only be specified when the internationalCommercialTerms is FOB.  # noqa: E501

        :return: The port_of_delivery of this ImportDetails.  # noqa: E501
        :rtype: str
        """
        return self._port_of_delivery

    @port_of_delivery.setter
    def port_of_delivery(self, port_of_delivery):
        """Sets the port_of_delivery of this ImportDetails.

        The port where goods on an import purchase order must be delivered by the vendor. This should only be specified when the internationalCommercialTerms is FOB.  # noqa: E501

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

        self._port_of_delivery = port_of_delivery

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

        Types and numbers of container(s) for import purchase orders. Can be a comma-separated list if the shipment has multiple containers. HC signifies a high-capacity container. Free-text field, limited to 64 characters. The format will be a comma-delimited list containing values of the type: $NUMBER_OF_CONTAINERS_OF_THIS_TYPE-$CONTAINER_TYPE. The list of values for the container type is: 40'(40-foot container), 40'HC (40-foot high-capacity container), 45', 45'HC, 30', 30'HC, 20', 20'HC.  # noqa: E501

        :return: The import_containers of this ImportDetails.  # noqa: E501
        :rtype: str
        """
        return self._import_containers

    @import_containers.setter
    def import_containers(self, import_containers):
        """Sets the import_containers of this ImportDetails.

        Types and numbers of container(s) for import purchase orders. Can be a comma-separated list if the shipment has multiple containers. HC signifies a high-capacity container. Free-text field, limited to 64 characters. The format will be a comma-delimited list containing values of the type: $NUMBER_OF_CONTAINERS_OF_THIS_TYPE-$CONTAINER_TYPE. The list of values for the container type is: 40'(40-foot container), 40'HC (40-foot high-capacity container), 45', 45'HC, 30', 30'HC, 20', 20'HC.  # noqa: E501

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

        self._import_containers = import_containers

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

        Special instructions regarding the shipment. This field is for import purchase orders.  # noqa: E501

        :return: The shipping_instructions of this ImportDetails.  # noqa: E501
        :rtype: str
        """
        return self._shipping_instructions

    @shipping_instructions.setter
    def shipping_instructions(self, shipping_instructions):
        """Sets the shipping_instructions of this ImportDetails.

        Special instructions regarding the shipment. This field is for import purchase orders.  # noqa: E501

        :param shipping_instructions: The shipping_instructions of this ImportDetails.  # noqa: E501
        :type: str
        """

        self._shipping_instructions = shipping_instructions

    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(ImportDetails, 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, ImportDetails):
            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, ImportDetails):
            return True

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