# coding: utf-8

"""
    herd

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    OpenAPI spec version: 0.178.0-SNAPSHOT
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six


class Job(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 = {
        'id': 'str',
        'status': 'str',
        'namespace': 'str',
        'job_name': 'str',
        'start_time': 'datetime',
        'end_time': 'datetime',
        'current_workflow_step': 'WorkflowStep',
        'completed_workflow_steps': 'list[WorkflowStep]',
        'parameters': 'list[Parameter]',
        'activiti_job_xml': 'str',
        'workflow_errors': 'list[WorkflowError]',
        'delete_reason': 'str'
    }

    attribute_map = {
        'id': 'id',
        'status': 'status',
        'namespace': 'namespace',
        'job_name': 'jobName',
        'start_time': 'startTime',
        'end_time': 'endTime',
        'current_workflow_step': 'currentWorkflowStep',
        'completed_workflow_steps': 'completedWorkflowSteps',
        'parameters': 'parameters',
        'activiti_job_xml': 'activitiJobXml',
        'workflow_errors': 'workflowErrors',
        'delete_reason': 'deleteReason'
    }

    def __init__(self, id=None, status=None, namespace=None, job_name=None, start_time=None, end_time=None, current_workflow_step=None, completed_workflow_steps=None, parameters=None, activiti_job_xml=None, workflow_errors=None, delete_reason=None):  # noqa: E501
        """Job - a model defined in OpenAPI"""  # noqa: E501

        self._id = None
        self._status = None
        self._namespace = None
        self._job_name = None
        self._start_time = None
        self._end_time = None
        self._current_workflow_step = None
        self._completed_workflow_steps = None
        self._parameters = None
        self._activiti_job_xml = None
        self._workflow_errors = None
        self._delete_reason = None
        self.discriminator = None

        self.id = id
        if status is not None:
            self.status = status
        if namespace is not None:
            self.namespace = namespace
        if job_name is not None:
            self.job_name = job_name
        if start_time is not None:
            self.start_time = start_time
        if end_time is not None:
            self.end_time = end_time
        if current_workflow_step is not None:
            self.current_workflow_step = current_workflow_step
        if completed_workflow_steps is not None:
            self.completed_workflow_steps = completed_workflow_steps
        if parameters is not None:
            self.parameters = parameters
        if activiti_job_xml is not None:
            self.activiti_job_xml = activiti_job_xml
        if workflow_errors is not None:
            self.workflow_errors = workflow_errors
        if delete_reason is not None:
            self.delete_reason = delete_reason

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

        The internal identifier that uniquely references a job  # noqa: E501

        :return: The id of this Job.  # noqa: E501
        :rtype: str
        """
        return self._id

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

        The internal identifier that uniquely references a job  # noqa: E501

        :param id: The id of this Job.  # noqa: E501
        :type: str
        """
        if id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501

        self._id = id

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

        The status of the job. One of the following values: RUNNING, SUSPENDED, COMPLETED  # noqa: E501

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

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

        The status of the job. One of the following values: RUNNING, SUSPENDED, COMPLETED  # noqa: E501

        :param status: The status of this Job.  # noqa: E501
        :type: str
        """
        allowed_values = ["RUNNING", "SUSPENDED", "COMPLETED"]  # 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 namespace(self):
        """Gets the namespace of this Job.  # noqa: E501

        The namespace of the job  # noqa: E501

        :return: The namespace of this Job.  # noqa: E501
        :rtype: str
        """
        return self._namespace

    @namespace.setter
    def namespace(self, namespace):
        """Sets the namespace of this Job.

        The namespace of the job  # noqa: E501

        :param namespace: The namespace of this Job.  # noqa: E501
        :type: str
        """

        self._namespace = namespace

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

        The name of the job  # noqa: E501

        :return: The job_name of this Job.  # noqa: E501
        :rtype: str
        """
        return self._job_name

    @job_name.setter
    def job_name(self, job_name):
        """Sets the job_name of this Job.

        The name of the job  # noqa: E501

        :param job_name: The job_name of this Job.  # noqa: E501
        :type: str
        """

        self._job_name = job_name

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

        The start time of the job  # noqa: E501

        :return: The start_time of this Job.  # noqa: E501
        :rtype: datetime
        """
        return self._start_time

    @start_time.setter
    def start_time(self, start_time):
        """Sets the start_time of this Job.

        The start time of the job  # noqa: E501

        :param start_time: The start_time of this Job.  # noqa: E501
        :type: datetime
        """

        self._start_time = start_time

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

        The end time of the job. It is not returned for a job in RUNNING state  # noqa: E501

        :return: The end_time of this Job.  # noqa: E501
        :rtype: datetime
        """
        return self._end_time

    @end_time.setter
    def end_time(self, end_time):
        """Sets the end_time of this Job.

        The end time of the job. It is not returned for a job in RUNNING state  # noqa: E501

        :param end_time: The end_time of this Job.  # noqa: E501
        :type: datetime
        """

        self._end_time = end_time

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


        :return: The current_workflow_step of this Job.  # noqa: E501
        :rtype: WorkflowStep
        """
        return self._current_workflow_step

    @current_workflow_step.setter
    def current_workflow_step(self, current_workflow_step):
        """Sets the current_workflow_step of this Job.


        :param current_workflow_step: The current_workflow_step of this Job.  # noqa: E501
        :type: WorkflowStep
        """

        self._current_workflow_step = current_workflow_step

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

        The steps that have been completed. For a job in RUNNING state, steps up to the last Async task will be returned. For a job in                   COMPLETED state, all executed steps will be returned                  # noqa: E501

        :return: The completed_workflow_steps of this Job.  # noqa: E501
        :rtype: list[WorkflowStep]
        """
        return self._completed_workflow_steps

    @completed_workflow_steps.setter
    def completed_workflow_steps(self, completed_workflow_steps):
        """Sets the completed_workflow_steps of this Job.

        The steps that have been completed. For a job in RUNNING state, steps up to the last Async task will be returned. For a job in                   COMPLETED state, all executed steps will be returned                  # noqa: E501

        :param completed_workflow_steps: The completed_workflow_steps of this Job.  # noqa: E501
        :type: list[WorkflowStep]
        """

        self._completed_workflow_steps = completed_workflow_steps

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

        Current workflow variables and values  # noqa: E501

        :return: The parameters of this Job.  # noqa: E501
        :rtype: list[Parameter]
        """
        return self._parameters

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

        Current workflow variables and values  # noqa: E501

        :param parameters: The parameters of this Job.  # noqa: E501
        :type: list[Parameter]
        """

        self._parameters = parameters

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

        Activiti workflow XML related to the job  # noqa: E501

        :return: The activiti_job_xml of this Job.  # noqa: E501
        :rtype: str
        """
        return self._activiti_job_xml

    @activiti_job_xml.setter
    def activiti_job_xml(self, activiti_job_xml):
        """Sets the activiti_job_xml of this Job.

        Activiti workflow XML related to the job  # noqa: E501

        :param activiti_job_xml: The activiti_job_xml of this Job.  # noqa: E501
        :type: str
        """

        self._activiti_job_xml = activiti_job_xml

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

        The workflow errors  # noqa: E501

        :return: The workflow_errors of this Job.  # noqa: E501
        :rtype: list[WorkflowError]
        """
        return self._workflow_errors

    @workflow_errors.setter
    def workflow_errors(self, workflow_errors):
        """Sets the workflow_errors of this Job.

        The workflow errors  # noqa: E501

        :param workflow_errors: The workflow_errors of this Job.  # noqa: E501
        :type: list[WorkflowError]
        """

        self._workflow_errors = workflow_errors

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

        A reason this job has been deleted. It is returned if the job has been deleted  # noqa: E501

        :return: The delete_reason of this Job.  # noqa: E501
        :rtype: str
        """
        return self._delete_reason

    @delete_reason.setter
    def delete_reason(self, delete_reason):
        """Sets the delete_reason of this Job.

        A reason this job has been deleted. It is returned if the job has been deleted  # noqa: E501

        :param delete_reason: The delete_reason of this Job.  # noqa: E501
        :type: str
        """

        self._delete_reason = delete_reason

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

        return self.__dict__ == other.__dict__

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