"""
    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 UtilitiesUpdateIssue:
    """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 = {"external_id": "str", "status": "str", "comment": "str"}

    attribute_map = {
        "external_id": "ExternalId",
        "status": "Status",
        "comment": "Comment",
    }

    def __init__(self, external_id=None, status=None, comment=None, _configuration=None):
        """UtilitiesUpdateIssue - a model defined in Swagger"""
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._external_id = None
        self._status = None
        self._comment = None
        self.discriminator = None

        if external_id is not None:
            self.external_id = external_id
        if status is not None:
            self.status = status
        if comment is not None:
            self.comment = comment

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


        :return: The external_id of this UtilitiesUpdateIssue.
        :rtype: str
        """
        return self._external_id

    @external_id.setter
    def external_id(self, external_id):
        """Sets the external_id of this UtilitiesUpdateIssue.


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

        self._external_id = external_id

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


        :return: The status of this UtilitiesUpdateIssue.
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this UtilitiesUpdateIssue.


        :param status: The status of this UtilitiesUpdateIssue.
        :type: str
        """
        allowed_values = [
            "Open",
            "InProgress",
            "Reopened",
            "Noise",
            "Passed",
            "Fixed",
            "New",
        ]
        if self._configuration.client_side_validation and status not in allowed_values:
            raise ValueError(
                f"Invalid value for `status` ({status}), must be one of {allowed_values}"
            )

        self._status = status

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


        :return: The comment of this UtilitiesUpdateIssue.
        :rtype: str
        """
        return self._comment

    @comment.setter
    def comment(self, comment):
        """Sets the comment of this UtilitiesUpdateIssue.


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

        self._comment = comment

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

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