"""
    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 AppScanSaaSModelsV2NewWebhook:
    """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 = {
        "presence_id": "str",
        "uri": "str",
        "_global": "bool",
        "asset_group_id": "str",
        "event": "str",
    }

    attribute_map = {
        "presence_id": "PresenceId",
        "uri": "Uri",
        "_global": "Global",
        "asset_group_id": "AssetGroupId",
        "event": "Event",
    }

    def __init__(
        self,
        presence_id=None,
        uri=None,
        _global=None,
        asset_group_id=None,
        event=None,
        _configuration=None,
    ):
        """AppScanSaaSModelsV2NewWebhook - a model defined in Swagger"""
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._presence_id = None
        self._uri = None
        self.__global = None
        self._asset_group_id = None
        self._event = None
        self.discriminator = None

        self.presence_id = presence_id
        self.uri = uri
        if _global is not None:
            self._global = _global
        if asset_group_id is not None:
            self.asset_group_id = asset_group_id
        self.event = event

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


        :return: The presence_id of this AppScanSaaSModelsV2NewWebhook.
        :rtype: str
        """
        return self._presence_id

    @presence_id.setter
    def presence_id(self, presence_id):
        """Sets the presence_id of this AppScanSaaSModelsV2NewWebhook.


        :param presence_id: The presence_id of this AppScanSaaSModelsV2NewWebhook.
        :type: str
        """
        if self._configuration.client_side_validation and presence_id is None:
            raise ValueError("Invalid value for `presence_id`, must not be `None`")

        self._presence_id = presence_id

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


        :return: The uri of this AppScanSaaSModelsV2NewWebhook.
        :rtype: str
        """
        return self._uri

    @uri.setter
    def uri(self, uri):
        """Sets the uri of this AppScanSaaSModelsV2NewWebhook.


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

        self._uri = uri

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


        :return: The _global of this AppScanSaaSModelsV2NewWebhook.
        :rtype: bool
        """
        return self.__global

    @_global.setter
    def _global(self, _global):
        """Sets the _global of this AppScanSaaSModelsV2NewWebhook.


        :param _global: The _global of this AppScanSaaSModelsV2NewWebhook.
        :type: bool
        """

        self.__global = _global

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


        :return: The asset_group_id of this AppScanSaaSModelsV2NewWebhook.
        :rtype: str
        """
        return self._asset_group_id

    @asset_group_id.setter
    def asset_group_id(self, asset_group_id):
        """Sets the asset_group_id of this AppScanSaaSModelsV2NewWebhook.


        :param asset_group_id: The asset_group_id of this AppScanSaaSModelsV2NewWebhook.
        :type: str
        """

        self._asset_group_id = asset_group_id

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


        :return: The event of this AppScanSaaSModelsV2NewWebhook.
        :rtype: str
        """
        return self._event

    @event.setter
    def event(self, event):
        """Sets the event of this AppScanSaaSModelsV2NewWebhook.


        :param event: The event of this AppScanSaaSModelsV2NewWebhook.
        :type: str
        """
        if self._configuration.client_side_validation and event is None:
            raise ValueError("Invalid value for `event`, must not be `None`")
        allowed_values = ["ScanExecutionCompleted", "ApplicationUpdated"]
        if self._configuration.client_side_validation and event not in allowed_values:
            raise ValueError(
                f"Invalid value for `event` ({event}), must be one of {allowed_values}"
            )

        self._event = event

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

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