# coding: utf-8

"""
    Selling Partner API for Pricing

    The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer pricing information for Amazon Marketplace products.  For more information, refer to the [Product Pricing v2022-05-01 Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/product-pricing-api-v2022-05-01-use-case-guide).

    The version of the OpenAPI document: 2022-05-01
    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 FeaturedBuyingOption(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 = {
        'buying_option_type': 'str',
        'segmented_featured_offers': 'List[SegmentedFeaturedOffer]',
    }

    attribute_map = {
        'buying_option_type': 'buyingOptionType',
        'segmented_featured_offers': 'segmentedFeaturedOffers',
    }

    def __init__(self, buying_option_type=None, segmented_featured_offers=None, _configuration=None):  # noqa: E501
        """FeaturedBuyingOption - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._buying_option_type = None
        self._segmented_featured_offers = None
        self.discriminator = None

        self.buying_option_type = buying_option_type
        self.segmented_featured_offers = segmented_featured_offers

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

        The buying option type for the featured offer. `buyingOptionType` represents the buying options that a customer receives on the detail page, such as `B2B`, `Fresh`, and `Subscribe n Save`. `buyingOptionType` currently supports `NEW` as a value.  # noqa: E501

        :return: The buying_option_type of this FeaturedBuyingOption.  # noqa: E501
        :rtype: str
        """
        return self._buying_option_type

    @buying_option_type.setter
    def buying_option_type(self, buying_option_type):
        """Sets the buying_option_type of this FeaturedBuyingOption.

        The buying option type for the featured offer. `buyingOptionType` represents the buying options that a customer receives on the detail page, such as `B2B`, `Fresh`, and `Subscribe n Save`. `buyingOptionType` currently supports `NEW` as a value.  # noqa: E501

        :param buying_option_type: The buying_option_type of this FeaturedBuyingOption.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and buying_option_type is None:
            raise ValueError("Invalid value for `buying_option_type`, must not be `None`")  # noqa: E501
        allowed_values = ["New"]  # noqa: E501
        if (self._configuration.client_side_validation and
                buying_option_type not in allowed_values):
            raise ValueError(
                "Invalid value for `buying_option_type` ({0}), must be one of {1}"  # noqa: E501
                .format(buying_option_type, allowed_values)
            )

        self._buying_option_type = buying_option_type

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

        A list of segmented featured offers for the current buying option type. A segment can be considered as a group of regional contexts that all have the same featured offer. A regional context is a combination of factors such as customer type, region, or postal code and buying option.  # noqa: E501

        :return: The segmented_featured_offers of this FeaturedBuyingOption.  # noqa: E501
        :rtype: List[SegmentedFeaturedOffer]
        """
        return self._segmented_featured_offers

    @segmented_featured_offers.setter
    def segmented_featured_offers(self, segmented_featured_offers):
        """Sets the segmented_featured_offers of this FeaturedBuyingOption.

        A list of segmented featured offers for the current buying option type. A segment can be considered as a group of regional contexts that all have the same featured offer. A regional context is a combination of factors such as customer type, region, or postal code and buying option.  # noqa: E501

        :param segmented_featured_offers: The segmented_featured_offers of this FeaturedBuyingOption.  # noqa: E501
        :type: List[SegmentedFeaturedOffer]
        """
        if self._configuration.client_side_validation and segmented_featured_offers is None:
            raise ValueError("Invalid value for `segmented_featured_offers`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                segmented_featured_offers is not None and len(segmented_featured_offers) < 1):
            raise ValueError("Invalid value for `segmented_featured_offers`, number of items must be greater than or equal to `1`")  # noqa: E501

        self._segmented_featured_offers = segmented_featured_offers

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

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