# coding: utf-8

"""
    Tekton

    Python SDK for Tekton Pipeline  # noqa: E501

    OpenAPI spec version: v0.1
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from tekton.models.v1_time import V1Time  # noqa: F401,E501
from tekton.models.v1beta1_pipeline_run_result import V1beta1PipelineRunResult  # noqa: F401,E501
from tekton.models.v1beta1_pipeline_run_task_run_status import V1beta1PipelineRunTaskRunStatus  # noqa: F401,E501
from tekton.models.v1beta1_pipeline_spec import V1beta1PipelineSpec  # noqa: F401,E501


class V1beta1PipelineRunStatusFields(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_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.
    """
    swagger_types = {
        'completion_time': 'V1Time',
        'pipeline_results': 'list[V1beta1PipelineRunResult]',
        'pipeline_spec': 'V1beta1PipelineSpec',
        'start_time': 'V1Time',
        'task_runs': 'dict(str, V1beta1PipelineRunTaskRunStatus)'
    }

    attribute_map = {
        'completion_time': 'completionTime',
        'pipeline_results': 'pipelineResults',
        'pipeline_spec': 'pipelineSpec',
        'start_time': 'startTime',
        'task_runs': 'taskRuns'
    }

    def __init__(self, completion_time=None, pipeline_results=None, pipeline_spec=None, start_time=None, task_runs=None):  # noqa: E501
        """V1beta1PipelineRunStatusFields - a model defined in Swagger"""  # noqa: E501

        self._completion_time = None
        self._pipeline_results = None
        self._pipeline_spec = None
        self._start_time = None
        self._task_runs = None
        self.discriminator = None

        if completion_time is not None:
            self.completion_time = completion_time
        if pipeline_results is not None:
            self.pipeline_results = pipeline_results
        if pipeline_spec is not None:
            self.pipeline_spec = pipeline_spec
        if start_time is not None:
            self.start_time = start_time
        if task_runs is not None:
            self.task_runs = task_runs

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

        CompletionTime is the time the PipelineRun completed.  # noqa: E501

        :return: The completion_time of this V1beta1PipelineRunStatusFields.  # noqa: E501
        :rtype: V1Time
        """
        return self._completion_time

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

        CompletionTime is the time the PipelineRun completed.  # noqa: E501

        :param completion_time: The completion_time of this V1beta1PipelineRunStatusFields.  # noqa: E501
        :type: V1Time
        """

        self._completion_time = completion_time

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

        PipelineResults are the list of results written out by the pipeline task's containers  # noqa: E501

        :return: The pipeline_results of this V1beta1PipelineRunStatusFields.  # noqa: E501
        :rtype: list[V1beta1PipelineRunResult]
        """
        return self._pipeline_results

    @pipeline_results.setter
    def pipeline_results(self, pipeline_results):
        """Sets the pipeline_results of this V1beta1PipelineRunStatusFields.

        PipelineResults are the list of results written out by the pipeline task's containers  # noqa: E501

        :param pipeline_results: The pipeline_results of this V1beta1PipelineRunStatusFields.  # noqa: E501
        :type: list[V1beta1PipelineRunResult]
        """

        self._pipeline_results = pipeline_results

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

        PipelineRunSpec contains the exact spec used to instantiate the run  # noqa: E501

        :return: The pipeline_spec of this V1beta1PipelineRunStatusFields.  # noqa: E501
        :rtype: V1beta1PipelineSpec
        """
        return self._pipeline_spec

    @pipeline_spec.setter
    def pipeline_spec(self, pipeline_spec):
        """Sets the pipeline_spec of this V1beta1PipelineRunStatusFields.

        PipelineRunSpec contains the exact spec used to instantiate the run  # noqa: E501

        :param pipeline_spec: The pipeline_spec of this V1beta1PipelineRunStatusFields.  # noqa: E501
        :type: V1beta1PipelineSpec
        """

        self._pipeline_spec = pipeline_spec

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

        StartTime is the time the PipelineRun is actually started.  # noqa: E501

        :return: The start_time of this V1beta1PipelineRunStatusFields.  # noqa: E501
        :rtype: V1Time
        """
        return self._start_time

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

        StartTime is the time the PipelineRun is actually started.  # noqa: E501

        :param start_time: The start_time of this V1beta1PipelineRunStatusFields.  # noqa: E501
        :type: V1Time
        """

        self._start_time = start_time

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

        map of PipelineRunTaskRunStatus with the taskRun name as the key  # noqa: E501

        :return: The task_runs of this V1beta1PipelineRunStatusFields.  # noqa: E501
        :rtype: dict(str, V1beta1PipelineRunTaskRunStatus)
        """
        return self._task_runs

    @task_runs.setter
    def task_runs(self, task_runs):
        """Sets the task_runs of this V1beta1PipelineRunStatusFields.

        map of PipelineRunTaskRunStatus with the taskRun name as the key  # noqa: E501

        :param task_runs: The task_runs of this V1beta1PipelineRunStatusFields.  # noqa: E501
        :type: dict(str, V1beta1PipelineRunTaskRunStatus)
        """

        self._task_runs = task_runs

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_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
        if issubclass(V1beta1PipelineRunStatusFields, dict):
            for key, value in self.items():
                result[key] = 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, V1beta1PipelineRunStatusFields):
            return False

        return self.__dict__ == other.__dict__

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