# coding: utf-8

"""
    Selling Partner API for Retail Procurement Shipments

    The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.

    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 Expiry(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 = {
        'manufacturer_date': 'datetime',
        'expiry_date': 'datetime',
        'expiry_after_duration': 'Duration',
    }

    attribute_map = {
        'manufacturer_date': 'manufacturerDate',
        'expiry_date': 'expiryDate',
        'expiry_after_duration': 'expiryAfterDuration',
    }

    def __init__(self, manufacturer_date=None, expiry_date=None, expiry_after_duration=None, _configuration=None):  # noqa: E501
        """Expiry - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._manufacturer_date = None
        self._expiry_date = None
        self._expiry_after_duration = None
        self.discriminator = None

        if manufacturer_date is not None:
            self.manufacturer_date = manufacturer_date
        if expiry_date is not None:
            self.expiry_date = expiry_date
        if expiry_after_duration is not None:
            self.expiry_after_duration = expiry_after_duration

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

        Production, packaging or assembly date determined by the manufacturer. Its meaning is determined based on the trade item context.  # noqa: E501

        :return: The manufacturer_date of this Expiry.  # noqa: E501
        :rtype: datetime
        """
        return self._manufacturer_date

    @manufacturer_date.setter
    def manufacturer_date(self, manufacturer_date):
        """Sets the manufacturer_date of this Expiry.

        Production, packaging or assembly date determined by the manufacturer. Its meaning is determined based on the trade item context.  # noqa: E501

        :param manufacturer_date: The manufacturer_date of this Expiry.  # noqa: E501
        :type: datetime
        """

        self._manufacturer_date = manufacturer_date

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

        The date that determines the limit of consumption or use of a product. Its meaning is determined based on the trade item context.  # noqa: E501

        :return: The expiry_date of this Expiry.  # noqa: E501
        :rtype: datetime
        """
        return self._expiry_date

    @expiry_date.setter
    def expiry_date(self, expiry_date):
        """Sets the expiry_date of this Expiry.

        The date that determines the limit of consumption or use of a product. Its meaning is determined based on the trade item context.  # noqa: E501

        :param expiry_date: The expiry_date of this Expiry.  # noqa: E501
        :type: datetime
        """

        self._expiry_date = expiry_date

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


        :return: The expiry_after_duration of this Expiry.  # noqa: E501
        :rtype: Duration
        """
        return self._expiry_after_duration

    @expiry_after_duration.setter
    def expiry_after_duration(self, expiry_after_duration):
        """Sets the expiry_after_duration of this Expiry.


        :param expiry_after_duration: The expiry_after_duration of this Expiry.  # noqa: E501
        :type: Duration
        """

        self._expiry_after_duration = expiry_after_duration

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

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