# coding: utf-8

"""
    Stencila Hub API

    ## Authentication  Many endpoints in the Stencila Hub API require an authentication token. These tokens carry many privileges, so be sure to keep them secure. Do not place your tokens in publicly accessible areas such as client-side code. The API is only served over HTTPS to avoid exposing tokens and other data on the network.  To obtain a token, [`POST /api/tokens`](#operations-tokens-tokens_create) with either a `username` and `password` pair, or an [OpenID Connect](https://openid.net/connect/) token. Then use the token in the `Authorization` header of subsequent requests with the prefix `Token` e.g.      curl -H \"Authorization: Token 48866b1e38a2e9db0baada2140b2327937f4a3636dd5f2dfd8c212341c88d34\" https://hub.stenci.la/api/projects/  Alternatively, you can use `Basic` authentication with the token used as the username and no password. This can be more convenient when using command line tools such as [cURL](https://curl.haxx.se/) e.g.      curl -u 48866b1e38a2e9db0baada2140b2327937f4a3636dd5f2dfd8c212341c88d34: https://hub.stenci.la/api/projects/  Or, the less ubiquitous, but more accessible [httpie](https://httpie.org/):      http --auth 48866b1e38a2e9db0baada2140b2327937f4a3636dd5f2dfd8c212341c88d34: https://hub.stenci.la/api/projects/  In both examples above, the trailing colon is not required but avoids being asked for a password.  ## Versioning  The Stencila Hub is released using semantic versioning. The current version is available from the [`GET /api/status`](/api/status) endpoint. Please see the [Github release page](https://github.com/stencila/hub/releases) and the [changelog](https://github.com/stencila/hub/blob/master/CHANGELOG.md) for details on each release. We currently do not provide versioning of the API but plan to do so soon (probably by using a `Accept: application/vnd.stencila.hub+json;version=1.0` request header). If you are using, or interested in using, the API please contact us and we may be able to expedite this.   # noqa: E501

    The version of the OpenAPI document: v1
    Contact: hello@stenci.la
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from stencila.hub.configuration import Configuration


class Invite(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'id': 'int',
        'url': 'str',
        'key': 'str',
        'email': 'str',
        'message': 'str',
        'created': 'datetime',
        'sent': 'datetime',
        'accepted': 'bool',
        'completed': 'datetime',
        'action': 'str',
        'subject_id': 'int',
        'arguments': 'str',
        'inviter': 'int',
        'subject_type': 'int'
    }

    attribute_map = {
        'id': 'id',
        'url': 'url',
        'key': 'key',
        'email': 'email',
        'message': 'message',
        'created': 'created',
        'sent': 'sent',
        'accepted': 'accepted',
        'completed': 'completed',
        'action': 'action',
        'subject_id': 'subjectId',
        'arguments': 'arguments',
        'inviter': 'inviter',
        'subject_type': 'subjectType'
    }

    def __init__(self, id=None, url=None, key=None, email=None, message=None, created=None, sent=None, accepted=None, completed=None, action=None, subject_id=None, arguments=None, inviter=None, subject_type=None, local_vars_configuration=None):  # noqa: E501
        """Invite - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._id = None
        self._url = None
        self._key = None
        self._email = None
        self._message = None
        self._created = None
        self._sent = None
        self._accepted = None
        self._completed = None
        self._action = None
        self._subject_id = None
        self._arguments = None
        self._inviter = None
        self._subject_type = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if url is not None:
            self.url = url
        if key is not None:
            self.key = key
        self.email = email
        self.message = message
        if created is not None:
            self.created = created
        self.sent = sent
        if accepted is not None:
            self.accepted = accepted
        self.completed = completed
        self.action = action
        self.subject_id = subject_id
        self.arguments = arguments
        self.inviter = inviter
        self.subject_type = subject_type

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


        :return: The id of this Invite.  # noqa: E501
        :rtype: int
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this Invite.


        :param id: The id of this Invite.  # noqa: E501
        :type id: int
        """

        self._id = id

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


        :return: The url of this Invite.  # noqa: E501
        :rtype: str
        """
        return self._url

    @url.setter
    def url(self, url):
        """Sets the url of this Invite.


        :param url: The url of this Invite.  # noqa: E501
        :type url: str
        """

        self._url = url

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

        The key for the invite.  # noqa: E501

        :return: The key of this Invite.  # noqa: E501
        :rtype: str
        """
        return self._key

    @key.setter
    def key(self, key):
        """Sets the key of this Invite.

        The key for the invite.  # noqa: E501

        :param key: The key of this Invite.  # noqa: E501
        :type key: str
        """
        if (self.local_vars_configuration.client_side_validation and
                key is not None and len(key) < 1):
            raise ValueError("Invalid value for `key`, length must be greater than or equal to `1`")  # noqa: E501

        self._key = key

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

        The email address of the person you are inviting.  # noqa: E501

        :return: The email of this Invite.  # noqa: E501
        :rtype: str
        """
        return self._email

    @email.setter
    def email(self, email):
        """Sets the email of this Invite.

        The email address of the person you are inviting.  # noqa: E501

        :param email: The email of this Invite.  # noqa: E501
        :type email: str
        """
        if self.local_vars_configuration.client_side_validation and email is None:  # noqa: E501
            raise ValueError("Invalid value for `email`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                email is not None and len(email) > 2048):
            raise ValueError("Invalid value for `email`, length must be less than or equal to `2048`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                email is not None and len(email) < 1):
            raise ValueError("Invalid value for `email`, length must be greater than or equal to `1`")  # noqa: E501

        self._email = email

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

        An optional message to send to the invitee.  # noqa: E501

        :return: The message of this Invite.  # noqa: E501
        :rtype: str
        """
        return self._message

    @message.setter
    def message(self, message):
        """Sets the message of this Invite.

        An optional message to send to the invitee.  # noqa: E501

        :param message: The message of this Invite.  # noqa: E501
        :type message: str
        """

        self._message = message

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

        When the invite was created.  # noqa: E501

        :return: The created of this Invite.  # noqa: E501
        :rtype: datetime
        """
        return self._created

    @created.setter
    def created(self, created):
        """Sets the created of this Invite.

        When the invite was created.  # noqa: E501

        :param created: The created of this Invite.  # noqa: E501
        :type created: datetime
        """

        self._created = created

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

        When the invite was sent.  # noqa: E501

        :return: The sent of this Invite.  # noqa: E501
        :rtype: datetime
        """
        return self._sent

    @sent.setter
    def sent(self, sent):
        """Sets the sent of this Invite.

        When the invite was sent.  # noqa: E501

        :param sent: The sent of this Invite.  # noqa: E501
        :type sent: datetime
        """

        self._sent = sent

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

        Whether the invite has been accepted. Will only be true if the user has clicked on the invitation AND authenticated.  # noqa: E501

        :return: The accepted of this Invite.  # noqa: E501
        :rtype: bool
        """
        return self._accepted

    @accepted.setter
    def accepted(self, accepted):
        """Sets the accepted of this Invite.

        Whether the invite has been accepted. Will only be true if the user has clicked on the invitation AND authenticated.  # noqa: E501

        :param accepted: The accepted of this Invite.  # noqa: E501
        :type accepted: bool
        """

        self._accepted = accepted

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

        When the invite action was completed  # noqa: E501

        :return: The completed of this Invite.  # noqa: E501
        :rtype: datetime
        """
        return self._completed

    @completed.setter
    def completed(self, completed):
        """Sets the completed of this Invite.

        When the invite action was completed  # noqa: E501

        :param completed: The completed of this Invite.  # noqa: E501
        :type completed: datetime
        """

        self._completed = completed

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

        The action to perform when the invitee signs up.  # noqa: E501

        :return: The action of this Invite.  # noqa: E501
        :rtype: str
        """
        return self._action

    @action.setter
    def action(self, action):
        """Sets the action of this Invite.

        The action to perform when the invitee signs up.  # noqa: E501

        :param action: The action of this Invite.  # noqa: E501
        :type action: str
        """
        allowed_values = [None,"join_account", "join_team", "join_project", "take_tour"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and action not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `action` ({0}), must be one of {1}"  # noqa: E501
                .format(action, allowed_values)
            )

        self._action = action

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

        The id of the target of the action.  # noqa: E501

        :return: The subject_id of this Invite.  # noqa: E501
        :rtype: int
        """
        return self._subject_id

    @subject_id.setter
    def subject_id(self, subject_id):
        """Sets the subject_id of this Invite.

        The id of the target of the action.  # noqa: E501

        :param subject_id: The subject_id of this Invite.  # noqa: E501
        :type subject_id: int
        """

        self._subject_id = subject_id

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

        Any additional arguments to pass to the action.  # noqa: E501

        :return: The arguments of this Invite.  # noqa: E501
        :rtype: str
        """
        return self._arguments

    @arguments.setter
    def arguments(self, arguments):
        """Sets the arguments of this Invite.

        Any additional arguments to pass to the action.  # noqa: E501

        :param arguments: The arguments of this Invite.  # noqa: E501
        :type arguments: str
        """

        self._arguments = arguments

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

        The user who created the invite.  # noqa: E501

        :return: The inviter of this Invite.  # noqa: E501
        :rtype: int
        """
        return self._inviter

    @inviter.setter
    def inviter(self, inviter):
        """Sets the inviter of this Invite.

        The user who created the invite.  # noqa: E501

        :param inviter: The inviter of this Invite.  # noqa: E501
        :type inviter: int
        """

        self._inviter = inviter

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

        The type of the target of the action. e.g Team, Account  # noqa: E501

        :return: The subject_type of this Invite.  # noqa: E501
        :rtype: int
        """
        return self._subject_type

    @subject_type.setter
    def subject_type(self, subject_type):
        """Sets the subject_type of this Invite.

        The type of the target of the action. e.g Team, Account  # noqa: E501

        :param subject_type: The subject_type of this Invite.  # noqa: E501
        :type subject_type: int
        """

        self._subject_type = subject_type

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

        for attr, _ in six.iteritems(self.openapi_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 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, Invite):
            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, Invite):
            return True

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