# coding: utf-8

"""
    Algorithmia Management APIs

    APIs for managing actions on the Algorithmia platform  # noqa: E501

    The version of the OpenAPI document: 1.0.1
    Contact: support@algorithmia.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from algorithmia_api_client.configuration import Configuration


class FullUsageRow(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 = {
        'algorithm_called': 'str',
        'caller': 'str',
        'algorithm_version': 'str',
        'total_calls': 'str',
        'algorithm_owner': 'str',
        'total_errors': 'int',
        'total_error_duration': 'int',
        'total_duration': 'int',
        'machine_type': 'str'
    }

    attribute_map = {
        'algorithm_called': 'algorithm_called',
        'caller': 'caller',
        'algorithm_version': 'algorithm_version',
        'total_calls': 'total_calls',
        'algorithm_owner': 'algorithm_owner',
        'total_errors': 'total_errors',
        'total_error_duration': 'total_error_duration',
        'total_duration': 'total_duration',
        'machine_type': 'machine_type'
    }

    def __init__(self, algorithm_called=None, caller=None, algorithm_version=None, total_calls=None, algorithm_owner=None, total_errors=None, total_error_duration=None, total_duration=None, machine_type=None, local_vars_configuration=None):  # noqa: E501
        """FullUsageRow - 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._algorithm_called = None
        self._caller = None
        self._algorithm_version = None
        self._total_calls = None
        self._algorithm_owner = None
        self._total_errors = None
        self._total_error_duration = None
        self._total_duration = None
        self._machine_type = None
        self.discriminator = None

        self.algorithm_called = algorithm_called
        self.caller = caller
        self.algorithm_version = algorithm_version
        self.total_calls = total_calls
        self.algorithm_owner = algorithm_owner
        self.total_errors = total_errors
        self.total_error_duration = total_error_duration
        self.total_duration = total_duration
        self.machine_type = machine_type

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


        :return: The algorithm_called of this FullUsageRow.  # noqa: E501
        :rtype: str
        """
        return self._algorithm_called

    @algorithm_called.setter
    def algorithm_called(self, algorithm_called):
        """Sets the algorithm_called of this FullUsageRow.


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

        self._algorithm_called = algorithm_called

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


        :return: The caller of this FullUsageRow.  # noqa: E501
        :rtype: str
        """
        return self._caller

    @caller.setter
    def caller(self, caller):
        """Sets the caller of this FullUsageRow.


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

        self._caller = caller

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


        :return: The algorithm_version of this FullUsageRow.  # noqa: E501
        :rtype: str
        """
        return self._algorithm_version

    @algorithm_version.setter
    def algorithm_version(self, algorithm_version):
        """Sets the algorithm_version of this FullUsageRow.


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

        self._algorithm_version = algorithm_version

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


        :return: The total_calls of this FullUsageRow.  # noqa: E501
        :rtype: str
        """
        return self._total_calls

    @total_calls.setter
    def total_calls(self, total_calls):
        """Sets the total_calls of this FullUsageRow.


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

        self._total_calls = total_calls

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


        :return: The algorithm_owner of this FullUsageRow.  # noqa: E501
        :rtype: str
        """
        return self._algorithm_owner

    @algorithm_owner.setter
    def algorithm_owner(self, algorithm_owner):
        """Sets the algorithm_owner of this FullUsageRow.


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

        self._algorithm_owner = algorithm_owner

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


        :return: The total_errors of this FullUsageRow.  # noqa: E501
        :rtype: int
        """
        return self._total_errors

    @total_errors.setter
    def total_errors(self, total_errors):
        """Sets the total_errors of this FullUsageRow.


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

        self._total_errors = total_errors

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


        :return: The total_error_duration of this FullUsageRow.  # noqa: E501
        :rtype: int
        """
        return self._total_error_duration

    @total_error_duration.setter
    def total_error_duration(self, total_error_duration):
        """Sets the total_error_duration of this FullUsageRow.


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

        self._total_error_duration = total_error_duration

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


        :return: The total_duration of this FullUsageRow.  # noqa: E501
        :rtype: int
        """
        return self._total_duration

    @total_duration.setter
    def total_duration(self, total_duration):
        """Sets the total_duration of this FullUsageRow.


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

        self._total_duration = total_duration

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


        :return: The machine_type of this FullUsageRow.  # noqa: E501
        :rtype: str
        """
        return self._machine_type

    @machine_type.setter
    def machine_type(self, machine_type):
        """Sets the machine_type of this FullUsageRow.


        :param machine_type: The machine_type of this FullUsageRow.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and machine_type is None:  # noqa: E501
            raise ValueError("Invalid value for `machine_type`, must not be `None`")  # noqa: E501
        allowed_values = ["cpu", "gpu"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and machine_type not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `machine_type` ({0}), must be one of {1}"  # noqa: E501
                .format(machine_type, allowed_values)
            )

        self._machine_type = machine_type

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

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