# coding: utf-8

"""
    REST API

    Rockset's REST API allows for creating and managing all resources in Rockset. Each supported endpoint is documented below.  All requests must be authorized with a Rockset API key, which can be created in the [Rockset console](https://console.rockset.com). The API key must be provided as `ApiKey <api_key>` in the `Authorization` request header. For example: ``` Authorization: ApiKey aB35kDjg93J5nsf4GjwMeErAVd832F7ad4vhsW1S02kfZiab42sTsfW5Sxt25asT ```  All endpoints are only accessible via https.  Build something awesome!  # noqa: E501

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


import pprint
import re  # noqa: F401

import six


class OperatorStats(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 = {
        'worker': 'str',
        'fragment': 'int',
        'task': 'str',
        'operator_id': 'int',
        'operator_name': 'str',
        'start_time_us': 'int',
        'end_time_us': 'int',
        'max_memory': 'int',
        'input_bytes': 'int',
        'input_rows': 'int',
        'output_bytes': 'int',
        'output_rows': 'int',
        'processing_time_us': 'int'
    }

    attribute_map = {
        'worker': 'worker',
        'fragment': 'fragment',
        'task': 'task',
        'operator_id': 'operator_id',
        'operator_name': 'operator_name',
        'start_time_us': 'start_time_us',
        'end_time_us': 'end_time_us',
        'max_memory': 'max_memory',
        'input_bytes': 'input_bytes',
        'input_rows': 'input_rows',
        'output_bytes': 'output_bytes',
        'output_rows': 'output_rows',
        'processing_time_us': 'processing_time_us'
    }

    def __init__(self, **kwargs):  # noqa: E501
        """OperatorStats - a model defined in Swagger"""  # noqa: E501

        self._worker = None
        self._fragment = None
        self._task = None
        self._operator_id = None
        self._operator_name = None
        self._start_time_us = None
        self._end_time_us = None
        self._max_memory = None
        self._input_bytes = None
        self._input_rows = None
        self._output_bytes = None
        self._output_rows = None
        self._processing_time_us = None
        self.discriminator = None

        self.worker = kwargs.pop('worker', None)
        self.fragment = kwargs.pop('fragment', None)
        self.task = kwargs.pop('task', None)
        self.operator_id = kwargs.pop('operator_id', None)
        self.operator_name = kwargs.pop('operator_name', None)
        self.start_time_us = kwargs.pop('start_time_us', None)
        self.end_time_us = kwargs.pop('end_time_us', None)
        self.max_memory = kwargs.pop('max_memory', None)
        self.input_bytes = kwargs.pop('input_bytes', None)
        self.input_rows = kwargs.pop('input_rows', None)
        self.output_bytes = kwargs.pop('output_bytes', None)
        self.output_rows = kwargs.pop('output_rows', None)
        self.processing_time_us = kwargs.pop('processing_time_us', None)

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

        The id of the worker this operator ran on  # noqa: E501

        :return: The worker of this OperatorStats.  # noqa: E501
        :rtype: str
        """
        return self._worker

    @worker.setter
    def worker(self, worker):
        """Sets the worker of this OperatorStats.

        The id of the worker this operator ran on  # noqa: E501

        :param worker: The worker of this OperatorStats.  # noqa: E501
        :type: str
        """

        self._worker = worker

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

        The id of the fragment this operator belonged to  # noqa: E501

        :return: The fragment of this OperatorStats.  # noqa: E501
        :rtype: int
        """
        return self._fragment

    @fragment.setter
    def fragment(self, fragment):
        """Sets the fragment of this OperatorStats.

        The id of the fragment this operator belonged to  # noqa: E501

        :param fragment: The fragment of this OperatorStats.  # noqa: E501
        :type: int
        """

        self._fragment = fragment

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

        The id of the task this operator belonged to  # noqa: E501

        :return: The task of this OperatorStats.  # noqa: E501
        :rtype: str
        """
        return self._task

    @task.setter
    def task(self, task):
        """Sets the task of this OperatorStats.

        The id of the task this operator belonged to  # noqa: E501

        :param task: The task of this OperatorStats.  # noqa: E501
        :type: str
        """

        self._task = task

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

        The id of this operator in the task  # noqa: E501

        :return: The operator_id of this OperatorStats.  # noqa: E501
        :rtype: int
        """
        return self._operator_id

    @operator_id.setter
    def operator_id(self, operator_id):
        """Sets the operator_id of this OperatorStats.

        The id of this operator in the task  # noqa: E501

        :param operator_id: The operator_id of this OperatorStats.  # noqa: E501
        :type: int
        """

        self._operator_id = operator_id

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

        The class name of this operator  # noqa: E501

        :return: The operator_name of this OperatorStats.  # noqa: E501
        :rtype: str
        """
        return self._operator_name

    @operator_name.setter
    def operator_name(self, operator_name):
        """Sets the operator_name of this OperatorStats.

        The class name of this operator  # noqa: E501

        :param operator_name: The operator_name of this OperatorStats.  # noqa: E501
        :type: str
        """

        self._operator_name = operator_name

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

        Microseconds since UNIX epoch of the first time data was received from any of this operator's inputs  # noqa: E501

        :return: The start_time_us of this OperatorStats.  # noqa: E501
        :rtype: int
        """
        return self._start_time_us

    @start_time_us.setter
    def start_time_us(self, start_time_us):
        """Sets the start_time_us of this OperatorStats.

        Microseconds since UNIX epoch of the first time data was received from any of this operator's inputs  # noqa: E501

        :param start_time_us: The start_time_us of this OperatorStats.  # noqa: E501
        :type: int
        """

        self._start_time_us = start_time_us

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

        Microseconds since UNIX epoch of the last time data was sent to any of this operator's outputs  # noqa: E501

        :return: The end_time_us of this OperatorStats.  # noqa: E501
        :rtype: int
        """
        return self._end_time_us

    @end_time_us.setter
    def end_time_us(self, end_time_us):
        """Sets the end_time_us of this OperatorStats.

        Microseconds since UNIX epoch of the last time data was sent to any of this operator's outputs  # noqa: E501

        :param end_time_us: The end_time_us of this OperatorStats.  # noqa: E501
        :type: int
        """

        self._end_time_us = end_time_us

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

        Maximum memory used by this operator during execution  # noqa: E501

        :return: The max_memory of this OperatorStats.  # noqa: E501
        :rtype: int
        """
        return self._max_memory

    @max_memory.setter
    def max_memory(self, max_memory):
        """Sets the max_memory of this OperatorStats.

        Maximum memory used by this operator during execution  # noqa: E501

        :param max_memory: The max_memory of this OperatorStats.  # noqa: E501
        :type: int
        """

        self._max_memory = max_memory

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

        Total bytes received across all inputs  # noqa: E501

        :return: The input_bytes of this OperatorStats.  # noqa: E501
        :rtype: int
        """
        return self._input_bytes

    @input_bytes.setter
    def input_bytes(self, input_bytes):
        """Sets the input_bytes of this OperatorStats.

        Total bytes received across all inputs  # noqa: E501

        :param input_bytes: The input_bytes of this OperatorStats.  # noqa: E501
        :type: int
        """

        self._input_bytes = input_bytes

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

        Total rows received across all inputs  # noqa: E501

        :return: The input_rows of this OperatorStats.  # noqa: E501
        :rtype: int
        """
        return self._input_rows

    @input_rows.setter
    def input_rows(self, input_rows):
        """Sets the input_rows of this OperatorStats.

        Total rows received across all inputs  # noqa: E501

        :param input_rows: The input_rows of this OperatorStats.  # noqa: E501
        :type: int
        """

        self._input_rows = input_rows

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

        Total bytes sent across all outputs  # noqa: E501

        :return: The output_bytes of this OperatorStats.  # noqa: E501
        :rtype: int
        """
        return self._output_bytes

    @output_bytes.setter
    def output_bytes(self, output_bytes):
        """Sets the output_bytes of this OperatorStats.

        Total bytes sent across all outputs  # noqa: E501

        :param output_bytes: The output_bytes of this OperatorStats.  # noqa: E501
        :type: int
        """

        self._output_bytes = output_bytes

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

        Total rows sent across all outputs  # noqa: E501

        :return: The output_rows of this OperatorStats.  # noqa: E501
        :rtype: int
        """
        return self._output_rows

    @output_rows.setter
    def output_rows(self, output_rows):
        """Sets the output_rows of this OperatorStats.

        Total rows sent across all outputs  # noqa: E501

        :param output_rows: The output_rows of this OperatorStats.  # noqa: E501
        :type: int
        """

        self._output_rows = output_rows

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

        Total time in microseconds spent doing useful work  # noqa: E501

        :return: The processing_time_us of this OperatorStats.  # noqa: E501
        :rtype: int
        """
        return self._processing_time_us

    @processing_time_us.setter
    def processing_time_us(self, processing_time_us):
        """Sets the processing_time_us of this OperatorStats.

        Total time in microseconds spent doing useful work  # noqa: E501

        :param processing_time_us: The processing_time_us of this OperatorStats.  # noqa: E501
        :type: int
        """

        self._processing_time_us = processing_time_us

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

        return self.__dict__ == other.__dict__

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

    def __getitem__(self, item):
        return getattr(self, item)

    def get(self, item):
        return getattr(self, item)

    def items(self):
        return self.to_dict().items()

    def __setitem__(self, item, value):
        return seattr(self, item, value)
