# 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 Stats(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 = {
        'total': 'int',
        'completed': 'int',
        'metrics': 'dict(str, int)',
        'ongoing': 'bool',
        'trigger': 'str'
    }

    attribute_map = {
        'total': 'total',
        'completed': 'completed',
        'metrics': 'metrics',
        'ongoing': 'ongoing',
        'trigger': 'trigger'
    }

    def __init__(self, total=None, completed=None, metrics=None, ongoing=None, trigger=None, _configuration=None):  # noqa: E501
        """Stats - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._total = None
        self._completed = None
        self._metrics = None
        self._ongoing = None
        self._trigger = None
        self.discriminator = None

        if total is not None:
            self.total = total
        if completed is not None:
            self.completed = completed
        if metrics is not None:
            self.metrics = metrics
        if ongoing is not None:
            self.ongoing = ongoing
        if trigger is not None:
            self.trigger = trigger

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

        The total number of scan processes triggered by the scan all action  # noqa: E501

        :return: The total of this Stats.  # noqa: E501
        :rtype: int
        """
        return self._total

    @total.setter
    def total(self, total):
        """Sets the total of this Stats.

        The total number of scan processes triggered by the scan all action  # noqa: E501

        :param total: The total of this Stats.  # noqa: E501
        :type: int
        """

        self._total = total

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

        The number of the finished scan processes triggered by the scan all action  # noqa: E501

        :return: The completed of this Stats.  # noqa: E501
        :rtype: int
        """
        return self._completed

    @completed.setter
    def completed(self, completed):
        """Sets the completed of this Stats.

        The number of the finished scan processes triggered by the scan all action  # noqa: E501

        :param completed: The completed of this Stats.  # noqa: E501
        :type: int
        """

        self._completed = completed

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

        The metrics data for the each status  # noqa: E501

        :return: The metrics of this Stats.  # noqa: E501
        :rtype: dict(str, int)
        """
        return self._metrics

    @metrics.setter
    def metrics(self, metrics):
        """Sets the metrics of this Stats.

        The metrics data for the each status  # noqa: E501

        :param metrics: The metrics of this Stats.  # noqa: E501
        :type: dict(str, int)
        """

        self._metrics = metrics

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

        A flag indicating job status of scan all.  # noqa: E501

        :return: The ongoing of this Stats.  # noqa: E501
        :rtype: bool
        """
        return self._ongoing

    @ongoing.setter
    def ongoing(self, ongoing):
        """Sets the ongoing of this Stats.

        A flag indicating job status of scan all.  # noqa: E501

        :param ongoing: The ongoing of this Stats.  # noqa: E501
        :type: bool
        """

        self._ongoing = ongoing

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

        The trigger of the scan all job.  # noqa: E501

        :return: The trigger of this Stats.  # noqa: E501
        :rtype: str
        """
        return self._trigger

    @trigger.setter
    def trigger(self, trigger):
        """Sets the trigger of this Stats.

        The trigger of the scan all job.  # noqa: E501

        :param trigger: The trigger of this Stats.  # noqa: E501
        :type: str
        """
        allowed_values = ["Manual", "Schedule", "Event"]  # noqa: E501
        if (self._configuration.client_side_validation and
                trigger not in allowed_values):
            raise ValueError(
                "Invalid value for `trigger` ({0}), must be one of {1}"  # noqa: E501
                .format(trigger, allowed_values)
            )

        self._trigger = trigger

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

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