# coding: utf-8

"""
    Carbon DLS API

    Welcome to the Carbon DLS API docs!  You can find all relevant documentation here: https://github.com/carbon3d/carbon3d-api   # noqa: E501

    The version of the OpenAPI document: 0.4.4
    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 AutomationRun(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 = {
        'uuid': 'str',
        'customer_id': 'str',
        'created_at': 'str',
        'updated_at': 'str',
        'part_uuids': 'list[str]',
        'part_order_uuid': 'str',
        'model_uuids': 'list[str]',
        'model_sop_uuid': 'str',
        'part_sop_uuid': 'str',
        'build_sop_uuid': 'str',
        'printer_queue_sop_uuid': 'str',
        'status': 'str',
        'steps': 'list[AutomationRunSteps]'
    }

    attribute_map = {
        'uuid': 'uuid',
        'customer_id': 'customer_id',
        'created_at': 'created_at',
        'updated_at': 'updated_at',
        'part_uuids': 'part_uuids',
        'part_order_uuid': 'part_order_uuid',
        'model_uuids': 'model_uuids',
        'model_sop_uuid': 'model_sop_uuid',
        'part_sop_uuid': 'part_sop_uuid',
        'build_sop_uuid': 'build_sop_uuid',
        'printer_queue_sop_uuid': 'printer_queue_sop_uuid',
        'status': 'status',
        'steps': 'steps'
    }

    def __init__(self, uuid=None, customer_id=None, created_at=None, updated_at=None, part_uuids=None, part_order_uuid=None, model_uuids=None, model_sop_uuid=None, part_sop_uuid=None, build_sop_uuid=None, printer_queue_sop_uuid=None, status=None, steps=None, local_vars_configuration=None):  # noqa: E501
        """AutomationRun - 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._uuid = None
        self._customer_id = None
        self._created_at = None
        self._updated_at = None
        self._part_uuids = None
        self._part_order_uuid = None
        self._model_uuids = None
        self._model_sop_uuid = None
        self._part_sop_uuid = None
        self._build_sop_uuid = None
        self._printer_queue_sop_uuid = None
        self._status = None
        self._steps = None
        self.discriminator = None

        self.uuid = uuid
        if customer_id is not None:
            self.customer_id = customer_id
        if created_at is not None:
            self.created_at = created_at
        if updated_at is not None:
            self.updated_at = updated_at
        if part_uuids is not None:
            self.part_uuids = part_uuids
        if part_order_uuid is not None:
            self.part_order_uuid = part_order_uuid
        self.model_uuids = model_uuids
        if model_sop_uuid is not None:
            self.model_sop_uuid = model_sop_uuid
        if part_sop_uuid is not None:
            self.part_sop_uuid = part_sop_uuid
        if build_sop_uuid is not None:
            self.build_sop_uuid = build_sop_uuid
        if printer_queue_sop_uuid is not None:
            self.printer_queue_sop_uuid = printer_queue_sop_uuid
        if status is not None:
            self.status = status
        if steps is not None:
            self.steps = steps

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

        uuid for the automation run itself  # noqa: E501

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

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

        uuid for the automation run itself  # noqa: E501

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

        self._uuid = uuid

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

        customer id  # noqa: E501

        :return: The customer_id of this AutomationRun.  # noqa: E501
        :rtype: str
        """
        return self._customer_id

    @customer_id.setter
    def customer_id(self, customer_id):
        """Sets the customer_id of this AutomationRun.

        customer id  # noqa: E501

        :param customer_id: The customer_id of this AutomationRun.  # noqa: E501
        :type: str
        """

        self._customer_id = customer_id

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

        Create time  # noqa: E501

        :return: The created_at of this AutomationRun.  # noqa: E501
        :rtype: str
        """
        return self._created_at

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

        Create time  # noqa: E501

        :param created_at: The created_at of this AutomationRun.  # noqa: E501
        :type: str
        """

        self._created_at = created_at

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

        Update time  # noqa: E501

        :return: The updated_at of this AutomationRun.  # noqa: E501
        :rtype: str
        """
        return self._updated_at

    @updated_at.setter
    def updated_at(self, updated_at):
        """Sets the updated_at of this AutomationRun.

        Update time  # noqa: E501

        :param updated_at: The updated_at of this AutomationRun.  # noqa: E501
        :type: str
        """

        self._updated_at = updated_at

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

        uuids of created parts.  # noqa: E501

        :return: The part_uuids of this AutomationRun.  # noqa: E501
        :rtype: list[str]
        """
        return self._part_uuids

    @part_uuids.setter
    def part_uuids(self, part_uuids):
        """Sets the part_uuids of this AutomationRun.

        uuids of created parts.  # noqa: E501

        :param part_uuids: The part_uuids of this AutomationRun.  # noqa: E501
        :type: list[str]
        """

        self._part_uuids = part_uuids

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

        Part order uuid.  # noqa: E501

        :return: The part_order_uuid of this AutomationRun.  # noqa: E501
        :rtype: str
        """
        return self._part_order_uuid

    @part_order_uuid.setter
    def part_order_uuid(self, part_order_uuid):
        """Sets the part_order_uuid of this AutomationRun.

        Part order uuid.  # noqa: E501

        :param part_order_uuid: The part_order_uuid of this AutomationRun.  # noqa: E501
        :type: str
        """

        self._part_order_uuid = part_order_uuid

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

        uuids of models submitted for automation  # noqa: E501

        :return: The model_uuids of this AutomationRun.  # noqa: E501
        :rtype: list[str]
        """
        return self._model_uuids

    @model_uuids.setter
    def model_uuids(self, model_uuids):
        """Sets the model_uuids of this AutomationRun.

        uuids of models submitted for automation  # noqa: E501

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

        self._model_uuids = model_uuids

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

        uuid for a model_sop to be applied to the submitted model  # noqa: E501

        :return: The model_sop_uuid of this AutomationRun.  # noqa: E501
        :rtype: str
        """
        return self._model_sop_uuid

    @model_sop_uuid.setter
    def model_sop_uuid(self, model_sop_uuid):
        """Sets the model_sop_uuid of this AutomationRun.

        uuid for a model_sop to be applied to the submitted model  # noqa: E501

        :param model_sop_uuid: The model_sop_uuid of this AutomationRun.  # noqa: E501
        :type: str
        """

        self._model_sop_uuid = model_sop_uuid

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

        uuid for a part_sop to be applied to the submitted model  # noqa: E501

        :return: The part_sop_uuid of this AutomationRun.  # noqa: E501
        :rtype: str
        """
        return self._part_sop_uuid

    @part_sop_uuid.setter
    def part_sop_uuid(self, part_sop_uuid):
        """Sets the part_sop_uuid of this AutomationRun.

        uuid for a part_sop to be applied to the submitted model  # noqa: E501

        :param part_sop_uuid: The part_sop_uuid of this AutomationRun.  # noqa: E501
        :type: str
        """

        self._part_sop_uuid = part_sop_uuid

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

        uuid for a build_sop to be applied to the submitted model  # noqa: E501

        :return: The build_sop_uuid of this AutomationRun.  # noqa: E501
        :rtype: str
        """
        return self._build_sop_uuid

    @build_sop_uuid.setter
    def build_sop_uuid(self, build_sop_uuid):
        """Sets the build_sop_uuid of this AutomationRun.

        uuid for a build_sop to be applied to the submitted model  # noqa: E501

        :param build_sop_uuid: The build_sop_uuid of this AutomationRun.  # noqa: E501
        :type: str
        """

        self._build_sop_uuid = build_sop_uuid

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

        uuid for a printer_queue_sop to be applied to the submitted model  # noqa: E501

        :return: The printer_queue_sop_uuid of this AutomationRun.  # noqa: E501
        :rtype: str
        """
        return self._printer_queue_sop_uuid

    @printer_queue_sop_uuid.setter
    def printer_queue_sop_uuid(self, printer_queue_sop_uuid):
        """Sets the printer_queue_sop_uuid of this AutomationRun.

        uuid for a printer_queue_sop to be applied to the submitted model  # noqa: E501

        :param printer_queue_sop_uuid: The printer_queue_sop_uuid of this AutomationRun.  # noqa: E501
        :type: str
        """

        self._printer_queue_sop_uuid = printer_queue_sop_uuid

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

        Automation run status: --> submitted --> processing --> succeeded --> failed --> canceled   # noqa: E501

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

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

        Automation run status: --> submitted --> processing --> succeeded --> failed --> canceled   # noqa: E501

        :param status: The status of this AutomationRun.  # noqa: E501
        :type: str
        """
        allowed_values = ["submitted", "processing", "succeeded", "failed", "canceled"]  # 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 steps(self):
        """Gets the steps of this AutomationRun.  # noqa: E501

        List of steps taken during this automation run  # noqa: E501

        :return: The steps of this AutomationRun.  # noqa: E501
        :rtype: list[AutomationRunSteps]
        """
        return self._steps

    @steps.setter
    def steps(self, steps):
        """Sets the steps of this AutomationRun.

        List of steps taken during this automation run  # noqa: E501

        :param steps: The steps of this AutomationRun.  # noqa: E501
        :type: list[AutomationRunSteps]
        """

        self._steps = steps

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

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