# coding: utf-8

"""
    BIMData API

    BIMData API is a tool to interact with your models stored on BIMData’s servers.     Through the API, you can manage your projects, the clouds, upload your IFC files and manage them through endpoints.  # noqa: E501

    The version of the OpenAPI document: v1
    Contact: support@bimdata.io
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from bimdata_api_client.configuration import Configuration


class Invitation(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',
        'client_id': 'str',
        'redirect_uri': 'str',
        'cloud_name': 'str',
        'cloud_role': 'int',
        'project_name': 'str',
        'project_role': 'int',
        'email': 'str',
        'status': 'str',
        'sender_provider_sub': 'str'
    }

    attribute_map = {
        'id': 'id',
        'client_id': 'client_id',
        'redirect_uri': 'redirect_uri',
        'cloud_name': 'cloud_name',
        'cloud_role': 'cloud_role',
        'project_name': 'project_name',
        'project_role': 'project_role',
        'email': 'email',
        'status': 'status',
        'sender_provider_sub': 'sender_provider_sub'
    }

    def __init__(self, id=None, client_id=None, redirect_uri=None, cloud_name=None, cloud_role=None, project_name=None, project_role=None, email=None, status=None, sender_provider_sub=None, local_vars_configuration=None):  # noqa: E501
        """Invitation - 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._client_id = None
        self._redirect_uri = None
        self._cloud_name = None
        self._cloud_role = None
        self._project_name = None
        self._project_role = None
        self._email = None
        self._status = None
        self._sender_provider_sub = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if client_id is not None:
            self.client_id = client_id
        self.redirect_uri = redirect_uri
        self.cloud_name = cloud_name
        self.cloud_role = cloud_role
        if project_name is not None:
            self.project_name = project_name
        self.project_role = project_role
        self.email = email
        if status is not None:
            self.status = status
        if sender_provider_sub is not None:
            self.sender_provider_sub = sender_provider_sub

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


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

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


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

        self._id = id

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


        :return: The client_id of this Invitation.  # noqa: E501
        :rtype: str
        """
        return self._client_id

    @client_id.setter
    def client_id(self, client_id):
        """Sets the client_id of this Invitation.


        :param client_id: The client_id of this Invitation.  # noqa: E501
        :type: str
        """

        self._client_id = client_id

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

        User will be redirected to this uri when they accept the invitation  # noqa: E501

        :return: The redirect_uri of this Invitation.  # noqa: E501
        :rtype: str
        """
        return self._redirect_uri

    @redirect_uri.setter
    def redirect_uri(self, redirect_uri):
        """Sets the redirect_uri of this Invitation.

        User will be redirected to this uri when they accept the invitation  # noqa: E501

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

        self._redirect_uri = redirect_uri

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


        :return: The cloud_name of this Invitation.  # noqa: E501
        :rtype: str
        """
        return self._cloud_name

    @cloud_name.setter
    def cloud_name(self, cloud_name):
        """Sets the cloud_name of this Invitation.


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

        self._cloud_name = cloud_name

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

        Role the user will have when they accept the invitation  # noqa: E501

        :return: The cloud_role of this Invitation.  # noqa: E501
        :rtype: int
        """
        return self._cloud_role

    @cloud_role.setter
    def cloud_role(self, cloud_role):
        """Sets the cloud_role of this Invitation.

        Role the user will have when they accept the invitation  # noqa: E501

        :param cloud_role: The cloud_role of this Invitation.  # noqa: E501
        :type: int
        """
        if self.local_vars_configuration.client_side_validation and cloud_role is None:  # noqa: E501
            raise ValueError("Invalid value for `cloud_role`, must not be `None`")  # noqa: E501

        self._cloud_role = cloud_role

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


        :return: The project_name of this Invitation.  # noqa: E501
        :rtype: str
        """
        return self._project_name

    @project_name.setter
    def project_name(self, project_name):
        """Sets the project_name of this Invitation.


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

        self._project_name = project_name

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

        Role the user will have when they accept the invitation  # noqa: E501

        :return: The project_role of this Invitation.  # noqa: E501
        :rtype: int
        """
        return self._project_role

    @project_role.setter
    def project_role(self, project_role):
        """Sets the project_role of this Invitation.

        Role the user will have when they accept the invitation  # noqa: E501

        :param project_role: The project_role of this Invitation.  # noqa: E501
        :type: int
        """

        self._project_role = project_role

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

        email of the user to invite  # noqa: E501

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

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

        email of the user to invite  # noqa: E501

        :param email: The email of this Invitation.  # noqa: E501
        :type: 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) > 256):
            raise ValueError("Invalid value for `email`, length must be less than or equal to `256`")  # 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 status(self):
        """Gets the status of this Invitation.  # noqa: E501

         A: Accepted D: Denied P: Pending   # noqa: E501

        :return: The status of this Invitation.  # noqa: E501
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this Invitation.

         A: Accepted D: Denied P: Pending   # noqa: E501

        :param status: The status of this Invitation.  # noqa: E501
        :type: str
        """
        allowed_values = ["A", "D", "P"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and status not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `status` ({0}), must be one of {1}"  # noqa: E501
                .format(status, allowed_values)
            )

        self._status = status

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

        OIDC sub of the sender. The original sub from the provider is used instead of the broker sub  # noqa: E501

        :return: The sender_provider_sub of this Invitation.  # noqa: E501
        :rtype: str
        """
        return self._sender_provider_sub

    @sender_provider_sub.setter
    def sender_provider_sub(self, sender_provider_sub):
        """Sets the sender_provider_sub of this Invitation.

        OIDC sub of the sender. The original sub from the provider is used instead of the broker sub  # noqa: E501

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

        self._sender_provider_sub = sender_provider_sub

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

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