# coding: utf-8

"""
    Harbor API

    These APIs provide services for manipulating Harbor project.  # noqa: E501

    OpenAPI spec version: 2.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from harbor_client.configuration import Configuration


class CVEAllowlist(object):
    """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 = {
        'id': 'int',
        'project_id': 'int',
        'expires_at': 'int',
        'items': 'list[CVEAllowlistItem]',
        'creation_time': 'datetime',
        'update_time': 'datetime'
    }

    attribute_map = {
        'id': 'id',
        'project_id': 'project_id',
        'expires_at': 'expires_at',
        'items': 'items',
        'creation_time': 'creation_time',
        'update_time': 'update_time'
    }

    def __init__(self, id=None, project_id=None, expires_at=None, items=None, creation_time=None, update_time=None, _configuration=None):  # noqa: E501
        """CVEAllowlist - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._id = None
        self._project_id = None
        self._expires_at = None
        self._items = None
        self._creation_time = None
        self._update_time = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if project_id is not None:
            self.project_id = project_id
        if expires_at is not None:
            self.expires_at = expires_at
        if items is not None:
            self.items = items
        if creation_time is not None:
            self.creation_time = creation_time
        if update_time is not None:
            self.update_time = update_time

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

        ID of the allowlist  # noqa: E501

        :return: The id of this CVEAllowlist.  # noqa: E501
        :rtype: int
        """
        return self._id

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

        ID of the allowlist  # noqa: E501

        :param id: The id of this CVEAllowlist.  # noqa: E501
        :type: int
        """

        self._id = id

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

        ID of the project which the allowlist belongs to.  For system level allowlist this attribute is zero.  # noqa: E501

        :return: The project_id of this CVEAllowlist.  # noqa: E501
        :rtype: int
        """
        return self._project_id

    @project_id.setter
    def project_id(self, project_id):
        """Sets the project_id of this CVEAllowlist.

        ID of the project which the allowlist belongs to.  For system level allowlist this attribute is zero.  # noqa: E501

        :param project_id: The project_id of this CVEAllowlist.  # noqa: E501
        :type: int
        """

        self._project_id = project_id

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

        the time for expiration of the allowlist, in the form of seconds since epoch.  This is an optional attribute, if it's not set the CVE allowlist does not expire.  # noqa: E501

        :return: The expires_at of this CVEAllowlist.  # noqa: E501
        :rtype: int
        """
        return self._expires_at

    @expires_at.setter
    def expires_at(self, expires_at):
        """Sets the expires_at of this CVEAllowlist.

        the time for expiration of the allowlist, in the form of seconds since epoch.  This is an optional attribute, if it's not set the CVE allowlist does not expire.  # noqa: E501

        :param expires_at: The expires_at of this CVEAllowlist.  # noqa: E501
        :type: int
        """

        self._expires_at = expires_at

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


        :return: The items of this CVEAllowlist.  # noqa: E501
        :rtype: list[CVEAllowlistItem]
        """
        return self._items

    @items.setter
    def items(self, items):
        """Sets the items of this CVEAllowlist.


        :param items: The items of this CVEAllowlist.  # noqa: E501
        :type: list[CVEAllowlistItem]
        """

        self._items = items

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

        The creation time of the allowlist.  # noqa: E501

        :return: The creation_time of this CVEAllowlist.  # noqa: E501
        :rtype: datetime
        """
        return self._creation_time

    @creation_time.setter
    def creation_time(self, creation_time):
        """Sets the creation_time of this CVEAllowlist.

        The creation time of the allowlist.  # noqa: E501

        :param creation_time: The creation_time of this CVEAllowlist.  # noqa: E501
        :type: datetime
        """

        self._creation_time = creation_time

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

        The update time of the allowlist.  # noqa: E501

        :return: The update_time of this CVEAllowlist.  # noqa: E501
        :rtype: datetime
        """
        return self._update_time

    @update_time.setter
    def update_time(self, update_time):
        """Sets the update_time of this CVEAllowlist.

        The update time of the allowlist.  # noqa: E501

        :param update_time: The update_time of this CVEAllowlist.  # noqa: E501
        :type: datetime
        """

        self._update_time = update_time

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

        for attr, _ in six.iteritems(self.swagger_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
        if issubclass(CVEAllowlist, 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, CVEAllowlist):
            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, CVEAllowlist):
            return True

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