# 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.pod_template import PodTemplate  # noqa: F401,E501
from tekton.models.v1_duration import V1Duration  # noqa: F401,E501
from tekton.models.v1beta1_param import V1beta1Param  # noqa: F401,E501
from tekton.models.v1beta1_pipeline_ref import V1beta1PipelineRef  # noqa: F401,E501
from tekton.models.v1beta1_pipeline_resource_binding import V1beta1PipelineResourceBinding  # noqa: F401,E501
from tekton.models.v1beta1_pipeline_run_spec_service_account_name import V1beta1PipelineRunSpecServiceAccountName  # noqa: F401,E501
from tekton.models.v1beta1_pipeline_spec import V1beta1PipelineSpec  # noqa: F401,E501
from tekton.models.v1beta1_pipeline_task_run_spec import V1beta1PipelineTaskRunSpec  # noqa: F401,E501
from tekton.models.v1beta1_workspace_binding import V1beta1WorkspaceBinding  # noqa: F401,E501


class V1beta1PipelineRunSpec(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 = {
        'params': 'list[V1beta1Param]',
        'pipeline_ref': 'V1beta1PipelineRef',
        'pipeline_spec': 'V1beta1PipelineSpec',
        'pod_template': 'PodTemplate',
        'resources': 'list[V1beta1PipelineResourceBinding]',
        'service_account_name': 'str',
        'service_account_names': 'list[V1beta1PipelineRunSpecServiceAccountName]',
        'status': 'str',
        'task_run_specs': 'list[V1beta1PipelineTaskRunSpec]',
        'timeout': 'V1Duration',
        'workspaces': 'list[V1beta1WorkspaceBinding]'
    }

    attribute_map = {
        'params': 'params',
        'pipeline_ref': 'pipelineRef',
        'pipeline_spec': 'pipelineSpec',
        'pod_template': 'podTemplate',
        'resources': 'resources',
        'service_account_name': 'serviceAccountName',
        'service_account_names': 'serviceAccountNames',
        'status': 'status',
        'task_run_specs': 'taskRunSpecs',
        'timeout': 'timeout',
        'workspaces': 'workspaces'
    }

    def __init__(self, params=None, pipeline_ref=None, pipeline_spec=None, pod_template=None, resources=None, service_account_name=None, service_account_names=None, status=None, task_run_specs=None, timeout=None, workspaces=None):  # noqa: E501
        """V1beta1PipelineRunSpec - a model defined in Swagger"""  # noqa: E501

        self._params = None
        self._pipeline_ref = None
        self._pipeline_spec = None
        self._pod_template = None
        self._resources = None
        self._service_account_name = None
        self._service_account_names = None
        self._status = None
        self._task_run_specs = None
        self._timeout = None
        self._workspaces = None
        self.discriminator = None

        if params is not None:
            self.params = params
        if pipeline_ref is not None:
            self.pipeline_ref = pipeline_ref
        if pipeline_spec is not None:
            self.pipeline_spec = pipeline_spec
        if pod_template is not None:
            self.pod_template = pod_template
        if resources is not None:
            self.resources = resources
        if service_account_name is not None:
            self.service_account_name = service_account_name
        if service_account_names is not None:
            self.service_account_names = service_account_names
        if status is not None:
            self.status = status
        if task_run_specs is not None:
            self.task_run_specs = task_run_specs
        if timeout is not None:
            self.timeout = timeout
        if workspaces is not None:
            self.workspaces = workspaces

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

        Params is a list of parameter names and values.  # noqa: E501

        :return: The params of this V1beta1PipelineRunSpec.  # noqa: E501
        :rtype: list[V1beta1Param]
        """
        return self._params

    @params.setter
    def params(self, params):
        """Sets the params of this V1beta1PipelineRunSpec.

        Params is a list of parameter names and values.  # noqa: E501

        :param params: The params of this V1beta1PipelineRunSpec.  # noqa: E501
        :type: list[V1beta1Param]
        """

        self._params = params

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


        :return: The pipeline_ref of this V1beta1PipelineRunSpec.  # noqa: E501
        :rtype: V1beta1PipelineRef
        """
        return self._pipeline_ref

    @pipeline_ref.setter
    def pipeline_ref(self, pipeline_ref):
        """Sets the pipeline_ref of this V1beta1PipelineRunSpec.


        :param pipeline_ref: The pipeline_ref of this V1beta1PipelineRunSpec.  # noqa: E501
        :type: V1beta1PipelineRef
        """

        self._pipeline_ref = pipeline_ref

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


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

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


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

        self._pipeline_spec = pipeline_spec

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

        PodTemplate holds pod specific configuration  # noqa: E501

        :return: The pod_template of this V1beta1PipelineRunSpec.  # noqa: E501
        :rtype: PodTemplate
        """
        return self._pod_template

    @pod_template.setter
    def pod_template(self, pod_template):
        """Sets the pod_template of this V1beta1PipelineRunSpec.

        PodTemplate holds pod specific configuration  # noqa: E501

        :param pod_template: The pod_template of this V1beta1PipelineRunSpec.  # noqa: E501
        :type: PodTemplate
        """

        self._pod_template = pod_template

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

        Resources is a list of bindings specifying which actual instances of PipelineResources to use for the resources the Pipeline has declared it needs.  # noqa: E501

        :return: The resources of this V1beta1PipelineRunSpec.  # noqa: E501
        :rtype: list[V1beta1PipelineResourceBinding]
        """
        return self._resources

    @resources.setter
    def resources(self, resources):
        """Sets the resources of this V1beta1PipelineRunSpec.

        Resources is a list of bindings specifying which actual instances of PipelineResources to use for the resources the Pipeline has declared it needs.  # noqa: E501

        :param resources: The resources of this V1beta1PipelineRunSpec.  # noqa: E501
        :type: list[V1beta1PipelineResourceBinding]
        """

        self._resources = resources

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


        :return: The service_account_name of this V1beta1PipelineRunSpec.  # noqa: E501
        :rtype: str
        """
        return self._service_account_name

    @service_account_name.setter
    def service_account_name(self, service_account_name):
        """Sets the service_account_name of this V1beta1PipelineRunSpec.


        :param service_account_name: The service_account_name of this V1beta1PipelineRunSpec.  # noqa: E501
        :type: str
        """

        self._service_account_name = service_account_name

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

        Deprecated: use taskRunSpecs.ServiceAccountName instead  # noqa: E501

        :return: The service_account_names of this V1beta1PipelineRunSpec.  # noqa: E501
        :rtype: list[V1beta1PipelineRunSpecServiceAccountName]
        """
        return self._service_account_names

    @service_account_names.setter
    def service_account_names(self, service_account_names):
        """Sets the service_account_names of this V1beta1PipelineRunSpec.

        Deprecated: use taskRunSpecs.ServiceAccountName instead  # noqa: E501

        :param service_account_names: The service_account_names of this V1beta1PipelineRunSpec.  # noqa: E501
        :type: list[V1beta1PipelineRunSpecServiceAccountName]
        """

        self._service_account_names = service_account_names

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

        Used for cancelling a pipelinerun (and maybe more later on)  # noqa: E501

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

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

        Used for cancelling a pipelinerun (and maybe more later on)  # noqa: E501

        :param status: The status of this V1beta1PipelineRunSpec.  # noqa: E501
        :type: str
        """

        self._status = status

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

        TaskRunSpecs holds a set of runtime specs  # noqa: E501

        :return: The task_run_specs of this V1beta1PipelineRunSpec.  # noqa: E501
        :rtype: list[V1beta1PipelineTaskRunSpec]
        """
        return self._task_run_specs

    @task_run_specs.setter
    def task_run_specs(self, task_run_specs):
        """Sets the task_run_specs of this V1beta1PipelineRunSpec.

        TaskRunSpecs holds a set of runtime specs  # noqa: E501

        :param task_run_specs: The task_run_specs of this V1beta1PipelineRunSpec.  # noqa: E501
        :type: list[V1beta1PipelineTaskRunSpec]
        """

        self._task_run_specs = task_run_specs

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

        Time after which the Pipeline times out. Defaults to never. Refer to Go's ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration  # noqa: E501

        :return: The timeout of this V1beta1PipelineRunSpec.  # noqa: E501
        :rtype: V1Duration
        """
        return self._timeout

    @timeout.setter
    def timeout(self, timeout):
        """Sets the timeout of this V1beta1PipelineRunSpec.

        Time after which the Pipeline times out. Defaults to never. Refer to Go's ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration  # noqa: E501

        :param timeout: The timeout of this V1beta1PipelineRunSpec.  # noqa: E501
        :type: V1Duration
        """

        self._timeout = timeout

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

        Workspaces holds a set of workspace bindings that must match names with those declared in the pipeline.  # noqa: E501

        :return: The workspaces of this V1beta1PipelineRunSpec.  # noqa: E501
        :rtype: list[V1beta1WorkspaceBinding]
        """
        return self._workspaces

    @workspaces.setter
    def workspaces(self, workspaces):
        """Sets the workspaces of this V1beta1PipelineRunSpec.

        Workspaces holds a set of workspace bindings that must match names with those declared in the pipeline.  # noqa: E501

        :param workspaces: The workspaces of this V1beta1PipelineRunSpec.  # noqa: E501
        :type: list[V1beta1WorkspaceBinding]
        """

        self._workspaces = workspaces

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

        return self.__dict__ == other.__dict__

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