# coding: utf-8

"""
    

    

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

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""

from pprint import pformat
from six import iteritems
import re


class V1BuildSpec(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """

    operations = [
    ]

    # The key is attribute name
    # and the value is attribute type.
    swagger_types = {
        'service_account': 'str',
        'source': 'V1BuildSource',
        'revision': 'V1SourceRevision',
        'strategy': 'V1BuildStrategy',
        'output': 'V1BuildOutput',
        'resources': 'V1ResourceRequirements',
        'post_commit': 'V1BuildPostCommitSpec',
        'completion_deadline_seconds': 'int'
    }

    # The key is attribute name
    # and the value is json key in definition.
    attribute_map = {
        'service_account': 'serviceAccount',
        'source': 'source',
        'revision': 'revision',
        'strategy': 'strategy',
        'output': 'output',
        'resources': 'resources',
        'post_commit': 'postCommit',
        'completion_deadline_seconds': 'completionDeadlineSeconds'
    }

    def __init__(self, service_account=None, source=None, revision=None, strategy=None, output=None, resources=None, post_commit=None, completion_deadline_seconds=None):
        """
        V1BuildSpec - a model defined in Swagger

        """

        self._service_account = service_account
        self._source = source
        self._revision = revision
        self._strategy = strategy
        self._output = output
        self._resources = resources
        self._post_commit = post_commit
        self._completion_deadline_seconds = completion_deadline_seconds

    @property
    def service_account(self):
        """
        Gets the service_account of this V1BuildSpec.
        ServiceAccount is the name of the ServiceAccount to use to run the pod created by this build. The pod will be allowed to use secrets referenced by the ServiceAccount

        :return: The service_account of this V1BuildSpec.
        :rtype: str
        """
        return self._service_account

    @service_account.setter
    def service_account(self, service_account):
        """
        Sets the service_account of this V1BuildSpec.
        ServiceAccount is the name of the ServiceAccount to use to run the pod created by this build. The pod will be allowed to use secrets referenced by the ServiceAccount

        :param service_account: The service_account of this V1BuildSpec.
        :type: str
        """

        self._service_account = service_account

    @property
    def source(self):
        """
        Gets the source of this V1BuildSpec.
        Source describes the SCM in use.

        :return: The source of this V1BuildSpec.
        :rtype: V1BuildSource
        """
        return self._source

    @source.setter
    def source(self, source):
        """
        Sets the source of this V1BuildSpec.
        Source describes the SCM in use.

        :param source: The source of this V1BuildSpec.
        :type: V1BuildSource
        """

        self._source = source

    @property
    def revision(self):
        """
        Gets the revision of this V1BuildSpec.
        Revision is the information from the source for a specific repo snapshot. This is optional.

        :return: The revision of this V1BuildSpec.
        :rtype: V1SourceRevision
        """
        return self._revision

    @revision.setter
    def revision(self, revision):
        """
        Sets the revision of this V1BuildSpec.
        Revision is the information from the source for a specific repo snapshot. This is optional.

        :param revision: The revision of this V1BuildSpec.
        :type: V1SourceRevision
        """

        self._revision = revision

    @property
    def strategy(self):
        """
        Gets the strategy of this V1BuildSpec.
        Strategy defines how to perform a build.

        :return: The strategy of this V1BuildSpec.
        :rtype: V1BuildStrategy
        """
        return self._strategy

    @strategy.setter
    def strategy(self, strategy):
        """
        Sets the strategy of this V1BuildSpec.
        Strategy defines how to perform a build.

        :param strategy: The strategy of this V1BuildSpec.
        :type: V1BuildStrategy
        """

        self._strategy = strategy

    @property
    def output(self):
        """
        Gets the output of this V1BuildSpec.
        Output describes the Docker image the Strategy should produce.

        :return: The output of this V1BuildSpec.
        :rtype: V1BuildOutput
        """
        return self._output

    @output.setter
    def output(self, output):
        """
        Sets the output of this V1BuildSpec.
        Output describes the Docker image the Strategy should produce.

        :param output: The output of this V1BuildSpec.
        :type: V1BuildOutput
        """

        self._output = output

    @property
    def resources(self):
        """
        Gets the resources of this V1BuildSpec.
        Compute resource requirements to execute the build

        :return: The resources of this V1BuildSpec.
        :rtype: V1ResourceRequirements
        """
        return self._resources

    @resources.setter
    def resources(self, resources):
        """
        Sets the resources of this V1BuildSpec.
        Compute resource requirements to execute the build

        :param resources: The resources of this V1BuildSpec.
        :type: V1ResourceRequirements
        """

        self._resources = resources

    @property
    def post_commit(self):
        """
        Gets the post_commit of this V1BuildSpec.
        PostCommit is a build hook executed after the build output image is committed, before it is pushed to a registry.

        :return: The post_commit of this V1BuildSpec.
        :rtype: V1BuildPostCommitSpec
        """
        return self._post_commit

    @post_commit.setter
    def post_commit(self, post_commit):
        """
        Sets the post_commit of this V1BuildSpec.
        PostCommit is a build hook executed after the build output image is committed, before it is pushed to a registry.

        :param post_commit: The post_commit of this V1BuildSpec.
        :type: V1BuildPostCommitSpec
        """

        self._post_commit = post_commit

    @property
    def completion_deadline_seconds(self):
        """
        Gets the completion_deadline_seconds of this V1BuildSpec.
        Optional duration in seconds, counted from the time when a build pod gets scheduled in the system, that the build may be active on a node before the system actively tries to terminate the build; value must be positive integer

        :return: The completion_deadline_seconds of this V1BuildSpec.
        :rtype: int
        """
        return self._completion_deadline_seconds

    @completion_deadline_seconds.setter
    def completion_deadline_seconds(self, completion_deadline_seconds):
        """
        Sets the completion_deadline_seconds of this V1BuildSpec.
        Optional duration in seconds, counted from the time when a build pod gets scheduled in the system, that the build may be active on a node before the system actively tries to terminate the build; value must be positive integer

        :param completion_deadline_seconds: The completion_deadline_seconds of this V1BuildSpec.
        :type: int
        """

        self._completion_deadline_seconds = completion_deadline_seconds

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

        for attr, _ in iteritems(V1BuildSpec.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

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return 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
        """
        return self.__dict__ == other.__dict__

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