# 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.knative_condition import KnativeCondition  # noqa: F401,E501
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 V1beta1PipelineRunStatus(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 = {
        'annotations': 'dict(str, str)',
        'completion_time': 'V1Time',
        'conditions': 'list[KnativeCondition]',
        'observed_generation': 'int',
        'pipeline_results': 'list[V1beta1PipelineRunResult]',
        'pipeline_spec': 'V1beta1PipelineSpec',
        'start_time': 'V1Time',
        'task_runs': 'dict(str, V1beta1PipelineRunTaskRunStatus)'
    }

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

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

        self._annotations = None
        self._completion_time = None
        self._conditions = None
        self._observed_generation = None
        self._pipeline_results = None
        self._pipeline_spec = None
        self._start_time = None
        self._task_runs = None
        self.discriminator = None

        if annotations is not None:
            self.annotations = annotations
        if completion_time is not None:
            self.completion_time = completion_time
        if conditions is not None:
            self.conditions = conditions
        if observed_generation is not None:
            self.observed_generation = observed_generation
        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 annotations(self):
        """Gets the annotations of this V1beta1PipelineRunStatus.  # noqa: E501

        Annotations is additional Status fields for the Resource to save some additional State as well as convey more information to the user. This is roughly akin to Annotations on any k8s resource, just the reconciler conveying richer information outwards.  # noqa: E501

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

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

        Annotations is additional Status fields for the Resource to save some additional State as well as convey more information to the user. This is roughly akin to Annotations on any k8s resource, just the reconciler conveying richer information outwards.  # noqa: E501

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

        self._annotations = annotations

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

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

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

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

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

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

        self._completion_time = completion_time

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

        Conditions the latest available observations of a resource's current state.  # noqa: E501

        :return: The conditions of this V1beta1PipelineRunStatus.  # noqa: E501
        :rtype: list[KnativeCondition]
        """
        return self._conditions

    @conditions.setter
    def conditions(self, conditions):
        """Sets the conditions of this V1beta1PipelineRunStatus.

        Conditions the latest available observations of a resource's current state.  # noqa: E501

        :param conditions: The conditions of this V1beta1PipelineRunStatus.  # noqa: E501
        :type: list[KnativeCondition]
        """

        self._conditions = conditions

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

        ObservedGeneration is the 'Generation' of the Service that was last processed by the controller.  # noqa: E501

        :return: The observed_generation of this V1beta1PipelineRunStatus.  # noqa: E501
        :rtype: int
        """
        return self._observed_generation

    @observed_generation.setter
    def observed_generation(self, observed_generation):
        """Sets the observed_generation of this V1beta1PipelineRunStatus.

        ObservedGeneration is the 'Generation' of the Service that was last processed by the controller.  # noqa: E501

        :param observed_generation: The observed_generation of this V1beta1PipelineRunStatus.  # noqa: E501
        :type: int
        """

        self._observed_generation = observed_generation

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

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

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

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

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

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

        self._pipeline_results = pipeline_results

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

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

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

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

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

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

        self._pipeline_spec = pipeline_spec

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

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

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

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

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

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

        self._start_time = start_time

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

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

        :return: The task_runs of this V1beta1PipelineRunStatus.  # 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 V1beta1PipelineRunStatus.

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

        :param task_runs: The task_runs of this V1beta1PipelineRunStatus.  # 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(V1beta1PipelineRunStatus, 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, V1beta1PipelineRunStatus):
            return False

        return self.__dict__ == other.__dict__

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