# coding: utf-8

"""
    The Selling Partner API for FBA inbound operations.

    The Selling Partner API for Fulfillment By Amazon (FBA) Inbound. The FBA Inbound API enables building inbound workflows to create, manage, and send shipments into Amazon's fulfillment network. The API has interoperability with the Send-to-Amazon user interface.

    The version of the OpenAPI document: 2024-03-20
    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 DeliveryWindowOption(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 = {
        'availability_type': 'str',
        'delivery_window_option_id': 'str',
        'end_date': 'datetime',
        'start_date': 'datetime',
        'valid_until': 'datetime',
    }

    attribute_map = {
        'availability_type': 'availabilityType',
        'delivery_window_option_id': 'deliveryWindowOptionId',
        'end_date': 'endDate',
        'start_date': 'startDate',
        'valid_until': 'validUntil',
    }

    def __init__(self, availability_type=None, delivery_window_option_id=None, end_date=None, start_date=None, valid_until=None, _configuration=None):  # noqa: E501
        """DeliveryWindowOption - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._availability_type = None
        self._delivery_window_option_id = None
        self._end_date = None
        self._start_date = None
        self._valid_until = None
        self.discriminator = None

        self.availability_type = availability_type
        self.delivery_window_option_id = delivery_window_option_id
        self.end_date = end_date
        self.start_date = start_date
        self.valid_until = valid_until

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

        Identifies type of Delivery Window Availability. Values: `AVAILABLE`, `CONGESTED`  # noqa: E501

        :return: The availability_type of this DeliveryWindowOption.  # noqa: E501
        :rtype: str
        """
        return self._availability_type

    @availability_type.setter
    def availability_type(self, availability_type):
        """Sets the availability_type of this DeliveryWindowOption.

        Identifies type of Delivery Window Availability. Values: `AVAILABLE`, `CONGESTED`  # noqa: E501

        :param availability_type: The availability_type of this DeliveryWindowOption.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and availability_type is None:
            raise ValueError("Invalid value for `availability_type`, must not be `None`")  # noqa: E501

        self._availability_type = availability_type

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

        Identifier of a delivery window option. A delivery window option represent one option for when a shipment is expected to be delivered.  # noqa: E501

        :return: The delivery_window_option_id of this DeliveryWindowOption.  # noqa: E501
        :rtype: str
        """
        return self._delivery_window_option_id

    @delivery_window_option_id.setter
    def delivery_window_option_id(self, delivery_window_option_id):
        """Sets the delivery_window_option_id of this DeliveryWindowOption.

        Identifier of a delivery window option. A delivery window option represent one option for when a shipment is expected to be delivered.  # noqa: E501

        :param delivery_window_option_id: The delivery_window_option_id of this DeliveryWindowOption.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and delivery_window_option_id is None:
            raise ValueError("Invalid value for `delivery_window_option_id`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                delivery_window_option_id is not None and len(delivery_window_option_id) > 38):
            raise ValueError("Invalid value for `delivery_window_option_id`, length must be less than or equal to `38`")  # noqa: E501
        if (self._configuration.client_side_validation and
                delivery_window_option_id is not None and len(delivery_window_option_id) < 36):
            raise ValueError("Invalid value for `delivery_window_option_id`, length must be greater than or equal to `36`")  # noqa: E501
        if (self._configuration.client_side_validation and
                delivery_window_option_id is not None and not re.search(r'^[a-zA-Z0-9-]*$', delivery_window_option_id)):  # noqa: E501
            raise ValueError(r"Invalid value for `delivery_window_option_id`, must be a follow pattern or equal to `/^[a-zA-Z0-9-]*$/`")  # noqa: E501

        self._delivery_window_option_id = delivery_window_option_id

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

        The time at which this delivery window option ends. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) datetime format with pattern `yyyy-MM-ddTHH:mmZ`.  # noqa: E501

        :return: The end_date of this DeliveryWindowOption.  # noqa: E501
        :rtype: datetime
        """
        return self._end_date

    @end_date.setter
    def end_date(self, end_date):
        """Sets the end_date of this DeliveryWindowOption.

        The time at which this delivery window option ends. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) datetime format with pattern `yyyy-MM-ddTHH:mmZ`.  # noqa: E501

        :param end_date: The end_date of this DeliveryWindowOption.  # noqa: E501
        :type: datetime
        """
        if self._configuration.client_side_validation and end_date is None:
            raise ValueError("Invalid value for `end_date`, must not be `None`")  # noqa: E501

        self._end_date = end_date

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

        The time at which this delivery window option starts. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) datetime format with pattern `yyyy-MM-ddTHH:mmZ`.  # noqa: E501

        :return: The start_date of this DeliveryWindowOption.  # noqa: E501
        :rtype: datetime
        """
        return self._start_date

    @start_date.setter
    def start_date(self, start_date):
        """Sets the start_date of this DeliveryWindowOption.

        The time at which this delivery window option starts. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) datetime format with pattern `yyyy-MM-ddTHH:mmZ`.  # noqa: E501

        :param start_date: The start_date of this DeliveryWindowOption.  # noqa: E501
        :type: datetime
        """
        if self._configuration.client_side_validation and start_date is None:
            raise ValueError("Invalid value for `start_date`, must not be `None`")  # noqa: E501

        self._start_date = start_date

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

        The time at which this window delivery option is no longer valid. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) datetime format with pattern `yyyy-MM-ddTHH:mmZ`.  # noqa: E501

        :return: The valid_until of this DeliveryWindowOption.  # noqa: E501
        :rtype: datetime
        """
        return self._valid_until

    @valid_until.setter
    def valid_until(self, valid_until):
        """Sets the valid_until of this DeliveryWindowOption.

        The time at which this window delivery option is no longer valid. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) datetime format with pattern `yyyy-MM-ddTHH:mmZ`.  # noqa: E501

        :param valid_until: The valid_until of this DeliveryWindowOption.  # noqa: E501
        :type: datetime
        """
        if self._configuration.client_side_validation and valid_until is None:
            raise ValueError("Invalid value for `valid_until`, must not be `None`")  # noqa: E501

        self._valid_until = valid_until

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

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