# coding: utf-8

"""
    Cyclos 4.11.5 API

    The REST API for Cyclos 4.11.5  # noqa: E501

    OpenAPI spec version: 4.11.5
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from swagger_client.configuration import Configuration


class TicketNew(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 = {
        'payer': 'str',
        'cancel_url': 'str',
        'success_url': 'str',
        'success_webhook': 'str',
        'order_id': 'str',
        'expires_after': 'TimeInterval'
    }

    attribute_map = {
        'payer': 'payer',
        'cancel_url': 'cancelUrl',
        'success_url': 'successUrl',
        'success_webhook': 'successWebhook',
        'order_id': 'orderId',
        'expires_after': 'expiresAfter'
    }

    def __init__(self, payer=None, cancel_url=None, success_url=None, success_webhook=None, order_id=None, expires_after=None, _configuration=None):  # noqa: E501
        """TicketNew - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._payer = None
        self._cancel_url = None
        self._success_url = None
        self._success_webhook = None
        self._order_id = None
        self._expires_after = None
        self.discriminator = None

        if payer is not None:
            self.payer = payer
        if cancel_url is not None:
            self.cancel_url = cancel_url
        if success_url is not None:
            self.success_url = success_url
        if success_webhook is not None:
            self.success_webhook = success_webhook
        if order_id is not None:
            self.order_id = order_id
        if expires_after is not None:
            self.expires_after = expires_after

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

        An identification for the user which will pay the ticket. Is optional, and in most cases, should be left empty. If empty, at the moment the client will pay the ticket, both user identification and password will be entered, and the ticket will be confirmed. If specified, when confirming, only that user will be able to pay the ticket.    # noqa: E501

        :return: The payer of this TicketNew.  # noqa: E501
        :rtype: str
        """
        return self._payer

    @payer.setter
    def payer(self, payer):
        """Sets the payer of this TicketNew.

        An identification for the user which will pay the ticket. Is optional, and in most cases, should be left empty. If empty, at the moment the client will pay the ticket, both user identification and password will be entered, and the ticket will be confirmed. If specified, when confirming, only that user will be able to pay the ticket.    # noqa: E501

        :param payer: The payer of this TicketNew.  # noqa: E501
        :type: str
        """

        self._payer = payer

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

        The url to redirect when canceling the approve ticket flow. If an `orderId` is given then it will be added as a query parameter to this url when redirect as well as the ticket number too.   # noqa: E501

        :return: The cancel_url of this TicketNew.  # noqa: E501
        :rtype: str
        """
        return self._cancel_url

    @cancel_url.setter
    def cancel_url(self, cancel_url):
        """Sets the cancel_url of this TicketNew.

        The url to redirect when canceling the approve ticket flow. If an `orderId` is given then it will be added as a query parameter to this url when redirect as well as the ticket number too.   # noqa: E501

        :param cancel_url: The cancel_url of this TicketNew.  # noqa: E501
        :type: str
        """

        self._cancel_url = cancel_url

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

        The url to redirect after successful approving a ticket.  If an `orderId` is given then it will be added as a query parameter to this url when redirect as well as the ticket number too.   # noqa: E501

        :return: The success_url of this TicketNew.  # noqa: E501
        :rtype: str
        """
        return self._success_url

    @success_url.setter
    def success_url(self, success_url):
        """Sets the success_url of this TicketNew.

        The url to redirect after successful approving a ticket.  If an `orderId` is given then it will be added as a query parameter to this url when redirect as well as the ticket number too.   # noqa: E501

        :param success_url: The success_url of this TicketNew.  # noqa: E501
        :type: str
        """

        self._success_url = success_url

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

        The url to be invoked by the server after successfully approving a  ticket. If an `orderId` is given then it will be added as a query parameter to this url when redirect as well as the ticket number too.             # noqa: E501

        :return: The success_webhook of this TicketNew.  # noqa: E501
        :rtype: str
        """
        return self._success_webhook

    @success_webhook.setter
    def success_webhook(self, success_webhook):
        """Sets the success_webhook of this TicketNew.

        The url to be invoked by the server after successfully approving a  ticket. If an `orderId` is given then it will be added as a query parameter to this url when redirect as well as the ticket number too.             # noqa: E501

        :param success_webhook: The success_webhook of this TicketNew.  # noqa: E501
        :type: str
        """

        self._success_webhook = success_webhook

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

        An optional order identifier given by the ticket's creator. If given  then that identifier will be used at ticket processing to ensure the  ticket is for that order. This attribute is usefull in case the client doesn't want to reflect  the generated ticket number in its database after creating the ticket,   # noqa: E501

        :return: The order_id of this TicketNew.  # noqa: E501
        :rtype: str
        """
        return self._order_id

    @order_id.setter
    def order_id(self, order_id):
        """Sets the order_id of this TicketNew.

        An optional order identifier given by the ticket's creator. If given  then that identifier will be used at ticket processing to ensure the  ticket is for that order. This attribute is usefull in case the client doesn't want to reflect  the generated ticket number in its database after creating the ticket,   # noqa: E501

        :param order_id: The order_id of this TicketNew.  # noqa: E501
        :type: str
        """

        self._order_id = order_id

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

        Defines the expiration interval. If none is given, it is assumed that the ticket expires in one day.   # noqa: E501

        :return: The expires_after of this TicketNew.  # noqa: E501
        :rtype: TimeInterval
        """
        return self._expires_after

    @expires_after.setter
    def expires_after(self, expires_after):
        """Sets the expires_after of this TicketNew.

        Defines the expiration interval. If none is given, it is assumed that the ticket expires in one day.   # noqa: E501

        :param expires_after: The expires_after of this TicketNew.  # noqa: E501
        :type: TimeInterval
        """

        self._expires_after = expires_after

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

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