# coding: utf-8

"""
Copyright 2017 Square, Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""


from pprint import pformat
from six import iteritems
import re


class OrderFulfillmentPickupDetails(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, recipient=None, expires_at=None, auto_complete_duration=None, schedule_type=None, pickup_at=None, pickup_window_duration=None, prep_time_duration=None, note=None, placed_at=None, accepted_at=None, rejected_at=None, ready_at=None, expired_at=None, picked_up_at=None, canceled_at=None, cancel_reason=None):
        """
        OrderFulfillmentPickupDetails - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'recipient': 'OrderFulfillmentRecipient',
            'expires_at': 'str',
            'auto_complete_duration': 'str',
            'schedule_type': 'str',
            'pickup_at': 'str',
            'pickup_window_duration': 'str',
            'prep_time_duration': 'str',
            'note': 'str',
            'placed_at': 'str',
            'accepted_at': 'str',
            'rejected_at': 'str',
            'ready_at': 'str',
            'expired_at': 'str',
            'picked_up_at': 'str',
            'canceled_at': 'str',
            'cancel_reason': 'str'
        }

        self.attribute_map = {
            'recipient': 'recipient',
            'expires_at': 'expires_at',
            'auto_complete_duration': 'auto_complete_duration',
            'schedule_type': 'schedule_type',
            'pickup_at': 'pickup_at',
            'pickup_window_duration': 'pickup_window_duration',
            'prep_time_duration': 'prep_time_duration',
            'note': 'note',
            'placed_at': 'placed_at',
            'accepted_at': 'accepted_at',
            'rejected_at': 'rejected_at',
            'ready_at': 'ready_at',
            'expired_at': 'expired_at',
            'picked_up_at': 'picked_up_at',
            'canceled_at': 'canceled_at',
            'cancel_reason': 'cancel_reason'
        }

        self._recipient = recipient
        self._expires_at = expires_at
        self._auto_complete_duration = auto_complete_duration
        self._schedule_type = schedule_type
        self._pickup_at = pickup_at
        self._pickup_window_duration = pickup_window_duration
        self._prep_time_duration = prep_time_duration
        self._note = note
        self._placed_at = placed_at
        self._accepted_at = accepted_at
        self._rejected_at = rejected_at
        self._ready_at = ready_at
        self._expired_at = expired_at
        self._picked_up_at = picked_up_at
        self._canceled_at = canceled_at
        self._cancel_reason = cancel_reason

    @property
    def recipient(self):
        """
        Gets the recipient of this OrderFulfillmentPickupDetails.
        The recipient of this pickup fulfillment.

        :return: The recipient of this OrderFulfillmentPickupDetails.
        :rtype: OrderFulfillmentRecipient
        """
        return self._recipient

    @recipient.setter
    def recipient(self, recipient):
        """
        Sets the recipient of this OrderFulfillmentPickupDetails.
        The recipient of this pickup fulfillment.

        :param recipient: The recipient of this OrderFulfillmentPickupDetails.
        :type: OrderFulfillmentRecipient
        """

        self._recipient = recipient

    @property
    def expires_at(self):
        """
        Gets the expires_at of this OrderFulfillmentPickupDetails.
        The expiry [timestamp](#workingwithdates) in RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\". This timestamp indicates when the pickup fulfillment will expire if it is not accepted by the merchant. Expiration time can only be set up to 7 days in the future. If not set, this pickup fulfillment will be automatically accepted when placed.

        :return: The expires_at of this OrderFulfillmentPickupDetails.
        :rtype: str
        """
        return self._expires_at

    @expires_at.setter
    def expires_at(self, expires_at):
        """
        Sets the expires_at of this OrderFulfillmentPickupDetails.
        The expiry [timestamp](#workingwithdates) in RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\". This timestamp indicates when the pickup fulfillment will expire if it is not accepted by the merchant. Expiration time can only be set up to 7 days in the future. If not set, this pickup fulfillment will be automatically accepted when placed.

        :param expires_at: The expires_at of this OrderFulfillmentPickupDetails.
        :type: str
        """

        self._expires_at = expires_at

    @property
    def auto_complete_duration(self):
        """
        Gets the auto_complete_duration of this OrderFulfillmentPickupDetails.
        The auto completion duration in RFC3339 duration format, e.g., \"P1W3D\". If set, an open and accepted pickup fulfillment will automatically move to the `COMPLETED` state after this period of time. If not set, this pickup fulfillment will remain accepted until it is canceled or completed.

        :return: The auto_complete_duration of this OrderFulfillmentPickupDetails.
        :rtype: str
        """
        return self._auto_complete_duration

    @auto_complete_duration.setter
    def auto_complete_duration(self, auto_complete_duration):
        """
        Sets the auto_complete_duration of this OrderFulfillmentPickupDetails.
        The auto completion duration in RFC3339 duration format, e.g., \"P1W3D\". If set, an open and accepted pickup fulfillment will automatically move to the `COMPLETED` state after this period of time. If not set, this pickup fulfillment will remain accepted until it is canceled or completed.

        :param auto_complete_duration: The auto_complete_duration of this OrderFulfillmentPickupDetails.
        :type: str
        """

        self._auto_complete_duration = auto_complete_duration

    @property
    def schedule_type(self):
        """
        Gets the schedule_type of this OrderFulfillmentPickupDetails.
        The schedule type of the pickup fulfillment. Defaults to `SCHEDULED`. See [OrderFulfillmentPickupDetailsScheduleType](#type-orderfulfillmentpickupdetailsscheduletype) for possible values

        :return: The schedule_type of this OrderFulfillmentPickupDetails.
        :rtype: str
        """
        return self._schedule_type

    @schedule_type.setter
    def schedule_type(self, schedule_type):
        """
        Sets the schedule_type of this OrderFulfillmentPickupDetails.
        The schedule type of the pickup fulfillment. Defaults to `SCHEDULED`. See [OrderFulfillmentPickupDetailsScheduleType](#type-orderfulfillmentpickupdetailsscheduletype) for possible values

        :param schedule_type: The schedule_type of this OrderFulfillmentPickupDetails.
        :type: str
        """

        self._schedule_type = schedule_type

    @property
    def pickup_at(self):
        """
        Gets the pickup_at of this OrderFulfillmentPickupDetails.
        The pickup [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\". For fulfillments with the schedule type `ASAP`, this is automatically set to the current time plus the expected duration to prepare the fulfillment. This represents the start of the pickup window.

        :return: The pickup_at of this OrderFulfillmentPickupDetails.
        :rtype: str
        """
        return self._pickup_at

    @pickup_at.setter
    def pickup_at(self, pickup_at):
        """
        Sets the pickup_at of this OrderFulfillmentPickupDetails.
        The pickup [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\". For fulfillments with the schedule type `ASAP`, this is automatically set to the current time plus the expected duration to prepare the fulfillment. This represents the start of the pickup window.

        :param pickup_at: The pickup_at of this OrderFulfillmentPickupDetails.
        :type: str
        """

        self._pickup_at = pickup_at

    @property
    def pickup_window_duration(self):
        """
        Gets the pickup_window_duration of this OrderFulfillmentPickupDetails.
        The pickup window duration in RFC3339 duration format, e.g., \"P1W3D\". This duration represents the window of time for which the order should be picked up after the `pickup_at` time. Can be used as an informational guideline for merchants.

        :return: The pickup_window_duration of this OrderFulfillmentPickupDetails.
        :rtype: str
        """
        return self._pickup_window_duration

    @pickup_window_duration.setter
    def pickup_window_duration(self, pickup_window_duration):
        """
        Sets the pickup_window_duration of this OrderFulfillmentPickupDetails.
        The pickup window duration in RFC3339 duration format, e.g., \"P1W3D\". This duration represents the window of time for which the order should be picked up after the `pickup_at` time. Can be used as an informational guideline for merchants.

        :param pickup_window_duration: The pickup_window_duration of this OrderFulfillmentPickupDetails.
        :type: str
        """

        self._pickup_window_duration = pickup_window_duration

    @property
    def prep_time_duration(self):
        """
        Gets the prep_time_duration of this OrderFulfillmentPickupDetails.
        The preparation time duration in RFC3339 duration format, e.g., \"P1W3D\". This duration indicates how long it takes the merchant to prepare this fulfillment.

        :return: The prep_time_duration of this OrderFulfillmentPickupDetails.
        :rtype: str
        """
        return self._prep_time_duration

    @prep_time_duration.setter
    def prep_time_duration(self, prep_time_duration):
        """
        Sets the prep_time_duration of this OrderFulfillmentPickupDetails.
        The preparation time duration in RFC3339 duration format, e.g., \"P1W3D\". This duration indicates how long it takes the merchant to prepare this fulfillment.

        :param prep_time_duration: The prep_time_duration of this OrderFulfillmentPickupDetails.
        :type: str
        """

        self._prep_time_duration = prep_time_duration

    @property
    def note(self):
        """
        Gets the note of this OrderFulfillmentPickupDetails.
        A general note about the pickup fulfillment.  Notes are useful for providing additional instructions and are displayed in Square apps.

        :return: The note of this OrderFulfillmentPickupDetails.
        :rtype: str
        """
        return self._note

    @note.setter
    def note(self, note):
        """
        Sets the note of this OrderFulfillmentPickupDetails.
        A general note about the pickup fulfillment.  Notes are useful for providing additional instructions and are displayed in Square apps.

        :param note: The note of this OrderFulfillmentPickupDetails.
        :type: str
        """

        if note is None:
            raise ValueError("Invalid value for `note`, must not be `None`")
        if len(note) > 500:
            raise ValueError("Invalid value for `note`, length must be less than `500`")

        self._note = note

    @property
    def placed_at(self):
        """
        Gets the placed_at of this OrderFulfillmentPickupDetails.
        The [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\", indicating when the fulfillment was placed.

        :return: The placed_at of this OrderFulfillmentPickupDetails.
        :rtype: str
        """
        return self._placed_at

    @placed_at.setter
    def placed_at(self, placed_at):
        """
        Sets the placed_at of this OrderFulfillmentPickupDetails.
        The [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\", indicating when the fulfillment was placed.

        :param placed_at: The placed_at of this OrderFulfillmentPickupDetails.
        :type: str
        """

        self._placed_at = placed_at

    @property
    def accepted_at(self):
        """
        Gets the accepted_at of this OrderFulfillmentPickupDetails.
        The [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\", indicating when the fulfillment was accepted by the merchant.

        :return: The accepted_at of this OrderFulfillmentPickupDetails.
        :rtype: str
        """
        return self._accepted_at

    @accepted_at.setter
    def accepted_at(self, accepted_at):
        """
        Sets the accepted_at of this OrderFulfillmentPickupDetails.
        The [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\", indicating when the fulfillment was accepted by the merchant.

        :param accepted_at: The accepted_at of this OrderFulfillmentPickupDetails.
        :type: str
        """

        self._accepted_at = accepted_at

    @property
    def rejected_at(self):
        """
        Gets the rejected_at of this OrderFulfillmentPickupDetails.
        The [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\", indicating when the fulfillment was rejected.

        :return: The rejected_at of this OrderFulfillmentPickupDetails.
        :rtype: str
        """
        return self._rejected_at

    @rejected_at.setter
    def rejected_at(self, rejected_at):
        """
        Sets the rejected_at of this OrderFulfillmentPickupDetails.
        The [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\", indicating when the fulfillment was rejected.

        :param rejected_at: The rejected_at of this OrderFulfillmentPickupDetails.
        :type: str
        """

        self._rejected_at = rejected_at

    @property
    def ready_at(self):
        """
        Gets the ready_at of this OrderFulfillmentPickupDetails.
        The [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\", indicating when the merchant set the fulfillment as ready for pickup.

        :return: The ready_at of this OrderFulfillmentPickupDetails.
        :rtype: str
        """
        return self._ready_at

    @ready_at.setter
    def ready_at(self, ready_at):
        """
        Sets the ready_at of this OrderFulfillmentPickupDetails.
        The [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\", indicating when the merchant set the fulfillment as ready for pickup.

        :param ready_at: The ready_at of this OrderFulfillmentPickupDetails.
        :type: str
        """

        self._ready_at = ready_at

    @property
    def expired_at(self):
        """
        Gets the expired_at of this OrderFulfillmentPickupDetails.
        The [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\", indicating when the fulfillment expired.

        :return: The expired_at of this OrderFulfillmentPickupDetails.
        :rtype: str
        """
        return self._expired_at

    @expired_at.setter
    def expired_at(self, expired_at):
        """
        Sets the expired_at of this OrderFulfillmentPickupDetails.
        The [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\", indicating when the fulfillment expired.

        :param expired_at: The expired_at of this OrderFulfillmentPickupDetails.
        :type: str
        """

        self._expired_at = expired_at

    @property
    def picked_up_at(self):
        """
        Gets the picked_up_at of this OrderFulfillmentPickupDetails.
        The [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\", indicating when the fulfillment was picked up by the recipient.

        :return: The picked_up_at of this OrderFulfillmentPickupDetails.
        :rtype: str
        """
        return self._picked_up_at

    @picked_up_at.setter
    def picked_up_at(self, picked_up_at):
        """
        Sets the picked_up_at of this OrderFulfillmentPickupDetails.
        The [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\", indicating when the fulfillment was picked up by the recipient.

        :param picked_up_at: The picked_up_at of this OrderFulfillmentPickupDetails.
        :type: str
        """

        self._picked_up_at = picked_up_at

    @property
    def canceled_at(self):
        """
        Gets the canceled_at of this OrderFulfillmentPickupDetails.
        The [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\", indicating when the fulfillment was canceled by the merchant or buyer.

        :return: The canceled_at of this OrderFulfillmentPickupDetails.
        :rtype: str
        """
        return self._canceled_at

    @canceled_at.setter
    def canceled_at(self, canceled_at):
        """
        Sets the canceled_at of this OrderFulfillmentPickupDetails.
        The [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\", indicating when the fulfillment was canceled by the merchant or buyer.

        :param canceled_at: The canceled_at of this OrderFulfillmentPickupDetails.
        :type: str
        """

        self._canceled_at = canceled_at

    @property
    def cancel_reason(self):
        """
        Gets the cancel_reason of this OrderFulfillmentPickupDetails.
        A description of why the pickup was canceled. Max length is 100 characters.

        :return: The cancel_reason of this OrderFulfillmentPickupDetails.
        :rtype: str
        """
        return self._cancel_reason

    @cancel_reason.setter
    def cancel_reason(self, cancel_reason):
        """
        Sets the cancel_reason of this OrderFulfillmentPickupDetails.
        A description of why the pickup was canceled. Max length is 100 characters.

        :param cancel_reason: The cancel_reason of this OrderFulfillmentPickupDetails.
        :type: str
        """

        if cancel_reason is None:
            raise ValueError("Invalid value for `cancel_reason`, must not be `None`")
        if len(cancel_reason) > 100:
            raise ValueError("Invalid value for `cancel_reason`, length must be less than `100`")

        self._cancel_reason = cancel_reason

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

        for attr, _ in 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

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return 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
        """
        return self.__dict__ == other.__dict__

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