# coding: utf-8

"""
    shado-python-client

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from shado_client.models.object_id import ObjectID  # noqa: F401,E501


class PluginInstance(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 = {
        'created_at': 'datetime',
        'description': 'str',
        'error': 'object',
        'finished_at': 'datetime',
        'name': 'str',
        'parameters': 'object',
        'progress': 'float',
        'results': 'object',
        'started_at': 'datetime',
        'status': 'str',
        'type': 'str',
        'id': 'ObjectID',
        'owner_id': 'ObjectID',
        'plugin_id': 'ObjectID'
    }

    attribute_map = {
        'created_at': 'createdAt',
        'description': 'description',
        'error': 'error',
        'finished_at': 'finishedAt',
        'name': 'name',
        'parameters': 'parameters',
        'progress': 'progress',
        'results': 'results',
        'started_at': 'startedAt',
        'status': 'status',
        'type': 'type',
        'id': 'id',
        'owner_id': 'ownerId',
        'plugin_id': 'pluginId'
    }

    def __init__(self, created_at=None, description=None, error=None, finished_at=None, name=None, parameters=None, progress=0.0, results=None, started_at=None, status='queued', type='cpu', id=None, owner_id=None, plugin_id=None):  # noqa: E501
        """PluginInstance - a model defined in Swagger"""  # noqa: E501

        self._created_at = None
        self._description = None
        self._error = None
        self._finished_at = None
        self._name = None
        self._parameters = None
        self._progress = None
        self._results = None
        self._started_at = None
        self._status = None
        self._type = None
        self._id = None
        self._owner_id = None
        self._plugin_id = None
        self.discriminator = None

        if created_at is not None:
            self.created_at = created_at
        if description is not None:
            self.description = description
        if error is not None:
            self.error = error
        if finished_at is not None:
            self.finished_at = finished_at
        if name is not None:
            self.name = name
        if parameters is not None:
            self.parameters = parameters
        if progress is not None:
            self.progress = progress
        if results is not None:
            self.results = results
        if started_at is not None:
            self.started_at = started_at
        if status is not None:
            self.status = status
        if type is not None:
            self.type = type
        if id is not None:
            self.id = id
        if owner_id is not None:
            self.owner_id = owner_id
        if plugin_id is not None:
            self.plugin_id = plugin_id

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


        :return: The created_at of this PluginInstance.  # noqa: E501
        :rtype: datetime
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at):
        """Sets the created_at of this PluginInstance.


        :param created_at: The created_at of this PluginInstance.  # noqa: E501
        :type: datetime
        """

        self._created_at = created_at

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


        :return: The description of this PluginInstance.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this PluginInstance.


        :param description: The description of this PluginInstance.  # noqa: E501
        :type: str
        """

        self._description = description

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


        :return: The error of this PluginInstance.  # noqa: E501
        :rtype: object
        """
        return self._error

    @error.setter
    def error(self, error):
        """Sets the error of this PluginInstance.


        :param error: The error of this PluginInstance.  # noqa: E501
        :type: object
        """

        self._error = error

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


        :return: The finished_at of this PluginInstance.  # noqa: E501
        :rtype: datetime
        """
        return self._finished_at

    @finished_at.setter
    def finished_at(self, finished_at):
        """Sets the finished_at of this PluginInstance.


        :param finished_at: The finished_at of this PluginInstance.  # noqa: E501
        :type: datetime
        """

        self._finished_at = finished_at

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


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

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


        :param name: The name of this PluginInstance.  # noqa: E501
        :type: str
        """

        self._name = name

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


        :return: The parameters of this PluginInstance.  # noqa: E501
        :rtype: object
        """
        return self._parameters

    @parameters.setter
    def parameters(self, parameters):
        """Sets the parameters of this PluginInstance.


        :param parameters: The parameters of this PluginInstance.  # noqa: E501
        :type: object
        """

        self._parameters = parameters

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


        :return: The progress of this PluginInstance.  # noqa: E501
        :rtype: float
        """
        return self._progress

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


        :param progress: The progress of this PluginInstance.  # noqa: E501
        :type: float
        """

        self._progress = progress

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


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

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


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

        self._results = results

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


        :return: The started_at of this PluginInstance.  # noqa: E501
        :rtype: datetime
        """
        return self._started_at

    @started_at.setter
    def started_at(self, started_at):
        """Sets the started_at of this PluginInstance.


        :param started_at: The started_at of this PluginInstance.  # noqa: E501
        :type: datetime
        """

        self._started_at = started_at

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


        :return: The status of this PluginInstance.  # noqa: E501
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this PluginInstance.


        :param status: The status of this PluginInstance.  # noqa: E501
        :type: str
        """
        allowed_values = ["queued", "started", "finished", "failed"]  # noqa: E501
        if status not in allowed_values:
            raise ValueError(
                "Invalid value for `status` ({0}), must be one of {1}"  # noqa: E501
                .format(status, allowed_values)
            )

        self._status = status

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


        :return: The type of this PluginInstance.  # noqa: E501
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this PluginInstance.


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

        self._type = type

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


        :return: The id of this PluginInstance.  # noqa: E501
        :rtype: ObjectID
        """
        return self._id

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


        :param id: The id of this PluginInstance.  # noqa: E501
        :type: ObjectID
        """

        self._id = id

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


        :return: The owner_id of this PluginInstance.  # noqa: E501
        :rtype: ObjectID
        """
        return self._owner_id

    @owner_id.setter
    def owner_id(self, owner_id):
        """Sets the owner_id of this PluginInstance.


        :param owner_id: The owner_id of this PluginInstance.  # noqa: E501
        :type: ObjectID
        """

        self._owner_id = owner_id

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


        :return: The plugin_id of this PluginInstance.  # noqa: E501
        :rtype: ObjectID
        """
        return self._plugin_id

    @plugin_id.setter
    def plugin_id(self, plugin_id):
        """Sets the plugin_id of this PluginInstance.


        :param plugin_id: The plugin_id of this PluginInstance.  # noqa: E501
        :type: ObjectID
        """

        self._plugin_id = plugin_id

    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

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

        return self.__dict__ == other.__dict__

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