# coding: utf-8

"""
    Account API

    The <b>Account API</b> gives sellers the ability to configure their eBay seller accounts, including the seller's policies (seller-defined custom policies and eBay business policies), opt in and out of eBay seller programs, configure sales tax tables, and get account information.  <br><br>For details on the availability of the methods in this API, see <a href=\"/api-docs/sell/account/overview.html#requirements\">Account API requirements and restrictions</a>.  # noqa: E501

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

import pprint
import re  # noqa: F401

import six

class RegionSet(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 = {
        'region_excluded': 'list[Region]',
        'region_included': 'list[Region]'
    }

    attribute_map = {
        'region_excluded': 'regionExcluded',
        'region_included': 'regionIncluded'
    }

    def __init__(self, region_excluded=None, region_included=None):  # noqa: E501
        """RegionSet - a model defined in Swagger"""  # noqa: E501
        self._region_excluded = None
        self._region_included = None
        self.discriminator = None
        if region_excluded is not None:
            self.region_excluded = region_excluded
        if region_included is not None:
            self.region_included = region_included

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

        A list of one or more <b>regionsName</b> fields that specify the areas to where a seller does not ship. Populate <b>regionExcluded</b> in only the top-level <b>shipToLocations</b> container (do not populate this field within the <b>shippingOptions</b> container). <p>Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options and they don't have a need to exclude any regions from their ship-to locations. With this, there's no reason to set <b>regionExclude</b> fields. However, it makes sense to set the <b>regionExcluded</b> field when a seller wants to exclude a small area that's located within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region, from the larger world area they ship to. <br><br>To retrieve the regions you can specify in the associated <b>regionName</b> field, call <b>GeteBayDetails</b> with <b>DetailName</b> set to <code>ExcludeShippingLocationDetails</code>, then review the <b>Location</b> fields in the response for the strings that you can specify <b>regionExcluded.regionName</b>.  <br><br>Note that if a buyer's primary ship-to location is a region that a seller has excluded in their fulfillment policy (or if the buyer does not have a primary ship-to location), they will receive an error message if they attempt to buy or place a bid on an item that uses that fulfillment policy. <br><br>For details on setting this field, see <a href=\"/api-docs/sell/static/seller-accounts/ht_shipping-exclude-regions.html\">Excluding specific regions from included shipping areas</a>.  # noqa: E501

        :return: The region_excluded of this RegionSet.  # noqa: E501
        :rtype: list[Region]
        """
        return self._region_excluded

    @region_excluded.setter
    def region_excluded(self, region_excluded):
        """Sets the region_excluded of this RegionSet.

        A list of one or more <b>regionsName</b> fields that specify the areas to where a seller does not ship. Populate <b>regionExcluded</b> in only the top-level <b>shipToLocations</b> container (do not populate this field within the <b>shippingOptions</b> container). <p>Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options and they don't have a need to exclude any regions from their ship-to locations. With this, there's no reason to set <b>regionExclude</b> fields. However, it makes sense to set the <b>regionExcluded</b> field when a seller wants to exclude a small area that's located within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region, from the larger world area they ship to. <br><br>To retrieve the regions you can specify in the associated <b>regionName</b> field, call <b>GeteBayDetails</b> with <b>DetailName</b> set to <code>ExcludeShippingLocationDetails</code>, then review the <b>Location</b> fields in the response for the strings that you can specify <b>regionExcluded.regionName</b>.  <br><br>Note that if a buyer's primary ship-to location is a region that a seller has excluded in their fulfillment policy (or if the buyer does not have a primary ship-to location), they will receive an error message if they attempt to buy or place a bid on an item that uses that fulfillment policy. <br><br>For details on setting this field, see <a href=\"/api-docs/sell/static/seller-accounts/ht_shipping-exclude-regions.html\">Excluding specific regions from included shipping areas</a>.  # noqa: E501

        :param region_excluded: The region_excluded of this RegionSet.  # noqa: E501
        :type: list[Region]
        """

        self._region_excluded = region_excluded

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

        A list of one or more <b>regionsName</b> fields that specify the areas to where a seller ships. <br><br><b>Important:</b> Populate this field only when the parent <b>shipToLocations</b> object is located within a <b>shippingOptions</b> container (that is, the parent <b>shipTolocations</b> object must not be the one at the top-level of the policy). Also, this field needs to be populated only when the associated <b>shippingOptions</b> container has <b>optionType</b> set to <code>INTERNATIONAL</code>. <br><br>Withing an international shipping option, set this value to <code>Worldwide</code> to indicate the seller ships to all world regions. If needed, use the <b>regionExcluded</b> field to exclude any regions in the world to where the seller does not ship. <br><br>Each eBay marketplace supports its own set of allowable shipping locations. Obtain the valid 'Ship-To Locations' for a marketplace by calling <b>GeteBayDetails</b> with <b>DetailName</b> set to <code>ShippingLocationDetails</code>, then review the <b>ShippingLocation</b> fields in the response for the strings that you can specify in the <b>regionIncluded.regionName</b> field. <br><br>For DOMESTIC shipping options, eBay automatically uses the seller's listing country as the default <b>regionIncluded</b> country. For details on setting this field, see <a href=\"/api-docs/sell/static/seller-accounts/ht_shipping-worldwide.html\">How to set up worldwide shipping</a>.  <br><br>This field is always returned in the shipping policy response.  <br><br><i>Required if</i> <b>optionType</b> set to <code>INTERNATIONAL</code>.  # noqa: E501

        :return: The region_included of this RegionSet.  # noqa: E501
        :rtype: list[Region]
        """
        return self._region_included

    @region_included.setter
    def region_included(self, region_included):
        """Sets the region_included of this RegionSet.

        A list of one or more <b>regionsName</b> fields that specify the areas to where a seller ships. <br><br><b>Important:</b> Populate this field only when the parent <b>shipToLocations</b> object is located within a <b>shippingOptions</b> container (that is, the parent <b>shipTolocations</b> object must not be the one at the top-level of the policy). Also, this field needs to be populated only when the associated <b>shippingOptions</b> container has <b>optionType</b> set to <code>INTERNATIONAL</code>. <br><br>Withing an international shipping option, set this value to <code>Worldwide</code> to indicate the seller ships to all world regions. If needed, use the <b>regionExcluded</b> field to exclude any regions in the world to where the seller does not ship. <br><br>Each eBay marketplace supports its own set of allowable shipping locations. Obtain the valid 'Ship-To Locations' for a marketplace by calling <b>GeteBayDetails</b> with <b>DetailName</b> set to <code>ShippingLocationDetails</code>, then review the <b>ShippingLocation</b> fields in the response for the strings that you can specify in the <b>regionIncluded.regionName</b> field. <br><br>For DOMESTIC shipping options, eBay automatically uses the seller's listing country as the default <b>regionIncluded</b> country. For details on setting this field, see <a href=\"/api-docs/sell/static/seller-accounts/ht_shipping-worldwide.html\">How to set up worldwide shipping</a>.  <br><br>This field is always returned in the shipping policy response.  <br><br><i>Required if</i> <b>optionType</b> set to <code>INTERNATIONAL</code>.  # noqa: E501

        :param region_included: The region_included of this RegionSet.  # noqa: E501
        :type: list[Region]
        """

        self._region_included = region_included

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

        return self.__dict__ == other.__dict__

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