# coding: utf-8

"""
    Task Execution Service

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

    The version of the OpenAPI document: v1
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from libica.openapi.libtes.configuration import Configuration


class UpdateTaskRunStateRequest(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',
        'status_details': 'str',
        'start_time': 'datetime',
        'completion_time': 'datetime'
    }

    attribute_map = {
        'status': 'status',
        'status_details': 'statusDetails',
        'start_time': 'startTime',
        'completion_time': 'completionTime'
    }

    def __init__(self, status=None, status_details=None, start_time=None, completion_time=None, local_vars_configuration=None):  # noqa: E501
        """UpdateTaskRunStateRequest - 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._status_details = None
        self._start_time = None
        self._completion_time = None
        self.discriminator = None

        if status is not None:
            self.status = status
        if status_details is not None:
            self.status_details = status_details
        if start_time is not None:
            self.start_time = start_time
        if completion_time is not None:
            self.completion_time = completion_time

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

        New TaskRun status to be updated  # noqa: E501

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

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

        New TaskRun status to be updated  # noqa: E501

        :param status: The status of this UpdateTaskRunStateRequest.  # noqa: E501
        :type: str
        """
        allowed_values = ["CheckedOut", "Runnable", "Running", "Finalizing", "Completed", "FailedRestartable", "Failed", "Aborted", "TimedOut"]  # 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 status_details(self):
        """Gets the status_details of this UpdateTaskRunStateRequest.  # noqa: E501

        Description of the event that triggered the state change  # noqa: E501

        :return: The status_details of this UpdateTaskRunStateRequest.  # noqa: E501
        :rtype: str
        """
        return self._status_details

    @status_details.setter
    def status_details(self, status_details):
        """Sets the status_details of this UpdateTaskRunStateRequest.

        Description of the event that triggered the state change  # noqa: E501

        :param status_details: The status_details of this UpdateTaskRunStateRequest.  # noqa: E501
        :type: str
        """

        self._status_details = status_details

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

        TaskRun execution start time  # noqa: E501

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

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

        TaskRun execution start time  # noqa: E501

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

        self._start_time = start_time

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

        TaskRun execution completion time  # noqa: E501

        :return: The completion_time of this UpdateTaskRunStateRequest.  # noqa: E501
        :rtype: datetime
        """
        return self._completion_time

    @completion_time.setter
    def completion_time(self, completion_time):
        """Sets the completion_time of this UpdateTaskRunStateRequest.

        TaskRun execution completion time  # noqa: E501

        :param completion_time: The completion_time of this UpdateTaskRunStateRequest.  # noqa: E501
        :type: datetime
        """

        self._completion_time = completion_time

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

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