"""
    HCL AppScan on Cloud (v2)

    This API allows you to interact with the service. The API allows you to perform many of the operations available in the UI and more.</br>For authentication, use the relevant APIs in the Account section. A successful authentication response includes a bearer token for use in subsequent API calls. Pasting this token in the 'Access token' field above will automatically add the authorization header to any API call that requires a valid session.

    OpenAPI spec version: v2

    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

from pyasoc.configuration import Configuration


class UserSiteCommonModelsNewRoleModel:
    """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 = {
        "name": "str",
        "is_default": "bool",
        "external_group_name": "str",
        "description": "str",
        "capabilities": "dict(str, bool)",
    }

    attribute_map = {
        "name": "Name",
        "is_default": "IsDefault",
        "external_group_name": "ExternalGroupName",
        "description": "Description",
        "capabilities": "Capabilities",
    }

    def __init__(
        self,
        name=None,
        is_default=None,
        external_group_name=None,
        description=None,
        capabilities=None,
        _configuration=None,
    ):
        """UserSiteCommonModelsNewRoleModel - a model defined in Swagger"""
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._name = None
        self._is_default = None
        self._external_group_name = None
        self._description = None
        self._capabilities = None
        self.discriminator = None

        if name is not None:
            self.name = name
        if is_default is not None:
            self.is_default = is_default
        if external_group_name is not None:
            self.external_group_name = external_group_name
        if description is not None:
            self.description = description
        if capabilities is not None:
            self.capabilities = capabilities

    @property
    def name(self):
        # type: () -> str
        """Gets the name of this UserSiteCommonModelsNewRoleModel.


        :return: The name of this UserSiteCommonModelsNewRoleModel.
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this UserSiteCommonModelsNewRoleModel.


        :param name: The name of this UserSiteCommonModelsNewRoleModel.
        :type: str
        """
        if self._configuration.client_side_validation and name is not None and len(name) > 256:
            raise ValueError("Invalid value for `name`, length must be less than or equal to `256`")
        if self._configuration.client_side_validation and name is not None and len(name) < 0:
            raise ValueError(
                "Invalid value for `name`, length must be greater than or equal to `0`"
            )

        self._name = name

    @property
    def is_default(self):
        # type: () -> bool
        """Gets the is_default of this UserSiteCommonModelsNewRoleModel.


        :return: The is_default of this UserSiteCommonModelsNewRoleModel.
        :rtype: bool
        """
        return self._is_default

    @is_default.setter
    def is_default(self, is_default):
        """Sets the is_default of this UserSiteCommonModelsNewRoleModel.


        :param is_default: The is_default of this UserSiteCommonModelsNewRoleModel.
        :type: bool
        """

        self._is_default = is_default

    @property
    def external_group_name(self):
        # type: () -> str
        """Gets the external_group_name of this UserSiteCommonModelsNewRoleModel.


        :return: The external_group_name of this UserSiteCommonModelsNewRoleModel.
        :rtype: str
        """
        return self._external_group_name

    @external_group_name.setter
    def external_group_name(self, external_group_name):
        """Sets the external_group_name of this UserSiteCommonModelsNewRoleModel.


        :param external_group_name: The external_group_name of this UserSiteCommonModelsNewRoleModel.
        :type: str
        """
        if (
            self._configuration.client_side_validation
            and external_group_name is not None
            and len(external_group_name) > 256
        ):
            raise ValueError(
                "Invalid value for `external_group_name`, length must be less than or equal to `256`"
            )
        if (
            self._configuration.client_side_validation
            and external_group_name is not None
            and len(external_group_name) < 0
        ):
            raise ValueError(
                "Invalid value for `external_group_name`, length must be greater than or equal to `0`"
            )

        self._external_group_name = external_group_name

    @property
    def description(self):
        # type: () -> str
        """Gets the description of this UserSiteCommonModelsNewRoleModel.


        :return: The description of this UserSiteCommonModelsNewRoleModel.
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this UserSiteCommonModelsNewRoleModel.


        :param description: The description of this UserSiteCommonModelsNewRoleModel.
        :type: str
        """
        if (
            self._configuration.client_side_validation
            and description is not None
            and len(description) > 2048
        ):
            raise ValueError(
                "Invalid value for `description`, length must be less than or equal to `2048`"
            )
        if (
            self._configuration.client_side_validation
            and description is not None
            and len(description) < 0
        ):
            raise ValueError(
                "Invalid value for `description`, length must be greater than or equal to `0`"
            )

        self._description = description

    @property
    def capabilities(self):
        # type: () -> dict(str, bool)
        """Gets the capabilities of this UserSiteCommonModelsNewRoleModel.


        :return: The capabilities of this UserSiteCommonModelsNewRoleModel.
        :rtype: dict(str, bool)
        """
        return self._capabilities

    @capabilities.setter
    def capabilities(self, capabilities):
        """Sets the capabilities of this UserSiteCommonModelsNewRoleModel.


        :param capabilities: The capabilities of this UserSiteCommonModelsNewRoleModel.
        :type: dict(str, bool)
        """

        self._capabilities = capabilities

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

        for attr, _ in self.swagger_types.items():
            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
        if issubclass(UserSiteCommonModelsNewRoleModel, 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, UserSiteCommonModelsNewRoleModel):
            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, UserSiteCommonModelsNewRoleModel):
            return True

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