# coding: utf-8

"""
    Rate Table API

    This API allows sellers to retrieve and manage their custom shipping rate tables. In addition, this API also provides sellers in mainland China methods to configure split-payouts between two separate payment instruments.  # noqa: E501

    OpenAPI spec version: 2.1.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six

class RateTableDetails(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 = {
        'marketplace_id': 'str',
        'name': 'str',
        'rates': 'list[Rate]',
        'rate_table_basis': 'str',
        'rate_table_id': 'str',
        'shipping_option_type': 'str'
    }

    attribute_map = {
        'marketplace_id': 'marketplaceId',
        'name': 'name',
        'rates': 'rates',
        'rate_table_basis': 'rateTableBasis',
        'rate_table_id': 'rateTableId',
        'shipping_option_type': 'shippingOptionType'
    }

    def __init__(self, marketplace_id=None, name=None, rates=None, rate_table_basis=None, rate_table_id=None, shipping_option_type=None):  # noqa: E501
        """RateTableDetails - a model defined in Swagger"""  # noqa: E501
        self._marketplace_id = None
        self._name = None
        self._rates = None
        self._rate_table_basis = None
        self._rate_table_id = None
        self._shipping_option_type = None
        self.discriminator = None
        if marketplace_id is not None:
            self.marketplace_id = marketplace_id
        if name is not None:
            self.name = name
        if rates is not None:
            self.rates = rates
        if rate_table_basis is not None:
            self.rate_table_basis = rate_table_basis
        if rate_table_id is not None:
            self.rate_table_id = rate_table_id
        if shipping_option_type is not None:
            self.shipping_option_type = shipping_option_type

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

        Identifies the eBay marketplace to which the shipping rate table applies. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/sell/account/types/ba:MarketplaceIdEnum'>eBay API documentation</a>  # noqa: E501

        :return: The marketplace_id of this RateTableDetails.  # noqa: E501
        :rtype: str
        """
        return self._marketplace_id

    @marketplace_id.setter
    def marketplace_id(self, marketplace_id):
        """Sets the marketplace_id of this RateTableDetails.

        Identifies the eBay marketplace to which the shipping rate table applies. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/sell/account/types/ba:MarketplaceIdEnum'>eBay API documentation</a>  # noqa: E501

        :param marketplace_id: The marketplace_id of this RateTableDetails.  # noqa: E501
        :type: str
        """

        self._marketplace_id = marketplace_id

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

        The seller-defined name for the shipping rate table. Names must be unique for each table assigned to the same seller, shippingOptionType, and eBay marketplace.<br/><br/><b>Max length:</b> 50  # noqa: E501

        :return: The name of this RateTableDetails.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this RateTableDetails.

        The seller-defined name for the shipping rate table. Names must be unique for each table assigned to the same seller, shippingOptionType, and eBay marketplace.<br/><br/><b>Max length:</b> 50  # noqa: E501

        :param name: The name of this RateTableDetails.  # noqa: E501
        :type: str
        """

        self._name = name

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

        An array of rate objects associated with the specified shipping rate table. Each rate object is identified by a unique system-generated ID and defines specific shipping rate information.  # noqa: E501

        :return: The rates of this RateTableDetails.  # noqa: E501
        :rtype: list[Rate]
        """
        return self._rates

    @rates.setter
    def rates(self, rates):
        """Sets the rates of this RateTableDetails.

        An array of rate objects associated with the specified shipping rate table. Each rate object is identified by a unique system-generated ID and defines specific shipping rate information.  # noqa: E501

        :param rates: The rates of this RateTableDetails.  # noqa: E501
        :type: list[Rate]
        """

        self._rates = rates

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

        The rate calculation type provides three methods of calculating the shipping cost based on the seller's selection/input:<ul><li><b>ITEM</b>: Specifies the flat rate shipping cost that buyers in the specified shipping region will pay. When this option is selected, information specified in the rate table overrides all shipping options/costs that are specified at the listing level. Buyers in the specified regions will only see the services provided in the rate table. Buyers in other regions that are not specified in the rate table will see the shipping services associated with the listing.</li><li><b>WEIGHT</b>: Seller can provide minimum shipping cost and an additional shipping cost per pound. The additional cost will be calculated based on the weight the seller provide at the time of listing. Buyers will see the total shipping cost and won’t see these calculations.  Buyers in the specified regions will only see the services provided in the rate table. Buyers in other regions that were not specified in the rate table, will see the shipping services associated with the listing.</li><li><b>SURCHARGE</b>: Lists surcharges for buyers within specified regions, or indicates a flat amount added to the shipping cost specified within an item's listing. Buyers will see only the total shipping cost as well as shipping services associated with the item's listing. If a SURCHARGE is specified in the rate table for certain regions, buyers in those regions will see the (shipping cost + SURCHARGE) total.</li></ul> For implementation help, refer to <a href='https://developer.ebay.com/api-docs/sell/account/types/api:ShippingRateCalculationEnum'>eBay API documentation</a>  # noqa: E501

        :return: The rate_table_basis of this RateTableDetails.  # noqa: E501
        :rtype: str
        """
        return self._rate_table_basis

    @rate_table_basis.setter
    def rate_table_basis(self, rate_table_basis):
        """Sets the rate_table_basis of this RateTableDetails.

        The rate calculation type provides three methods of calculating the shipping cost based on the seller's selection/input:<ul><li><b>ITEM</b>: Specifies the flat rate shipping cost that buyers in the specified shipping region will pay. When this option is selected, information specified in the rate table overrides all shipping options/costs that are specified at the listing level. Buyers in the specified regions will only see the services provided in the rate table. Buyers in other regions that are not specified in the rate table will see the shipping services associated with the listing.</li><li><b>WEIGHT</b>: Seller can provide minimum shipping cost and an additional shipping cost per pound. The additional cost will be calculated based on the weight the seller provide at the time of listing. Buyers will see the total shipping cost and won’t see these calculations.  Buyers in the specified regions will only see the services provided in the rate table. Buyers in other regions that were not specified in the rate table, will see the shipping services associated with the listing.</li><li><b>SURCHARGE</b>: Lists surcharges for buyers within specified regions, or indicates a flat amount added to the shipping cost specified within an item's listing. Buyers will see only the total shipping cost as well as shipping services associated with the item's listing. If a SURCHARGE is specified in the rate table for certain regions, buyers in those regions will see the (shipping cost + SURCHARGE) total.</li></ul> For implementation help, refer to <a href='https://developer.ebay.com/api-docs/sell/account/types/api:ShippingRateCalculationEnum'>eBay API documentation</a>  # noqa: E501

        :param rate_table_basis: The rate_table_basis of this RateTableDetails.  # noqa: E501
        :type: str
        """

        self._rate_table_basis = rate_table_basis

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

        A unique, system-generated ID assigned to the shipping rate table when it is initially created.  # noqa: E501

        :return: The rate_table_id of this RateTableDetails.  # noqa: E501
        :rtype: str
        """
        return self._rate_table_id

    @rate_table_id.setter
    def rate_table_id(self, rate_table_id):
        """Sets the rate_table_id of this RateTableDetails.

        A unique, system-generated ID assigned to the shipping rate table when it is initially created.  # noqa: E501

        :param rate_table_id: The rate_table_id of this RateTableDetails.  # noqa: E501
        :type: str
        """

        self._rate_table_id = rate_table_id

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

        The region serviced by the shipping rate table. Valid values are:<ul><li><b>DOMESTIC</b>: Indicates that the shipping rate table applies to shipping destinations within the country in which an item has been listed (i.e., the <i>source</i> country).</li><li><b>INTERNATIONAL</b>: Indicates that the shipping rate table applies to shipping destinations outside of the country in which an item has been listed.</li></ul> For implementation help, refer to <a href='https://developer.ebay.com/api-docs/sell/account/types/api:ShippingOptionTypeEnum'>eBay API documentation</a>  # noqa: E501

        :return: The shipping_option_type of this RateTableDetails.  # noqa: E501
        :rtype: str
        """
        return self._shipping_option_type

    @shipping_option_type.setter
    def shipping_option_type(self, shipping_option_type):
        """Sets the shipping_option_type of this RateTableDetails.

        The region serviced by the shipping rate table. Valid values are:<ul><li><b>DOMESTIC</b>: Indicates that the shipping rate table applies to shipping destinations within the country in which an item has been listed (i.e., the <i>source</i> country).</li><li><b>INTERNATIONAL</b>: Indicates that the shipping rate table applies to shipping destinations outside of the country in which an item has been listed.</li></ul> For implementation help, refer to <a href='https://developer.ebay.com/api-docs/sell/account/types/api:ShippingOptionTypeEnum'>eBay API documentation</a>  # noqa: E501

        :param shipping_option_type: The shipping_option_type of this RateTableDetails.  # noqa: E501
        :type: str
        """

        self._shipping_option_type = shipping_option_type

    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(RateTableDetails, 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, RateTableDetails):
            return False

        return self.__dict__ == other.__dict__

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