# coding: utf-8

"""
    ThingsBoard REST API

     ThingsBoard open-source IoT platform REST API documentation.  # noqa: E501

    OpenAPI spec version: 4.1.0
    Contact: info@thingsboard.io
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six


class JobResult(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 = {
        'successful_count': 'int',
        'failed_count': 'int',
        'discarded_count': 'int',
        'total_count': 'int',
        'results': 'list[str]',
        'general_error': 'str',
        'start_ts': 'int',
        'finish_ts': 'int',
        'cancellation_ts': 'int',
        'job_type': 'str'
    }

    attribute_map = {
        'successful_count': 'successfulCount',
        'failed_count': 'failedCount',
        'discarded_count': 'discardedCount',
        'total_count': 'totalCount',
        'results': 'results',
        'general_error': 'generalError',
        'start_ts': 'startTs',
        'finish_ts': 'finishTs',
        'cancellation_ts': 'cancellationTs',
        'job_type': 'jobType'
    }

    discriminator_value_class_map = {
              }

    def __init__(self, successful_count=None, failed_count=None, discarded_count=None, total_count=None, results=None, general_error=None, start_ts=None, finish_ts=None, cancellation_ts=None, job_type=None):  # noqa: E501
        """JobResult - a model defined in Swagger"""  # noqa: E501
        self._successful_count = None
        self._failed_count = None
        self._discarded_count = None
        self._total_count = None
        self._results = None
        self._general_error = None
        self._start_ts = None
        self._finish_ts = None
        self._cancellation_ts = None
        self._job_type = None
        self.discriminator = 'jobType'
        if successful_count is not None:
            self.successful_count = successful_count
        if failed_count is not None:
            self.failed_count = failed_count
        if discarded_count is not None:
            self.discarded_count = discarded_count
        if total_count is not None:
            self.total_count = total_count
        if results is not None:
            self.results = results
        if general_error is not None:
            self.general_error = general_error
        if start_ts is not None:
            self.start_ts = start_ts
        if finish_ts is not None:
            self.finish_ts = finish_ts
        if cancellation_ts is not None:
            self.cancellation_ts = cancellation_ts
        self.job_type = job_type

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


        :return: The successful_count of this JobResult.  # noqa: E501
        :rtype: object
        """
        return self._successful_count

    @successful_count.setter
    def successful_count(self, successful_count):
        """Sets the successful_count of this JobResult.


        :param successful_count: The successful_count of this JobResult.  # noqa: E501
        :type: object
        """

        self._successful_count = successful_count

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


        :return: The failed_count of this JobResult.  # noqa: E501
        :rtype: object
        """
        return self._failed_count

    @failed_count.setter
    def failed_count(self, failed_count):
        """Sets the failed_count of this JobResult.


        :param failed_count: The failed_count of this JobResult.  # noqa: E501
        :type: object
        """

        self._failed_count = failed_count

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


        :return: The discarded_count of this JobResult.  # noqa: E501
        :rtype: object
        """
        return self._discarded_count

    @discarded_count.setter
    def discarded_count(self, discarded_count):
        """Sets the discarded_count of this JobResult.


        :param discarded_count: The discarded_count of this JobResult.  # noqa: E501
        :type: object
        """

        self._discarded_count = discarded_count

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


        :return: The total_count of this JobResult.  # noqa: E501
        :rtype: object
        """
        return self._total_count

    @total_count.setter
    def total_count(self, total_count):
        """Sets the total_count of this JobResult.


        :param total_count: The total_count of this JobResult.  # noqa: E501
        :type: object
        """

        self._total_count = total_count

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


        :return: The results of this JobResult.  # noqa: E501
        :rtype: object
        """
        return self._results

    @results.setter
    def results(self, results):
        """Sets the results of this JobResult.


        :param results: The results of this JobResult.  # noqa: E501
        :type: object
        """

        self._results = results

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


        :return: The general_error of this JobResult.  # noqa: E501
        :rtype: object
        """
        return self._general_error

    @general_error.setter
    def general_error(self, general_error):
        """Sets the general_error of this JobResult.


        :param general_error: The general_error of this JobResult.  # noqa: E501
        :type: object
        """

        self._general_error = general_error

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


        :return: The start_ts of this JobResult.  # noqa: E501
        :rtype: object
        """
        return self._start_ts

    @start_ts.setter
    def start_ts(self, start_ts):
        """Sets the start_ts of this JobResult.


        :param start_ts: The start_ts of this JobResult.  # noqa: E501
        :type: object
        """

        self._start_ts = start_ts

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


        :return: The finish_ts of this JobResult.  # noqa: E501
        :rtype: object
        """
        return self._finish_ts

    @finish_ts.setter
    def finish_ts(self, finish_ts):
        """Sets the finish_ts of this JobResult.


        :param finish_ts: The finish_ts of this JobResult.  # noqa: E501
        :type: object
        """

        self._finish_ts = finish_ts

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


        :return: The cancellation_ts of this JobResult.  # noqa: E501
        :rtype: object
        """
        return self._cancellation_ts

    @cancellation_ts.setter
    def cancellation_ts(self, cancellation_ts):
        """Sets the cancellation_ts of this JobResult.


        :param cancellation_ts: The cancellation_ts of this JobResult.  # noqa: E501
        :type: object
        """

        self._cancellation_ts = cancellation_ts

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


        :return: The job_type of this JobResult.  # noqa: E501
        :rtype: object
        """
        return self._job_type

    @job_type.setter
    def job_type(self, job_type):
        """Sets the job_type of this JobResult.


        :param job_type: The job_type of this JobResult.  # noqa: E501
        :type: object
        """
        if job_type is None:
            raise ValueError("Invalid value for `job_type`, must not be `None`")  # noqa: E501

        self._job_type = job_type

    def get_real_child_model(self, data):
        """Returns the real base class specified by the discriminator"""
        discriminator_value = data[self.discriminator].lower()
        return self.discriminator_value_class_map.get(discriminator_value)

    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(JobResult, 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, JobResult):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        return not self == other
