"""
    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 PolicyAssociation:
    """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 = {
        "enabled": "bool",
        "parameters": "list[NameValuePair]",
        "id": "str",
        "name": "str",
        "description": "str",
        "predefined": "bool",
        "created_at": "datetime",
        "created_by": "str",
        "n_associated_apps": "int",
        "expression": "object",
        "type": "str",
        "category": "str",
        "region": "str",
        "ui_features": "str",
    }

    attribute_map = {
        "enabled": "Enabled",
        "parameters": "Parameters",
        "id": "Id",
        "name": "Name",
        "description": "Description",
        "predefined": "Predefined",
        "created_at": "CreatedAt",
        "created_by": "CreatedBy",
        "n_associated_apps": "NAssociatedApps",
        "expression": "Expression",
        "type": "Type",
        "category": "Category",
        "region": "Region",
        "ui_features": "UIFeatures",
    }

    def __init__(
        self,
        enabled=None,
        parameters=None,
        id=None,
        name=None,
        description=None,
        predefined=None,
        created_at=None,
        created_by=None,
        n_associated_apps=None,
        expression=None,
        type=None,
        category=None,
        region=None,
        ui_features=None,
        _configuration=None,
    ):
        """PolicyAssociation - a model defined in Swagger"""
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._enabled = None
        self._parameters = None
        self._id = None
        self._name = None
        self._description = None
        self._predefined = None
        self._created_at = None
        self._created_by = None
        self._n_associated_apps = None
        self._expression = None
        self._type = None
        self._category = None
        self._region = None
        self._ui_features = None
        self.discriminator = None

        if enabled is not None:
            self.enabled = enabled
        if parameters is not None:
            self.parameters = parameters
        if id is not None:
            self.id = id
        if name is not None:
            self.name = name
        if description is not None:
            self.description = description
        if predefined is not None:
            self.predefined = predefined
        if created_at is not None:
            self.created_at = created_at
        if created_by is not None:
            self.created_by = created_by
        if n_associated_apps is not None:
            self.n_associated_apps = n_associated_apps
        if expression is not None:
            self.expression = expression
        if type is not None:
            self.type = type
        if category is not None:
            self.category = category
        if region is not None:
            self.region = region
        if ui_features is not None:
            self.ui_features = ui_features

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


        :return: The enabled of this PolicyAssociation.
        :rtype: bool
        """
        return self._enabled

    @enabled.setter
    def enabled(self, enabled):
        """Sets the enabled of this PolicyAssociation.


        :param enabled: The enabled of this PolicyAssociation.
        :type: bool
        """

        self._enabled = enabled

    @property
    def parameters(self):
        # type: () -> list[NameValuePair]
        """Gets the parameters of this PolicyAssociation.


        :return: The parameters of this PolicyAssociation.
        :rtype: list[NameValuePair]
        """
        return self._parameters

    @parameters.setter
    def parameters(self, parameters):
        """Sets the parameters of this PolicyAssociation.


        :param parameters: The parameters of this PolicyAssociation.
        :type: list[NameValuePair]
        """

        self._parameters = parameters

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


        :return: The id of this PolicyAssociation.
        :rtype: str
        """
        return self._id

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


        :param id: The id of this PolicyAssociation.
        :type: str
        """

        self._id = id

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


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

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


        :param name: The name of this PolicyAssociation.
        :type: str
        """

        self._name = name

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


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

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


        :param description: The description of this PolicyAssociation.
        :type: str
        """

        self._description = description

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


        :return: The predefined of this PolicyAssociation.
        :rtype: bool
        """
        return self._predefined

    @predefined.setter
    def predefined(self, predefined):
        """Sets the predefined of this PolicyAssociation.


        :param predefined: The predefined of this PolicyAssociation.
        :type: bool
        """

        self._predefined = predefined

    @property
    def created_at(self):
        # type: () -> datetime
        """Gets the created_at of this PolicyAssociation.


        :return: The created_at of this PolicyAssociation.
        :rtype: datetime
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at):
        """Sets the created_at of this PolicyAssociation.


        :param created_at: The created_at of this PolicyAssociation.
        :type: datetime
        """

        self._created_at = created_at

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


        :return: The created_by of this PolicyAssociation.
        :rtype: str
        """
        return self._created_by

    @created_by.setter
    def created_by(self, created_by):
        """Sets the created_by of this PolicyAssociation.


        :param created_by: The created_by of this PolicyAssociation.
        :type: str
        """

        self._created_by = created_by

    @property
    def n_associated_apps(self):
        # type: () -> int
        """Gets the n_associated_apps of this PolicyAssociation.


        :return: The n_associated_apps of this PolicyAssociation.
        :rtype: int
        """
        return self._n_associated_apps

    @n_associated_apps.setter
    def n_associated_apps(self, n_associated_apps):
        """Sets the n_associated_apps of this PolicyAssociation.


        :param n_associated_apps: The n_associated_apps of this PolicyAssociation.
        :type: int
        """

        self._n_associated_apps = n_associated_apps

    @property
    def expression(self):
        # type: () -> object
        """Gets the expression of this PolicyAssociation.


        :return: The expression of this PolicyAssociation.
        :rtype: object
        """
        return self._expression

    @expression.setter
    def expression(self, expression):
        """Sets the expression of this PolicyAssociation.


        :param expression: The expression of this PolicyAssociation.
        :type: object
        """

        self._expression = expression

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


        :return: The type of this PolicyAssociation.
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this PolicyAssociation.


        :param type: The type of this PolicyAssociation.
        :type: str
        """
        allowed_values = [
            "None",
            "OwaspTop10_2017",
            "Sans25",
            "EuGdpr_2016",
            "PCI",
            "Hipaa",
            "OwaspTop10Mobile_2016",
            "ISO27001",
            "ISO27002",
            "Wasc",
            "Nist",
            "Sox",
            "Fisma",
            "Fippa",
            "Efta",
            "DisaStig",
            "Padss",
            "OwaspTop10_2021",
            "OwaspTop10OpenApi_2019",
            "Ccpa",
        ]
        if self._configuration.client_side_validation and type not in allowed_values:
            raise ValueError(f"Invalid value for `type` ({type}), must be one of {allowed_values}")

        self._type = type

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


        :return: The category of this PolicyAssociation.
        :rtype: str
        """
        return self._category

    @category.setter
    def category(self, category):
        """Sets the category of this PolicyAssociation.


        :param category: The category of this PolicyAssociation.
        :type: str
        """
        allowed_values = [
            "Custom",
            "Security",
            "Regulation",
            "IndustryStandard",
        ]
        if self._configuration.client_side_validation and category not in allowed_values:
            raise ValueError(
                "Invalid value for `category` ({}), must be one of {}".format(
                    category, allowed_values
                )
            )

        self._category = category

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


        :return: The region of this PolicyAssociation.
        :rtype: str
        """
        return self._region

    @region.setter
    def region(self, region):
        """Sets the region of this PolicyAssociation.


        :param region: The region of this PolicyAssociation.
        :type: str
        """
        allowed_values = [
            "Global",
            "US",
            "UK",
            "Canada",
            "EU",
            "Japan",
            "AUS",
        ]
        if self._configuration.client_side_validation and region not in allowed_values:
            raise ValueError(
                f"Invalid value for `region` ({region}), must be one of {allowed_values}"
            )

        self._region = region

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


        :return: The ui_features of this PolicyAssociation.
        :rtype: str
        """
        return self._ui_features

    @ui_features.setter
    def ui_features(self, ui_features):
        """Sets the ui_features of this PolicyAssociation.


        :param ui_features: The ui_features of this PolicyAssociation.
        :type: str
        """

        self._ui_features = ui_features

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

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