# coding: utf-8

"""
    Managed Ray API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 0.1.0
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from openapi_client.configuration import Configuration


class DatasetMetrics(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'id': 'str',
        'name': 'str',
        'job_id': 'str',
        'session_name': 'str',
        'state': 'DatasetState',
        'progress': 'int',
        'total': 'int',
        'start_time': 'float',
        'end_time': 'float',
        'operator_metrics': 'list[OperatorMetrics]',
        'metrics': 'dict(str, Metric)'
    }

    attribute_map = {
        'id': 'id',
        'name': 'name',
        'job_id': 'job_id',
        'session_name': 'session_name',
        'state': 'state',
        'progress': 'progress',
        'total': 'total',
        'start_time': 'start_time',
        'end_time': 'end_time',
        'operator_metrics': 'operator_metrics',
        'metrics': 'metrics'
    }

    def __init__(self, id=None, name=None, job_id=None, session_name=None, state=None, progress=None, total=None, start_time=None, end_time=None, operator_metrics=None, metrics=None, local_vars_configuration=None):  # noqa: E501
        """DatasetMetrics - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._id = None
        self._name = None
        self._job_id = None
        self._session_name = None
        self._state = None
        self._progress = None
        self._total = None
        self._start_time = None
        self._end_time = None
        self._operator_metrics = None
        self._metrics = None
        self.discriminator = None

        self.id = id
        self.name = name
        self.job_id = job_id
        self.session_name = session_name
        self.state = state
        self.progress = progress
        if total is not None:
            self.total = total
        self.start_time = start_time
        if end_time is not None:
            self.end_time = end_time
        self.operator_metrics = operator_metrics
        self.metrics = metrics

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


        :return: The id of this DatasetMetrics.  # noqa: E501
        :rtype: str
        """
        return self._id

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


        :param id: The id of this DatasetMetrics.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and id is None:  # noqa: E501
            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501

        self._id = id

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


        :return: The name of this DatasetMetrics.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this DatasetMetrics.


        :param name: The name of this DatasetMetrics.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and name is None:  # noqa: E501
            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501

        self._name = name

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


        :return: The job_id of this DatasetMetrics.  # noqa: E501
        :rtype: str
        """
        return self._job_id

    @job_id.setter
    def job_id(self, job_id):
        """Sets the job_id of this DatasetMetrics.


        :param job_id: The job_id of this DatasetMetrics.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and job_id is None:  # noqa: E501
            raise ValueError("Invalid value for `job_id`, must not be `None`")  # noqa: E501

        self._job_id = job_id

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


        :return: The session_name of this DatasetMetrics.  # noqa: E501
        :rtype: str
        """
        return self._session_name

    @session_name.setter
    def session_name(self, session_name):
        """Sets the session_name of this DatasetMetrics.


        :param session_name: The session_name of this DatasetMetrics.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and session_name is None:  # noqa: E501
            raise ValueError("Invalid value for `session_name`, must not be `None`")  # noqa: E501

        self._session_name = session_name

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


        :return: The state of this DatasetMetrics.  # noqa: E501
        :rtype: DatasetState
        """
        return self._state

    @state.setter
    def state(self, state):
        """Sets the state of this DatasetMetrics.


        :param state: The state of this DatasetMetrics.  # noqa: E501
        :type: DatasetState
        """
        if self.local_vars_configuration.client_side_validation and state is None:  # noqa: E501
            raise ValueError("Invalid value for `state`, must not be `None`")  # noqa: E501

        self._state = state

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


        :return: The progress of this DatasetMetrics.  # noqa: E501
        :rtype: int
        """
        return self._progress

    @progress.setter
    def progress(self, progress):
        """Sets the progress of this DatasetMetrics.


        :param progress: The progress of this DatasetMetrics.  # noqa: E501
        :type: int
        """
        if self.local_vars_configuration.client_side_validation and progress is None:  # noqa: E501
            raise ValueError("Invalid value for `progress`, must not be `None`")  # noqa: E501

        self._progress = progress

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


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

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


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

        self._total = total

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


        :return: The start_time of this DatasetMetrics.  # noqa: E501
        :rtype: float
        """
        return self._start_time

    @start_time.setter
    def start_time(self, start_time):
        """Sets the start_time of this DatasetMetrics.


        :param start_time: The start_time of this DatasetMetrics.  # noqa: E501
        :type: float
        """
        if self.local_vars_configuration.client_side_validation and start_time is None:  # noqa: E501
            raise ValueError("Invalid value for `start_time`, must not be `None`")  # noqa: E501

        self._start_time = start_time

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


        :return: The end_time of this DatasetMetrics.  # noqa: E501
        :rtype: float
        """
        return self._end_time

    @end_time.setter
    def end_time(self, end_time):
        """Sets the end_time of this DatasetMetrics.


        :param end_time: The end_time of this DatasetMetrics.  # noqa: E501
        :type: float
        """

        self._end_time = end_time

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


        :return: The operator_metrics of this DatasetMetrics.  # noqa: E501
        :rtype: list[OperatorMetrics]
        """
        return self._operator_metrics

    @operator_metrics.setter
    def operator_metrics(self, operator_metrics):
        """Sets the operator_metrics of this DatasetMetrics.


        :param operator_metrics: The operator_metrics of this DatasetMetrics.  # noqa: E501
        :type: list[OperatorMetrics]
        """
        if self.local_vars_configuration.client_side_validation and operator_metrics is None:  # noqa: E501
            raise ValueError("Invalid value for `operator_metrics`, must not be `None`")  # noqa: E501

        self._operator_metrics = operator_metrics

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


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

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


        :param metrics: The metrics of this DatasetMetrics.  # noqa: E501
        :type: dict(str, Metric)
        """
        if self.local_vars_configuration.client_side_validation and metrics is None:  # noqa: E501
            raise ValueError("Invalid value for `metrics`, must not be `None`")  # noqa: E501

        self._metrics = metrics

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

        for attr, _ in six.iteritems(self.openapi_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

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

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