# coding: utf-8

"""
    Agilicus API

    Agilicus API endpoints  # noqa: E501

    The version of the OpenAPI document: 2021.02.16
    Contact: dev@agilicus.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from agilicus_api.configuration import Configuration


class UserRequestInfoSpec(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 = {
        'user_id': 'str',
        'org_id': 'str',
        'requested_resource': 'str',
        'requested_sub_resource': 'str',
        'requested_resource_type': 'str',
        'request_information': 'str',
        'state': 'str'
    }

    attribute_map = {
        'user_id': 'user_id',
        'org_id': 'org_id',
        'requested_resource': 'requested_resource',
        'requested_sub_resource': 'requested_sub_resource',
        'requested_resource_type': 'requested_resource_type',
        'request_information': 'request_information',
        'state': 'state'
    }

    def __init__(self, user_id=None, org_id=None, requested_resource=None, requested_sub_resource=None, requested_resource_type=None, request_information=None, state=None, local_vars_configuration=None):  # noqa: E501
        """UserRequestInfoSpec - 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._user_id = None
        self._org_id = None
        self._requested_resource = None
        self._requested_sub_resource = None
        self._requested_resource_type = None
        self._request_information = None
        self._state = None
        self.discriminator = None

        self.user_id = user_id
        self.org_id = org_id
        self.requested_resource = requested_resource
        if requested_sub_resource is not None:
            self.requested_sub_resource = requested_sub_resource
        self.requested_resource_type = requested_resource_type
        if request_information is not None:
            self.request_information = request_information
        if state is not None:
            self.state = state

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

        The unique id of the User to which this record applies.   # noqa: E501

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

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

        The unique id of the User to which this record applies.   # noqa: E501

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

        self._user_id = user_id

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

        The unique id of the Organisation to which this record applies.   # noqa: E501

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

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

        The unique id of the Organisation to which this record applies.   # noqa: E501

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

        self._org_id = org_id

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

        The resource the user is requesting. For example an application name if the request_type is application_access. If the request_type is file_share_acces, this would be the file share name.   # noqa: E501

        :return: The requested_resource of this UserRequestInfoSpec.  # noqa: E501
        :rtype: str
        """
        return self._requested_resource

    @requested_resource.setter
    def requested_resource(self, requested_resource):
        """Sets the requested_resource of this UserRequestInfoSpec.

        The resource the user is requesting. For example an application name if the request_type is application_access. If the request_type is file_share_acces, this would be the file share name.   # noqa: E501

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

        self._requested_resource = requested_resource

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

        A resource tied to the resource the user is requesting. For example, this could be the name of a role if the request_type is application_access.   # noqa: E501

        :return: The requested_sub_resource of this UserRequestInfoSpec.  # noqa: E501
        :rtype: str
        """
        return self._requested_sub_resource

    @requested_sub_resource.setter
    def requested_sub_resource(self, requested_sub_resource):
        """Sets the requested_sub_resource of this UserRequestInfoSpec.

        A resource tied to the resource the user is requesting. For example, this could be the name of a role if the request_type is application_access.   # noqa: E501

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

        self._requested_sub_resource = requested_sub_resource

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

        The type of request a user is making  # noqa: E501

        :return: The requested_resource_type of this UserRequestInfoSpec.  # noqa: E501
        :rtype: str
        """
        return self._requested_resource_type

    @requested_resource_type.setter
    def requested_resource_type(self, requested_resource_type):
        """Sets the requested_resource_type of this UserRequestInfoSpec.

        The type of request a user is making  # noqa: E501

        :param requested_resource_type: The requested_resource_type of this UserRequestInfoSpec.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and requested_resource_type is None:  # noqa: E501
            raise ValueError("Invalid value for `requested_resource_type`, must not be `None`")  # noqa: E501
        allowed_values = ["application_access", "file_share_access"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and requested_resource_type not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `requested_resource_type` ({0}), must be one of {1}"  # noqa: E501
                .format(requested_resource_type, allowed_values)
            )

        self._requested_resource_type = requested_resource_type

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

        Text describing why the user is requesting application access  # noqa: E501

        :return: The request_information of this UserRequestInfoSpec.  # noqa: E501
        :rtype: str
        """
        return self._request_information

    @request_information.setter
    def request_information(self, request_information):
        """Sets the request_information of this UserRequestInfoSpec.

        Text describing why the user is requesting application access  # noqa: E501

        :param request_information: The request_information of this UserRequestInfoSpec.  # noqa: E501
        :type: str
        """

        self._request_information = request_information

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

        The state of the resource access request  # noqa: E501

        :return: The state of this UserRequestInfoSpec.  # noqa: E501
        :rtype: str
        """
        return self._state

    @state.setter
    def state(self, state):
        """Sets the state of this UserRequestInfoSpec.

        The state of the resource access request  # noqa: E501

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

        self._state = state

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

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