# coding: utf-8

"""
    Influx API Service

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    OpenAPI spec version: 0.1.0
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six
from influxdb_client.domain.authorization_update_request import AuthorizationUpdateRequest


class Authorization(AuthorizationUpdateRequest):
    """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 = {
        'org_id': 'str',
        'permissions': 'list[Permission]',
        'id': 'str',
        'token': 'str',
        'user_id': 'str',
        'user': 'str',
        'org': 'str',
        'links': 'object',
        'status': 'str',
        'description': 'str'
    }

    attribute_map = {
        'org_id': 'orgID',
        'permissions': 'permissions',
        'id': 'id',
        'token': 'token',
        'user_id': 'userID',
        'user': 'user',
        'org': 'org',
        'links': 'links',
        'status': 'status',
        'description': 'description'
    }

    def __init__(self, org_id=None, permissions=None, id=None, token=None, user_id=None, user=None, org=None, links=None, status='active', description=None):  # noqa: E501
        """Authorization - a model defined in OpenAPI"""  # noqa: E501
        AuthorizationUpdateRequest.__init__(self, status=status, description=description)

        self._org_id = None
        self._permissions = None
        self._id = None
        self._token = None
        self._user_id = None
        self._user = None
        self._org = None
        self._links = None
        self.discriminator = None

        if org_id is not None:
            self.org_id = org_id
        if permissions is not None:
            self.permissions = permissions
        if id is not None:
            self.id = id
        if token is not None:
            self.token = token
        if user_id is not None:
            self.user_id = user_id
        if user is not None:
            self.user = user
        if org is not None:
            self.org = org
        if links is not None:
            self.links = links

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

        ID of org that authorization is scoped to.  # noqa: E501

        :return: The org_id of this Authorization.  # noqa: E501
        :rtype: str
        """
        return self._org_id

    @org_id.setter
    def org_id(self, org_id):
        """Sets the org_id of this Authorization.

        ID of org that authorization is scoped to.  # noqa: E501

        :param org_id: The org_id of this Authorization.  # noqa: E501
        :type: str
        """

        self._org_id = org_id

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

        List of permissions for an auth.  An auth must have at least one Permission.  # noqa: E501

        :return: The permissions of this Authorization.  # noqa: E501
        :rtype: list[Permission]
        """
        return self._permissions

    @permissions.setter
    def permissions(self, permissions):
        """Sets the permissions of this Authorization.

        List of permissions for an auth.  An auth must have at least one Permission.  # noqa: E501

        :param permissions: The permissions of this Authorization.  # noqa: E501
        :type: list[Permission]
        """

        self._permissions = permissions

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


        :return: The id of this Authorization.  # noqa: E501
        :rtype: str
        """
        return self._id

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


        :param id: The id of this Authorization.  # noqa: E501
        :type: str
        """

        self._id = id

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

        Passed via the Authorization Header and Token Authentication type.  # noqa: E501

        :return: The token of this Authorization.  # noqa: E501
        :rtype: str
        """
        return self._token

    @token.setter
    def token(self, token):
        """Sets the token of this Authorization.

        Passed via the Authorization Header and Token Authentication type.  # noqa: E501

        :param token: The token of this Authorization.  # noqa: E501
        :type: str
        """

        self._token = token

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

        ID of user that created and owns the token.  # noqa: E501

        :return: The user_id of this Authorization.  # noqa: E501
        :rtype: str
        """
        return self._user_id

    @user_id.setter
    def user_id(self, user_id):
        """Sets the user_id of this Authorization.

        ID of user that created and owns the token.  # noqa: E501

        :param user_id: The user_id of this Authorization.  # noqa: E501
        :type: str
        """

        self._user_id = user_id

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

        Name of user that created and owns the token.  # noqa: E501

        :return: The user of this Authorization.  # noqa: E501
        :rtype: str
        """
        return self._user

    @user.setter
    def user(self, user):
        """Sets the user of this Authorization.

        Name of user that created and owns the token.  # noqa: E501

        :param user: The user of this Authorization.  # noqa: E501
        :type: str
        """

        self._user = user

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

        Name of the org token is scoped to.  # noqa: E501

        :return: The org of this Authorization.  # noqa: E501
        :rtype: str
        """
        return self._org

    @org.setter
    def org(self, org):
        """Sets the org of this Authorization.

        Name of the org token is scoped to.  # noqa: E501

        :param org: The org of this Authorization.  # noqa: E501
        :type: str
        """

        self._org = org

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


        :return: The links of this Authorization.  # noqa: E501
        :rtype: object
        """
        return self._links

    @links.setter
    def links(self, links):
        """Sets the links of this Authorization.


        :param links: The links of this Authorization.  # noqa: E501
        :type: object
        """

        self._links = links

    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, Authorization):
            return False

        return self.__dict__ == other.__dict__

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