# 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_task_ref import V1beta1TaskRef  # noqa: F401,E501
from tekton.models.v1beta1_task_run_resources import V1beta1TaskRunResources  # noqa: F401,E501
from tekton.models.v1beta1_task_spec import V1beta1TaskSpec  # noqa: F401,E501
from tekton.models.v1beta1_workspace_binding import V1beta1WorkspaceBinding  # noqa: F401,E501


class V1beta1TaskRunSpec(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]',
        'pod_template': 'PodTemplate',
        'resources': 'V1beta1TaskRunResources',
        'service_account_name': 'str',
        'status': 'str',
        'task_ref': 'V1beta1TaskRef',
        'task_spec': 'V1beta1TaskSpec',
        'timeout': 'V1Duration',
        'workspaces': 'list[V1beta1WorkspaceBinding]'
    }

    attribute_map = {
        'params': 'params',
        'pod_template': 'podTemplate',
        'resources': 'resources',
        'service_account_name': 'serviceAccountName',
        'status': 'status',
        'task_ref': 'taskRef',
        'task_spec': 'taskSpec',
        'timeout': 'timeout',
        'workspaces': 'workspaces'
    }

    def __init__(self, params=None, pod_template=None, resources=None, service_account_name=None, status=None, task_ref=None, task_spec=None, timeout=None, workspaces=None):  # noqa: E501
        """V1beta1TaskRunSpec - a model defined in Swagger"""  # noqa: E501

        self._params = None
        self._pod_template = None
        self._resources = None
        self._service_account_name = None
        self._status = None
        self._task_ref = None
        self._task_spec = None
        self._timeout = None
        self._workspaces = None
        self.discriminator = None

        if params is not None:
            self.params = params
        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 status is not None:
            self.status = status
        if task_ref is not None:
            self.task_ref = task_ref
        if task_spec is not None:
            self.task_spec = task_spec
        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 V1beta1TaskRunSpec.  # noqa: E501


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

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


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

        self._params = params

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

        PodTemplate holds pod specific configuration  # noqa: E501

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

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

        PodTemplate holds pod specific configuration  # noqa: E501

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

        self._pod_template = pod_template

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


        :return: The resources of this V1beta1TaskRunSpec.  # noqa: E501
        :rtype: V1beta1TaskRunResources
        """
        return self._resources

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


        :param resources: The resources of this V1beta1TaskRunSpec.  # noqa: E501
        :type: V1beta1TaskRunResources
        """

        self._resources = resources

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


        :return: The service_account_name of this V1beta1TaskRunSpec.  # 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 V1beta1TaskRunSpec.


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

        self._service_account_name = service_account_name

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

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

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

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

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

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

        self._status = status

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

        no more than one of the TaskRef and TaskSpec may be specified.  # noqa: E501

        :return: The task_ref of this V1beta1TaskRunSpec.  # noqa: E501
        :rtype: V1beta1TaskRef
        """
        return self._task_ref

    @task_ref.setter
    def task_ref(self, task_ref):
        """Sets the task_ref of this V1beta1TaskRunSpec.

        no more than one of the TaskRef and TaskSpec may be specified.  # noqa: E501

        :param task_ref: The task_ref of this V1beta1TaskRunSpec.  # noqa: E501
        :type: V1beta1TaskRef
        """

        self._task_ref = task_ref

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


        :return: The task_spec of this V1beta1TaskRunSpec.  # noqa: E501
        :rtype: V1beta1TaskSpec
        """
        return self._task_spec

    @task_spec.setter
    def task_spec(self, task_spec):
        """Sets the task_spec of this V1beta1TaskRunSpec.


        :param task_spec: The task_spec of this V1beta1TaskRunSpec.  # noqa: E501
        :type: V1beta1TaskSpec
        """

        self._task_spec = task_spec

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

        Time after which the build times out. Defaults to 1 hour. Specified build timeout should be less than 24h. Refer Go's ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration  # noqa: E501

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

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

        Time after which the build times out. Defaults to 1 hour. Specified build timeout should be less than 24h. Refer Go's ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration  # noqa: E501

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

        self._timeout = timeout

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

        Workspaces is a list of WorkspaceBindings from volumes to workspaces.  # noqa: E501

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

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

        Workspaces is a list of WorkspaceBindings from volumes to workspaces.  # noqa: E501

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

        return self.__dict__ == other.__dict__

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