# coding: utf-8

"""
    ChannelEngine Channel API

    ChannelEngine API for channels  # noqa: E501

    The version of the OpenAPI document: 2.9.10
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from channelengine_channel_api_client.configuration import Configuration


class ChannelOfferResponse(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'channel_product_no': 'str',
        'merchant_product_no': 'str',
        'price': 'float',
        'stock': 'int',
        'mapped_fields': 'dict(str, str)'
    }

    attribute_map = {
        'channel_product_no': 'ChannelProductNo',
        'merchant_product_no': 'MerchantProductNo',
        'price': 'Price',
        'stock': 'Stock',
        'mapped_fields': 'MappedFields'
    }

    def __init__(self, channel_product_no=None, merchant_product_no=None, price=None, stock=None, mapped_fields=None, local_vars_configuration=None):  # noqa: E501
        """ChannelOfferResponse - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._channel_product_no = None
        self._merchant_product_no = None
        self._price = None
        self._stock = None
        self._mapped_fields = None
        self.discriminator = None

        self.channel_product_no = channel_product_no
        self.merchant_product_no = merchant_product_no
        if price is not None:
            self.price = price
        if stock is not None:
            self.stock = stock
        self.mapped_fields = mapped_fields

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

        The unique product reference used by the Channel.  # noqa: E501

        :return: The channel_product_no of this ChannelOfferResponse.  # noqa: E501
        :rtype: str
        """
        return self._channel_product_no

    @channel_product_no.setter
    def channel_product_no(self, channel_product_no):
        """Sets the channel_product_no of this ChannelOfferResponse.

        The unique product reference used by the Channel.  # noqa: E501

        :param channel_product_no: The channel_product_no of this ChannelOfferResponse.  # noqa: E501
        :type channel_product_no: str
        """

        self._channel_product_no = channel_product_no

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


        :return: The merchant_product_no of this ChannelOfferResponse.  # noqa: E501
        :rtype: str
        """
        return self._merchant_product_no

    @merchant_product_no.setter
    def merchant_product_no(self, merchant_product_no):
        """Sets the merchant_product_no of this ChannelOfferResponse.


        :param merchant_product_no: The merchant_product_no of this ChannelOfferResponse.  # noqa: E501
        :type merchant_product_no: str
        """

        self._merchant_product_no = merchant_product_no

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


        :return: The price of this ChannelOfferResponse.  # noqa: E501
        :rtype: float
        """
        return self._price

    @price.setter
    def price(self, price):
        """Sets the price of this ChannelOfferResponse.


        :param price: The price of this ChannelOfferResponse.  # noqa: E501
        :type price: float
        """

        self._price = price

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


        :return: The stock of this ChannelOfferResponse.  # noqa: E501
        :rtype: int
        """
        return self._stock

    @stock.setter
    def stock(self, stock):
        """Sets the stock of this ChannelOfferResponse.


        :param stock: The stock of this ChannelOfferResponse.  # noqa: E501
        :type stock: int
        """

        self._stock = stock

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

        A channel can require certain fields to be available. The channel  can provide ChannelEngine with this fields after which the merchants  will be able to fill in this field using custom conditions in ChannelEngine.  # noqa: E501

        :return: The mapped_fields of this ChannelOfferResponse.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._mapped_fields

    @mapped_fields.setter
    def mapped_fields(self, mapped_fields):
        """Sets the mapped_fields of this ChannelOfferResponse.

        A channel can require certain fields to be available. The channel  can provide ChannelEngine with this fields after which the merchants  will be able to fill in this field using custom conditions in ChannelEngine.  # noqa: E501

        :param mapped_fields: The mapped_fields of this ChannelOfferResponse.  # noqa: E501
        :type mapped_fields: dict(str, str)
        """

        self._mapped_fields = mapped_fields

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

        for attr, _ in six.iteritems(self.openapi_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

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

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