# coding: utf-8

"""
    CardPay REST API

    Welcome to the CardPay REST API. The CardPay API uses HTTP verbs and a [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) resources endpoint structure (see more info about REST). Request and response payloads are formatted as JSON. Merchant uses API to create payments, refunds, payouts or recurrings, check or update transaction status and get information about created transactions. In API authentication process based on [OAuth 2.0](https://oauth.net/2/) standard. For recent changes see changelog section.  # noqa: E501

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


import pprint
import re  # noqa: F401

import six


class ApiTokens(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 = {
        "access_token": "str",
        "expires_in": "int",
        "refresh_expires_in": "int",
        "refresh_token": "str",
        "token_type": "str",
    }

    attribute_map = {
        "access_token": "access_token",
        "expires_in": "expires_in",
        "refresh_expires_in": "refresh_expires_in",
        "refresh_token": "refresh_token",
        "token_type": "token_type",
    }

    def __init__(
        self,
        access_token=None,
        expires_in=None,
        refresh_expires_in=None,
        refresh_token=None,
        token_type=None,
    ):  # noqa: E501
        """ApiTokens - a model defined in Swagger"""  # noqa: E501

        self._access_token = None
        self._expires_in = None
        self._refresh_expires_in = None
        self._refresh_token = None
        self._token_type = None
        self.discriminator = None

        self.access_token = access_token
        self.expires_in = expires_in
        self.refresh_expires_in = refresh_expires_in
        self.refresh_token = refresh_token
        self.token_type = token_type

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

        API access token which grants the access to the list of authorized services.  # noqa: E501

        :return: The access_token of this ApiTokens.  # noqa: E501
        :rtype: str
        """
        return self._access_token

    @access_token.setter
    def access_token(self, access_token):
        """Sets the access_token of this ApiTokens.

        API access token which grants the access to the list of authorized services.  # noqa: E501

        :param access_token: The access_token of this ApiTokens.  # noqa: E501
        :type: str
        """
        if access_token is None:
            raise ValueError(
                "Invalid value for `access_token`, must not be `None`"
            )  # noqa: E501

        self._access_token = access_token

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

        Access token lifetime in seconds.  # noqa: E501

        :return: The expires_in of this ApiTokens.  # noqa: E501
        :rtype: int
        """
        return self._expires_in

    @expires_in.setter
    def expires_in(self, expires_in):
        """Sets the expires_in of this ApiTokens.

        Access token lifetime in seconds.  # noqa: E501

        :param expires_in: The expires_in of this ApiTokens.  # noqa: E501
        :type: int
        """
        if expires_in is None:
            raise ValueError(
                "Invalid value for `expires_in`, must not be `None`"
            )  # noqa: E501

        self._expires_in = expires_in

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

        Refresh token lifetime in seconds.  # noqa: E501

        :return: The refresh_expires_in of this ApiTokens.  # noqa: E501
        :rtype: int
        """
        return self._refresh_expires_in

    @refresh_expires_in.setter
    def refresh_expires_in(self, refresh_expires_in):
        """Sets the refresh_expires_in of this ApiTokens.

        Refresh token lifetime in seconds.  # noqa: E501

        :param refresh_expires_in: The refresh_expires_in of this ApiTokens.  # noqa: E501
        :type: int
        """
        if refresh_expires_in is None:
            raise ValueError(
                "Invalid value for `refresh_expires_in`, must not be `None`"
            )  # noqa: E501

        self._refresh_expires_in = refresh_expires_in

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

        API refresh token that is used to update expired access token.  # noqa: E501

        :return: The refresh_token of this ApiTokens.  # noqa: E501
        :rtype: str
        """
        return self._refresh_token

    @refresh_token.setter
    def refresh_token(self, refresh_token):
        """Sets the refresh_token of this ApiTokens.

        API refresh token that is used to update expired access token.  # noqa: E501

        :param refresh_token: The refresh_token of this ApiTokens.  # noqa: E501
        :type: str
        """
        if refresh_token is None:
            raise ValueError(
                "Invalid value for `refresh_token`, must not be `None`"
            )  # noqa: E501

        self._refresh_token = refresh_token

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

        Access token type  # noqa: E501

        :return: The token_type of this ApiTokens.  # noqa: E501
        :rtype: str
        """
        return self._token_type

    @token_type.setter
    def token_type(self, token_type):
        """Sets the token_type of this ApiTokens.

        Access token type  # noqa: E501

        :param token_type: The token_type of this ApiTokens.  # noqa: E501
        :type: str
        """
        if token_type is None:
            raise ValueError(
                "Invalid value for `token_type`, must not be `None`"
            )  # noqa: E501

        self._token_type = token_type

    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:
                if value is not None:
                    result[attr] = value
        if issubclass(ApiTokens, 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, ApiTokens):
            return False

        return self.__dict__ == other.__dict__

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