# coding: utf-8

"""
    MMP Metadata

    This is a API for MMP Metadata  # noqa: E501

    The version of the OpenAPI document: 1.0.0-oas3
    Contact: st116848@stud.uni-stuttgart.de.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six


class Execution(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',
        'name': 'str',
        'version': 'str',
        'kind': 'str',
        'executable': 'Executable',
        'start_time': 'datetime',
        'end_time': 'datetime',
        'status': 'str',
        'input_artifacts': 'list[Artifact]',
        'output_artifacts': 'list[Artifact]',
        'configuration': 'dict(str, str)',
        'successors': 'list[Execution]',
        'annotations': 'dict(str, str)'
    }

    attribute_map = {
        'id': 'id',
        'name': 'name',
        'version': 'version',
        'kind': 'kind',
        'executable': 'executable',
        'start_time': 'startTime',
        'end_time': 'endTime',
        'status': 'status',
        'input_artifacts': 'inputArtifacts',
        'output_artifacts': 'outputArtifacts',
        'configuration': 'configuration',
        'successors': 'successors',
        'annotations': 'annotations'
    }

    def __init__(self, id=None, name=None, version=None, kind=None, executable=None, start_time=None, end_time=None, status=None, input_artifacts=None, output_artifacts=None, configuration=None, successors=None, annotations=None):  # noqa: E501
        """Execution - a model defined in OpenAPI"""  # noqa: E501

        self._id = None
        self._name = None
        self._version = None
        self._kind = None
        self._executable = None
        self._start_time = None
        self._end_time = None
        self._status = None
        self._input_artifacts = None
        self._output_artifacts = None
        self._configuration = None
        self._successors = None
        self._annotations = None
        self.discriminator = None

        if id is not None:
            self.id = id
        self.name = name
        self.version = version
        self.kind = kind
        if executable is not None:
            self.executable = executable
        if start_time is not None:
            self.start_time = start_time
        if end_time is not None:
            self.end_time = end_time
        if status is not None:
            self.status = status
        if input_artifacts is not None:
            self.input_artifacts = input_artifacts
        if output_artifacts is not None:
            self.output_artifacts = output_artifacts
        if configuration is not None:
            self.configuration = configuration
        if successors is not None:
            self.successors = successors
        if annotations is not None:
            self.annotations = annotations

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


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

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


        :param id: The id of this Execution.  # noqa: E501
        :type: str
        """

        self._id = id

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


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

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


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

        self._name = name

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


        :return: The version of this Execution.  # noqa: E501
        :rtype: str
        """
        return self._version

    @version.setter
    def version(self, version):
        """Sets the version of this Execution.


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

        self._version = version

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


        :return: The kind of this Execution.  # noqa: E501
        :rtype: str
        """
        return self._kind

    @kind.setter
    def kind(self, kind):
        """Sets the kind of this Execution.


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

        self._kind = kind

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


        :return: The executable of this Execution.  # noqa: E501
        :rtype: Executable
        """
        return self._executable

    @executable.setter
    def executable(self, executable):
        """Sets the executable of this Execution.


        :param executable: The executable of this Execution.  # noqa: E501
        :type: Executable
        """

        self._executable = executable

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


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

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


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

        self._start_time = start_time

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


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

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


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

        self._end_time = end_time

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


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

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


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


        :return: The input_artifacts of this Execution.  # noqa: E501
        :rtype: list[Artifact]
        """
        return self._input_artifacts

    @input_artifacts.setter
    def input_artifacts(self, input_artifacts):
        """Sets the input_artifacts of this Execution.


        :param input_artifacts: The input_artifacts of this Execution.  # noqa: E501
        :type: list[Artifact]
        """

        self._input_artifacts = input_artifacts

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


        :return: The output_artifacts of this Execution.  # noqa: E501
        :rtype: list[Artifact]
        """
        return self._output_artifacts

    @output_artifacts.setter
    def output_artifacts(self, output_artifacts):
        """Sets the output_artifacts of this Execution.


        :param output_artifacts: The output_artifacts of this Execution.  # noqa: E501
        :type: list[Artifact]
        """

        self._output_artifacts = output_artifacts

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


        :return: The configuration of this Execution.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._configuration

    @configuration.setter
    def configuration(self, configuration):
        """Sets the configuration of this Execution.


        :param configuration: The configuration of this Execution.  # noqa: E501
        :type: dict(str, str)
        """

        self._configuration = configuration

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


        :return: The successors of this Execution.  # noqa: E501
        :rtype: list[Execution]
        """
        return self._successors

    @successors.setter
    def successors(self, successors):
        """Sets the successors of this Execution.


        :param successors: The successors of this Execution.  # noqa: E501
        :type: list[Execution]
        """

        self._successors = successors

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


        :return: The annotations of this Execution.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._annotations

    @annotations.setter
    def annotations(self, annotations):
        """Sets the annotations of this Execution.


        :param annotations: The annotations of this Execution.  # noqa: E501
        :type: dict(str, str)
        """

        self._annotations = annotations

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

        return self.__dict__ == other.__dict__

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