# coding: utf-8

"""
    Carbon DLS API

    Welcome to the Carbon DLS API docs!   # noqa: E501

    The version of the OpenAPI document: 0.4.16
    Contact: api-list@carbon3d.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from carbon3d.configuration import Configuration


class ModelProgramRun(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 = {
        'status': 'str',
        'progress': 'float',
        'model_uuid': 'str',
        'failure_message': 'str',
        'uuid': 'str',
        'operation_status': 'list[ModelProgramOperation]'
    }

    attribute_map = {
        'status': 'status',
        'progress': 'progress',
        'model_uuid': 'model_uuid',
        'failure_message': 'failure_message',
        'uuid': 'uuid',
        'operation_status': 'operation_status'
    }

    def __init__(self, status=None, progress=None, model_uuid=None, failure_message=None, uuid=None, operation_status=None, local_vars_configuration=None):  # noqa: E501
        """ModelProgramRun - 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._status = None
        self._progress = None
        self._model_uuid = None
        self._failure_message = None
        self._uuid = None
        self._operation_status = None
        self.discriminator = None

        self.status = status
        self.progress = progress
        self.model_uuid = model_uuid
        self.failure_message = failure_message
        if uuid is not None:
            self.uuid = uuid
        self.operation_status = operation_status

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

        status of the current operation  # noqa: E501

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

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

        status of the current operation  # noqa: E501

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

        self._status = status

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

        current progress of the concerned operation as a number between 0 and 1  # noqa: E501

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

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

        current progress of the concerned operation as a number between 0 and 1  # noqa: E501

        :param progress: The progress of this ModelProgramRun.  # noqa: E501
        :type: float
        """
        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
        if (self.local_vars_configuration.client_side_validation and
                progress is not None and progress > 1):  # noqa: E501
            raise ValueError("Invalid value for `progress`, must be a value less than or equal to `1`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                progress is not None and progress < 0):  # noqa: E501
            raise ValueError("Invalid value for `progress`, must be a value greater than or equal to `0`")  # noqa: E501

        self._progress = progress

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

        uuid of the output model  # noqa: E501

        :return: The model_uuid of this ModelProgramRun.  # noqa: E501
        :rtype: str
        """
        return self._model_uuid

    @model_uuid.setter
    def model_uuid(self, model_uuid):
        """Sets the model_uuid of this ModelProgramRun.

        uuid of the output model  # noqa: E501

        :param model_uuid: The model_uuid of this ModelProgramRun.  # noqa: E501
        :type: str
        """

        self._model_uuid = model_uuid

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

        message in case of failure  # noqa: E501

        :return: The failure_message of this ModelProgramRun.  # noqa: E501
        :rtype: str
        """
        return self._failure_message

    @failure_message.setter
    def failure_message(self, failure_message):
        """Sets the failure_message of this ModelProgramRun.

        message in case of failure  # noqa: E501

        :param failure_message: The failure_message of this ModelProgramRun.  # noqa: E501
        :type: str
        """

        self._failure_message = failure_message

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

        uuid of the model program run  # noqa: E501

        :return: The uuid of this ModelProgramRun.  # noqa: E501
        :rtype: str
        """
        return self._uuid

    @uuid.setter
    def uuid(self, uuid):
        """Sets the uuid of this ModelProgramRun.

        uuid of the model program run  # noqa: E501

        :param uuid: The uuid of this ModelProgramRun.  # noqa: E501
        :type: str
        """

        self._uuid = uuid

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

        details about the statuses and outputs of named operations specified by the customer  # noqa: E501

        :return: The operation_status of this ModelProgramRun.  # noqa: E501
        :rtype: list[ModelProgramOperation]
        """
        return self._operation_status

    @operation_status.setter
    def operation_status(self, operation_status):
        """Sets the operation_status of this ModelProgramRun.

        details about the statuses and outputs of named operations specified by the customer  # noqa: E501

        :param operation_status: The operation_status of this ModelProgramRun.  # noqa: E501
        :type: list[ModelProgramOperation]
        """

        self._operation_status = operation_status

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

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