From ddc5624ea61467b1810ceb4f0540ae5bb13375d5 Mon Sep 17 00:00:00 2001 From: Yichi Zhang Date: Tue, 8 Mar 2022 20:23:44 -0800 Subject: [PATCH] [BEAM-12447] Upgrade cloud build client and add/cleanup options (#17032) --- .../apache_beam/options/pipeline_options.py | 9 +- .../runners/dataflow/internal/apiclient.py | 5 + .../internal/clients/cloudbuild/__init__.py | 2 - .../cloudbuild/cloudbuild_v1_client.py | 1367 ++++++++-- .../cloudbuild/cloudbuild_v1_messages.py | 2335 +++++++++++++++-- .../portability/sdk_container_builder.py | 30 +- 6 files changed, 3387 insertions(+), 361 deletions(-) diff --git a/sdks/python/apache_beam/options/pipeline_options.py b/sdks/python/apache_beam/options/pipeline_options.py index 14aa54ec735c6..2c12a9f6f5b6f 100644 --- a/sdks/python/apache_beam/options/pipeline_options.py +++ b/sdks/python/apache_beam/options/pipeline_options.py @@ -1176,14 +1176,11 @@ def _add_argparse_args(cls, parser): 'can also subclass SdkContainerImageBuilder and use that to build ' 'in other environments.')) parser.add_argument( - '--prebuild_sdk_container_base_image', + '--cloud_build_machine_type', default=None, help=( - 'The base image to use when pre-building the sdk container image ' - 'with dependencies, if not specified, by default the released ' - 'public apache beam python sdk container image corresponding to ' - 'the sdk version will be used, if a dev sdk is used the base ' - 'image will default to the latest released sdk image.')) + 'If specified, use the machine type explicitly when prebuilding' + 'SDK container image on Google Cloud Build.')) parser.add_argument( '--docker_registry_push_url', default=None, diff --git a/sdks/python/apache_beam/runners/dataflow/internal/apiclient.py b/sdks/python/apache_beam/runners/dataflow/internal/apiclient.py index bd6af8c8958b0..9a9a4f9692e75 100644 --- a/sdks/python/apache_beam/runners/dataflow/internal/apiclient.py +++ b/sdks/python/apache_beam/runners/dataflow/internal/apiclient.py @@ -20,6 +20,11 @@ Dataflow client utility functions.""" # pytype: skip-file +# To regenerate the client: +# pip install google-apitools[cli] +# gen_client --discovery_url=cloudbuild.v1 --overwrite \ +# --outdir=apache_beam/runners/dataflow/internal/clients/cloudbuild \ +# --root_package=. client import codecs from functools import partial diff --git a/sdks/python/apache_beam/runners/dataflow/internal/clients/cloudbuild/__init__.py b/sdks/python/apache_beam/runners/dataflow/internal/clients/cloudbuild/__init__.py index 35017d88b02dc..767bd4cec605d 100644 --- a/sdks/python/apache_beam/runners/dataflow/internal/clients/cloudbuild/__init__.py +++ b/sdks/python/apache_beam/runners/dataflow/internal/clients/cloudbuild/__init__.py @@ -25,11 +25,9 @@ # pylint: disable=wrong-import-order, wrong-import-position try: from apitools.base.py import * - from apache_beam.runners.dataflow.internal.clients.cloudbuild.cloudbuild_v1_client import * from apache_beam.runners.dataflow.internal.clients.cloudbuild.cloudbuild_v1_messages import * except ImportError: pass -# pylint: enable=wrong-import-order, wrong-import-position __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/sdks/python/apache_beam/runners/dataflow/internal/clients/cloudbuild/cloudbuild_v1_client.py b/sdks/python/apache_beam/runners/dataflow/internal/clients/cloudbuild/cloudbuild_v1_client.py index fe60374480e2b..9d699aba58927 100644 --- a/sdks/python/apache_beam/runners/dataflow/internal/clients/cloudbuild/cloudbuild_v1_client.py +++ b/sdks/python/apache_beam/runners/dataflow/internal/clients/cloudbuild/cloudbuild_v1_client.py @@ -17,13 +17,13 @@ """Generated client library for cloudbuild version v1.""" # NOTE: This file is autogenerated and should not be edited by hand. +# mypy: ignore-errors # To regenerate the client: # pip install google-apitools[cli] # gen_client --discovery_url=cloudbuild.v1 --overwrite \ # --outdir=apache_beam/runners/dataflow/internal/clients/cloudbuild \ # --root_package=. client -# -# mypy: ignore-errors + from apitools.base.py import base_api from . import cloudbuild_v1_messages as messages @@ -73,14 +73,65 @@ def __init__( default_global_params=default_global_params, additional_http_headers=additional_http_headers, response_encoding=response_encoding) + self.locations = self.LocationsService(self) self.operations = self.OperationsService(self) self.projects_builds = self.ProjectsBuildsService(self) + self.projects_githubEnterpriseConfigs = self.ProjectsGithubEnterpriseConfigsService( + self) + self.projects_locations_bitbucketServerConfigs_connectedRepositories = self.ProjectsLocationsBitbucketServerConfigsConnectedRepositoriesService( + self) + self.projects_locations_bitbucketServerConfigs_repos = self.ProjectsLocationsBitbucketServerConfigsReposService( + self) + self.projects_locations_bitbucketServerConfigs = self.ProjectsLocationsBitbucketServerConfigsService( + self) self.projects_locations_builds = self.ProjectsLocationsBuildsService(self) + self.projects_locations_githubEnterpriseConfigs = self.ProjectsLocationsGithubEnterpriseConfigsService( + self) self.projects_locations_operations = self.ProjectsLocationsOperationsService( self) + self.projects_locations_triggers = self.ProjectsLocationsTriggersService( + self) + self.projects_locations_workerPools = self.ProjectsLocationsWorkerPoolsService( + self) self.projects_locations = self.ProjectsLocationsService(self) self.projects_triggers = self.ProjectsTriggersService(self) self.projects = self.ProjectsService(self) + self.v1 = self.V1Service(self) + + class LocationsService(base_api.BaseApiService): + """Service class for the locations resource.""" + + _NAME = 'locations' + + def __init__(self, client): + super(CloudbuildV1.LocationsService, self).__init__(client) + self._upload_configs = {} + + def RegionalWebhook(self, request, global_params=None): + r"""ReceiveRegionalWebhook is called when the API receives a regional GitHub webhook. + + Args: + request: (CloudbuildLocationsRegionalWebhookRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Empty) The response message. + """ + config = self.GetMethodConfig('RegionalWebhook') + return self._RunMethod(config, request, global_params=global_params) + + RegionalWebhook.method_config = lambda: base_api.ApiMethodInfo( + flat_path='v1/locations/{locationsId}/regionalWebhook', + http_method='POST', + method_id='cloudbuild.locations.regionalWebhook', + ordered_params=['location'], + path_params=['location'], + query_params=['webhookKey'], + relative_path='v1/{+location}/regionalWebhook', + request_field='httpBody', + request_type_name='CloudbuildLocationsRegionalWebhookRequest', + response_type_name='Empty', + supports_download=False, + ) class OperationsService(base_api.BaseApiService): """Service class for the operations resource.""" @@ -152,6 +203,32 @@ def __init__(self, client): super(CloudbuildV1.ProjectsBuildsService, self).__init__(client) self._upload_configs = {} + def Approve(self, request, global_params=None): + r"""Approves or rejects a pending build. If approved, the returned LRO will be analogous to the LRO returned from a CreateBuild call. If rejected, the returned LRO will be immediately done. + + Args: + request: (CloudbuildProjectsBuildsApproveRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Operation) The response message. + """ + config = self.GetMethodConfig('Approve') + return self._RunMethod(config, request, global_params=global_params) + + Approve.method_config = lambda: base_api.ApiMethodInfo( + flat_path='v1/projects/{projectsId}/builds/{buildsId}:approve', + http_method='POST', + method_id='cloudbuild.projects.builds.approve', + ordered_params=['name'], + path_params=['name'], + query_params=[], + relative_path='v1/{+name}:approve', + request_field='approveBuildRequest', + request_type_name='CloudbuildProjectsBuildsApproveRequest', + response_type_name='Operation', + supports_download=False, + ) + def Cancel(self, request, global_params=None): r"""Cancels a build in progress. @@ -277,326 +354,1288 @@ def Retry(self, request, global_params=None): supports_download=False, ) - class ProjectsLocationsBuildsService(base_api.BaseApiService): - """Service class for the projects_locations_builds resource.""" + class ProjectsGithubEnterpriseConfigsService(base_api.BaseApiService): + """Service class for the projects_githubEnterpriseConfigs resource.""" - _NAME = 'projects_locations_builds' + _NAME = 'projects_githubEnterpriseConfigs' def __init__(self, client): - super(CloudbuildV1.ProjectsLocationsBuildsService, self).__init__(client) + super(CloudbuildV1.ProjectsGithubEnterpriseConfigsService, + self).__init__(client) self._upload_configs = {} - def Cancel(self, request, global_params=None): - r"""Cancels a build in progress. + def Create(self, request, global_params=None): + r"""Create an association between a GCP project and a GitHub Enterprise server. Args: - request: (CancelBuildRequest) input message + request: (CloudbuildProjectsGithubEnterpriseConfigsCreateRequest) input message global_params: (StandardQueryParameters, default: None) global arguments Returns: - (Build) The response message. + (Operation) The response message. """ - config = self.GetMethodConfig('Cancel') + config = self.GetMethodConfig('Create') return self._RunMethod(config, request, global_params=global_params) - Cancel.method_config = lambda: base_api.ApiMethodInfo( - flat_path= - 'v1/projects/{projectsId}/locations/{locationsId}/builds/{buildsId}:cancel', + Create.method_config = lambda: base_api.ApiMethodInfo( + flat_path='v1/projects/{projectsId}/githubEnterpriseConfigs', http_method='POST', - method_id='cloudbuild.projects.locations.builds.cancel', - ordered_params=['name'], - path_params=['name'], - query_params=[], - relative_path='v1/{+name}:cancel', - request_field='', - request_type_name='CancelBuildRequest', - response_type_name='Build', + method_id='cloudbuild.projects.githubEnterpriseConfigs.create', + ordered_params=['parent'], + path_params=['parent'], + query_params=['gheConfigId', 'projectId'], + relative_path='v1/{+parent}/githubEnterpriseConfigs', + request_field='gitHubEnterpriseConfig', + request_type_name= + 'CloudbuildProjectsGithubEnterpriseConfigsCreateRequest', + response_type_name='Operation', supports_download=False, ) - def Create(self, request, global_params=None): - r"""Starts a build with the specified configuration. This method returns a long-running `Operation`, which includes the build ID. Pass the build ID to `GetBuild` to determine the build status (such as `SUCCESS` or `FAILURE`). + def Delete(self, request, global_params=None): + r"""Delete an association between a GCP project and a GitHub Enterprise server. Args: - request: (CloudbuildProjectsLocationsBuildsCreateRequest) input message + request: (CloudbuildProjectsGithubEnterpriseConfigsDeleteRequest) input message global_params: (StandardQueryParameters, default: None) global arguments Returns: (Operation) The response message. """ - config = self.GetMethodConfig('Create') + config = self.GetMethodConfig('Delete') return self._RunMethod(config, request, global_params=global_params) - Create.method_config = lambda: base_api.ApiMethodInfo( - flat_path='v1/projects/{projectsId}/locations/{locationsId}/builds', - http_method='POST', - method_id='cloudbuild.projects.locations.builds.create', - ordered_params=['parent'], - path_params=['parent'], - query_params=['projectId'], - relative_path='v1/{+parent}/builds', - request_field='build', - request_type_name='CloudbuildProjectsLocationsBuildsCreateRequest', + Delete.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/githubEnterpriseConfigs/{githubEnterpriseConfigsId}', + http_method='DELETE', + method_id='cloudbuild.projects.githubEnterpriseConfigs.delete', + ordered_params=['name'], + path_params=['name'], + query_params=['configId', 'projectId'], + relative_path='v1/{+name}', + request_field='', + request_type_name= + 'CloudbuildProjectsGithubEnterpriseConfigsDeleteRequest', response_type_name='Operation', supports_download=False, ) def Get(self, request, global_params=None): - r"""Returns information about a previously requested build. The `Build` that is returned includes its status (such as `SUCCESS`, `FAILURE`, or `WORKING`), and timing information. + r"""Retrieve a GitHubEnterpriseConfig. Args: - request: (CloudbuildProjectsLocationsBuildsGetRequest) input message + request: (CloudbuildProjectsGithubEnterpriseConfigsGetRequest) input message global_params: (StandardQueryParameters, default: None) global arguments Returns: - (Build) The response message. + (GitHubEnterpriseConfig) The response message. """ config = self.GetMethodConfig('Get') return self._RunMethod(config, request, global_params=global_params) Get.method_config = lambda: base_api.ApiMethodInfo( flat_path= - 'v1/projects/{projectsId}/locations/{locationsId}/builds/{buildsId}', + 'v1/projects/{projectsId}/githubEnterpriseConfigs/{githubEnterpriseConfigsId}', http_method='GET', - method_id='cloudbuild.projects.locations.builds.get', + method_id='cloudbuild.projects.githubEnterpriseConfigs.get', ordered_params=['name'], path_params=['name'], - query_params=['id', 'projectId'], + query_params=['configId', 'projectId'], relative_path='v1/{+name}', request_field='', - request_type_name='CloudbuildProjectsLocationsBuildsGetRequest', - response_type_name='Build', + request_type_name='CloudbuildProjectsGithubEnterpriseConfigsGetRequest', + response_type_name='GitHubEnterpriseConfig', supports_download=False, ) def List(self, request, global_params=None): - r"""Lists previously requested builds. Previously requested builds may still be in-progress, or may have finished successfully or unsuccessfully. + r"""List all GitHubEnterpriseConfigs for a given project. Args: - request: (CloudbuildProjectsLocationsBuildsListRequest) input message + request: (CloudbuildProjectsGithubEnterpriseConfigsListRequest) input message global_params: (StandardQueryParameters, default: None) global arguments Returns: - (ListBuildsResponse) The response message. + (ListGithubEnterpriseConfigsResponse) The response message. """ config = self.GetMethodConfig('List') return self._RunMethod(config, request, global_params=global_params) List.method_config = lambda: base_api.ApiMethodInfo( - flat_path='v1/projects/{projectsId}/locations/{locationsId}/builds', + flat_path='v1/projects/{projectsId}/githubEnterpriseConfigs', http_method='GET', - method_id='cloudbuild.projects.locations.builds.list', + method_id='cloudbuild.projects.githubEnterpriseConfigs.list', ordered_params=['parent'], path_params=['parent'], - query_params=['filter', 'pageSize', 'pageToken', 'projectId'], - relative_path='v1/{+parent}/builds', + query_params=['projectId'], + relative_path='v1/{+parent}/githubEnterpriseConfigs', request_field='', - request_type_name='CloudbuildProjectsLocationsBuildsListRequest', - response_type_name='ListBuildsResponse', + request_type_name= + 'CloudbuildProjectsGithubEnterpriseConfigsListRequest', + response_type_name='ListGithubEnterpriseConfigsResponse', supports_download=False, ) - def Retry(self, request, global_params=None): - r"""Creates a new build based on the specified build. This method creates a new build using the original build request, which may or may not result in an identical build. For triggered builds: * Triggered builds resolve to a precise revision; therefore a retry of a triggered build will result in a build that uses the same revision. For non-triggered builds that specify `RepoSource`: * If the original build built from the tip of a branch, the retried build will build from the tip of that branch, which may not be the same revision as the original build. * If the original build specified a commit sha or revision ID, the retried build will use the identical source. For builds that specify `StorageSource`: * If the original build pulled source from Google Cloud Storage without specifying the generation of the object, the new build will use the current object, which may be different from the original build source. * If the original build pulled source from Cloud Storage and specified the generation of the object, the new build will attempt to use the same object, which may or may not be available depending on the bucket's lifecycle management settings. + def Patch(self, request, global_params=None): + r"""Update an association between a GCP project and a GitHub Enterprise server. Args: - request: (RetryBuildRequest) input message + request: (CloudbuildProjectsGithubEnterpriseConfigsPatchRequest) input message global_params: (StandardQueryParameters, default: None) global arguments Returns: (Operation) The response message. """ - config = self.GetMethodConfig('Retry') + config = self.GetMethodConfig('Patch') return self._RunMethod(config, request, global_params=global_params) - Retry.method_config = lambda: base_api.ApiMethodInfo( + Patch.method_config = lambda: base_api.ApiMethodInfo( flat_path= - 'v1/projects/{projectsId}/locations/{locationsId}/builds/{buildsId}:retry', - http_method='POST', - method_id='cloudbuild.projects.locations.builds.retry', + 'v1/projects/{projectsId}/githubEnterpriseConfigs/{githubEnterpriseConfigsId}', + http_method='PATCH', + method_id='cloudbuild.projects.githubEnterpriseConfigs.patch', ordered_params=['name'], path_params=['name'], - query_params=[], - relative_path='v1/{+name}:retry', - request_field='', - request_type_name='RetryBuildRequest', + query_params=['updateMask'], + relative_path='v1/{+name}', + request_field='gitHubEnterpriseConfig', + request_type_name= + 'CloudbuildProjectsGithubEnterpriseConfigsPatchRequest', response_type_name='Operation', supports_download=False, ) - class ProjectsLocationsOperationsService(base_api.BaseApiService): - """Service class for the projects_locations_operations resource.""" + class ProjectsLocationsBitbucketServerConfigsConnectedRepositoriesService( + base_api.BaseApiService): + """Service class for the projects_locations_bitbucketServerConfigs_connectedRepositories resource.""" - _NAME = 'projects_locations_operations' + _NAME = 'projects_locations_bitbucketServerConfigs_connectedRepositories' def __init__(self, client): - super(CloudbuildV1.ProjectsLocationsOperationsService, - self).__init__(client) + super( + CloudbuildV1. + ProjectsLocationsBitbucketServerConfigsConnectedRepositoriesService, + self).__init__(client) self._upload_configs = {} - def Cancel(self, request, global_params=None): - r"""Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + def BatchCreate(self, request, global_params=None): + r"""Batch connecting Bitbucket Server repositories to Cloud Build. Args: - request: (CloudbuildProjectsLocationsOperationsCancelRequest) input message + request: (CloudbuildProjectsLocationsBitbucketServerConfigsConnectedRepositoriesBatchCreateRequest) input message global_params: (StandardQueryParameters, default: None) global arguments Returns: - (Empty) The response message. + (Operation) The response message. """ - config = self.GetMethodConfig('Cancel') + config = self.GetMethodConfig('BatchCreate') return self._RunMethod(config, request, global_params=global_params) - Cancel.method_config = lambda: base_api.ApiMethodInfo( + BatchCreate.method_config = lambda: base_api.ApiMethodInfo( flat_path= - 'v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel', + 'v1/projects/{projectsId}/locations/{locationsId}/bitbucketServerConfigs/{bitbucketServerConfigsId}/connectedRepositories:batchCreate', http_method='POST', - method_id='cloudbuild.projects.locations.operations.cancel', - ordered_params=['name'], - path_params=['name'], + method_id= + 'cloudbuild.projects.locations.bitbucketServerConfigs.connectedRepositories.batchCreate', + ordered_params=['parent'], + path_params=['parent'], query_params=[], - relative_path='v1/{+name}:cancel', - request_field='cancelOperationRequest', - request_type_name='CloudbuildProjectsLocationsOperationsCancelRequest', - response_type_name='Empty', + relative_path='v1/{+parent}/connectedRepositories:batchCreate', + request_field='batchCreateBitbucketServerConnectedRepositoriesRequest', + request_type_name= + 'CloudbuildProjectsLocationsBitbucketServerConfigsConnectedRepositoriesBatchCreateRequest', + response_type_name='Operation', supports_download=False, ) - def Get(self, request, global_params=None): - r"""Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + class ProjectsLocationsBitbucketServerConfigsReposService( + base_api.BaseApiService): + """Service class for the projects_locations_bitbucketServerConfigs_repos resource.""" + + _NAME = 'projects_locations_bitbucketServerConfigs_repos' + + def __init__(self, client): + super( + CloudbuildV1.ProjectsLocationsBitbucketServerConfigsReposService, + self).__init__(client) + self._upload_configs = {} + + def List(self, request, global_params=None): + r"""List all repositories for a given `BitbucketServerConfig`. This API is experimental. Args: - request: (CloudbuildProjectsLocationsOperationsGetRequest) input message + request: (CloudbuildProjectsLocationsBitbucketServerConfigsReposListRequest) input message global_params: (StandardQueryParameters, default: None) global arguments Returns: - (Operation) The response message. + (ListBitbucketServerRepositoriesResponse) The response message. """ - config = self.GetMethodConfig('Get') + config = self.GetMethodConfig('List') return self._RunMethod(config, request, global_params=global_params) - Get.method_config = lambda: base_api.ApiMethodInfo( + List.method_config = lambda: base_api.ApiMethodInfo( flat_path= - 'v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}', + 'v1/projects/{projectsId}/locations/{locationsId}/bitbucketServerConfigs/{bitbucketServerConfigsId}/repos', http_method='GET', - method_id='cloudbuild.projects.locations.operations.get', - ordered_params=['name'], - path_params=['name'], - query_params=[], - relative_path='v1/{+name}', + method_id= + 'cloudbuild.projects.locations.bitbucketServerConfigs.repos.list', + ordered_params=['parent'], + path_params=['parent'], + query_params=['pageSize', 'pageToken'], + relative_path='v1/{+parent}/repos', request_field='', - request_type_name='CloudbuildProjectsLocationsOperationsGetRequest', - response_type_name='Operation', + request_type_name= + 'CloudbuildProjectsLocationsBitbucketServerConfigsReposListRequest', + response_type_name='ListBitbucketServerRepositoriesResponse', supports_download=False, ) - class ProjectsLocationsService(base_api.BaseApiService): - """Service class for the projects_locations resource.""" + class ProjectsLocationsBitbucketServerConfigsService(base_api.BaseApiService): + """Service class for the projects_locations_bitbucketServerConfigs resource.""" - _NAME = 'projects_locations' + _NAME = 'projects_locations_bitbucketServerConfigs' def __init__(self, client): - super(CloudbuildV1.ProjectsLocationsService, self).__init__(client) + super(CloudbuildV1.ProjectsLocationsBitbucketServerConfigsService, + self).__init__(client) self._upload_configs = {} - class ProjectsTriggersService(base_api.BaseApiService): - """Service class for the projects_triggers resource.""" + def AddBitbucketServerConnectedRepository( + self, request, global_params=None): + r"""Add a Bitbucket Server repository to a given BitbucketServerConfig's connected repositories. This API is experimental. - _NAME = 'projects_triggers' + Args: + request: (CloudbuildProjectsLocationsBitbucketServerConfigsAddBitbucketServerConnectedRepositoryRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (AddBitbucketServerConnectedRepositoryResponse) The response message. + """ + config = self.GetMethodConfig('AddBitbucketServerConnectedRepository') + return self._RunMethod(config, request, global_params=global_params) - def __init__(self, client): - super(CloudbuildV1.ProjectsTriggersService, self).__init__(client) - self._upload_configs = {} + AddBitbucketServerConnectedRepository.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/bitbucketServerConfigs/{bitbucketServerConfigsId}:addBitbucketServerConnectedRepository', + http_method='POST', + method_id= + 'cloudbuild.projects.locations.bitbucketServerConfigs.addBitbucketServerConnectedRepository', + ordered_params=['config'], + path_params=['config'], + query_params=[], + relative_path='v1/{+config}:addBitbucketServerConnectedRepository', + request_field='addBitbucketServerConnectedRepositoryRequest', + request_type_name= + 'CloudbuildProjectsLocationsBitbucketServerConfigsAddBitbucketServerConnectedRepositoryRequest', + response_type_name='AddBitbucketServerConnectedRepositoryResponse', + supports_download=False, + ) def Create(self, request, global_params=None): - r"""Creates a new `BuildTrigger`. This API is experimental. + r"""Creates a new `BitbucketServerConfig`. This API is experimental. Args: - request: (CloudbuildProjectsTriggersCreateRequest) input message + request: (CloudbuildProjectsLocationsBitbucketServerConfigsCreateRequest) input message global_params: (StandardQueryParameters, default: None) global arguments Returns: - (BuildTrigger) The response message. + (Operation) The response message. """ config = self.GetMethodConfig('Create') return self._RunMethod(config, request, global_params=global_params) Create.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/bitbucketServerConfigs', http_method='POST', - method_id='cloudbuild.projects.triggers.create', - ordered_params=['projectId'], - path_params=['projectId'], - query_params=[], - relative_path='v1/projects/{projectId}/triggers', - request_field='buildTrigger', - request_type_name='CloudbuildProjectsTriggersCreateRequest', - response_type_name='BuildTrigger', + method_id='cloudbuild.projects.locations.bitbucketServerConfigs.create', + ordered_params=['parent'], + path_params=['parent'], + query_params=['bitbucketServerConfigId'], + relative_path='v1/{+parent}/bitbucketServerConfigs', + request_field='bitbucketServerConfig', + request_type_name= + 'CloudbuildProjectsLocationsBitbucketServerConfigsCreateRequest', + response_type_name='Operation', supports_download=False, ) def Delete(self, request, global_params=None): - r"""Deletes a `BuildTrigger` by its project ID and trigger ID. This API is experimental. + r"""Delete a `BitbucketServerConfig`. This API is experimental. Args: - request: (CloudbuildProjectsTriggersDeleteRequest) input message + request: (CloudbuildProjectsLocationsBitbucketServerConfigsDeleteRequest) input message global_params: (StandardQueryParameters, default: None) global arguments Returns: - (Empty) The response message. + (Operation) The response message. """ config = self.GetMethodConfig('Delete') return self._RunMethod(config, request, global_params=global_params) Delete.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/bitbucketServerConfigs/{bitbucketServerConfigsId}', http_method='DELETE', - method_id='cloudbuild.projects.triggers.delete', - ordered_params=['projectId', 'triggerId'], - path_params=['projectId', 'triggerId'], + method_id='cloudbuild.projects.locations.bitbucketServerConfigs.delete', + ordered_params=['name'], + path_params=['name'], query_params=[], - relative_path='v1/projects/{projectId}/triggers/{triggerId}', + relative_path='v1/{+name}', request_field='', - request_type_name='CloudbuildProjectsTriggersDeleteRequest', - response_type_name='Empty', + request_type_name= + 'CloudbuildProjectsLocationsBitbucketServerConfigsDeleteRequest', + response_type_name='Operation', supports_download=False, ) def Get(self, request, global_params=None): - r"""Returns information about a `BuildTrigger`. This API is experimental. + r"""Retrieve a `BitbucketServerConfig`. This API is experimental. Args: - request: (CloudbuildProjectsTriggersGetRequest) input message + request: (CloudbuildProjectsLocationsBitbucketServerConfigsGetRequest) input message global_params: (StandardQueryParameters, default: None) global arguments Returns: - (BuildTrigger) The response message. + (BitbucketServerConfig) The response message. """ config = self.GetMethodConfig('Get') return self._RunMethod(config, request, global_params=global_params) Get.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/bitbucketServerConfigs/{bitbucketServerConfigsId}', http_method='GET', - method_id='cloudbuild.projects.triggers.get', - ordered_params=['projectId', 'triggerId'], - path_params=['projectId', 'triggerId'], + method_id='cloudbuild.projects.locations.bitbucketServerConfigs.get', + ordered_params=['name'], + path_params=['name'], query_params=[], - relative_path='v1/projects/{projectId}/triggers/{triggerId}', + relative_path='v1/{+name}', request_field='', - request_type_name='CloudbuildProjectsTriggersGetRequest', - response_type_name='BuildTrigger', + request_type_name= + 'CloudbuildProjectsLocationsBitbucketServerConfigsGetRequest', + response_type_name='BitbucketServerConfig', supports_download=False, ) def List(self, request, global_params=None): - r"""Lists existing `BuildTrigger`s. This API is experimental. + r"""List all `BitbucketServerConfigs` for a given project. This API is experimental. Args: - request: (CloudbuildProjectsTriggersListRequest) input message + request: (CloudbuildProjectsLocationsBitbucketServerConfigsListRequest) input message global_params: (StandardQueryParameters, default: None) global arguments Returns: - (ListBuildTriggersResponse) The response message. + (ListBitbucketServerConfigsResponse) The response message. """ config = self.GetMethodConfig('List') return self._RunMethod(config, request, global_params=global_params) List.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/bitbucketServerConfigs', http_method='GET', - method_id='cloudbuild.projects.triggers.list', - ordered_params=['projectId'], - path_params=['projectId'], + method_id='cloudbuild.projects.locations.bitbucketServerConfigs.list', + ordered_params=['parent'], + path_params=['parent'], query_params=['pageSize', 'pageToken'], - relative_path='v1/projects/{projectId}/triggers', + relative_path='v1/{+parent}/bitbucketServerConfigs', request_field='', - request_type_name='CloudbuildProjectsTriggersListRequest', + request_type_name= + 'CloudbuildProjectsLocationsBitbucketServerConfigsListRequest', + response_type_name='ListBitbucketServerConfigsResponse', + supports_download=False, + ) + + def Patch(self, request, global_params=None): + r"""Updates an existing `BitbucketServerConfig`. This API is experimental. + + Args: + request: (CloudbuildProjectsLocationsBitbucketServerConfigsPatchRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Operation) The response message. + """ + config = self.GetMethodConfig('Patch') + return self._RunMethod(config, request, global_params=global_params) + + Patch.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/bitbucketServerConfigs/{bitbucketServerConfigsId}', + http_method='PATCH', + method_id='cloudbuild.projects.locations.bitbucketServerConfigs.patch', + ordered_params=['name'], + path_params=['name'], + query_params=['updateMask'], + relative_path='v1/{+name}', + request_field='bitbucketServerConfig', + request_type_name= + 'CloudbuildProjectsLocationsBitbucketServerConfigsPatchRequest', + response_type_name='Operation', + supports_download=False, + ) + + def RemoveBitbucketServerConnectedRepository( + self, request, global_params=None): + r"""Remove a Bitbucket Server repository from an given BitbucketServerConfig's connected repositories. This API is experimental. + + Args: + request: (CloudbuildProjectsLocationsBitbucketServerConfigsRemoveBitbucketServerConnectedRepositoryRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Empty) The response message. + """ + config = self.GetMethodConfig('RemoveBitbucketServerConnectedRepository') + return self._RunMethod(config, request, global_params=global_params) + + RemoveBitbucketServerConnectedRepository.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/bitbucketServerConfigs/{bitbucketServerConfigsId}:removeBitbucketServerConnectedRepository', + http_method='POST', + method_id= + 'cloudbuild.projects.locations.bitbucketServerConfigs.removeBitbucketServerConnectedRepository', + ordered_params=['config'], + path_params=['config'], + query_params=[], + relative_path='v1/{+config}:removeBitbucketServerConnectedRepository', + request_field='removeBitbucketServerConnectedRepositoryRequest', + request_type_name= + 'CloudbuildProjectsLocationsBitbucketServerConfigsRemoveBitbucketServerConnectedRepositoryRequest', + response_type_name='Empty', + supports_download=False, + ) + + class ProjectsLocationsBuildsService(base_api.BaseApiService): + """Service class for the projects_locations_builds resource.""" + + _NAME = 'projects_locations_builds' + + def __init__(self, client): + super(CloudbuildV1.ProjectsLocationsBuildsService, self).__init__(client) + self._upload_configs = {} + + def Approve(self, request, global_params=None): + r"""Approves or rejects a pending build. If approved, the returned LRO will be analogous to the LRO returned from a CreateBuild call. If rejected, the returned LRO will be immediately done. + + Args: + request: (CloudbuildProjectsLocationsBuildsApproveRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Operation) The response message. + """ + config = self.GetMethodConfig('Approve') + return self._RunMethod(config, request, global_params=global_params) + + Approve.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/builds/{buildsId}:approve', + http_method='POST', + method_id='cloudbuild.projects.locations.builds.approve', + ordered_params=['name'], + path_params=['name'], + query_params=[], + relative_path='v1/{+name}:approve', + request_field='approveBuildRequest', + request_type_name='CloudbuildProjectsLocationsBuildsApproveRequest', + response_type_name='Operation', + supports_download=False, + ) + + def Cancel(self, request, global_params=None): + r"""Cancels a build in progress. + + Args: + request: (CancelBuildRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Build) The response message. + """ + config = self.GetMethodConfig('Cancel') + return self._RunMethod(config, request, global_params=global_params) + + Cancel.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/builds/{buildsId}:cancel', + http_method='POST', + method_id='cloudbuild.projects.locations.builds.cancel', + ordered_params=['name'], + path_params=['name'], + query_params=[], + relative_path='v1/{+name}:cancel', + request_field='', + request_type_name='CancelBuildRequest', + response_type_name='Build', + supports_download=False, + ) + + def Create(self, request, global_params=None): + r"""Starts a build with the specified configuration. This method returns a long-running `Operation`, which includes the build ID. Pass the build ID to `GetBuild` to determine the build status (such as `SUCCESS` or `FAILURE`). + + Args: + request: (CloudbuildProjectsLocationsBuildsCreateRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Operation) The response message. + """ + config = self.GetMethodConfig('Create') + return self._RunMethod(config, request, global_params=global_params) + + Create.method_config = lambda: base_api.ApiMethodInfo( + flat_path='v1/projects/{projectsId}/locations/{locationsId}/builds', + http_method='POST', + method_id='cloudbuild.projects.locations.builds.create', + ordered_params=['parent'], + path_params=['parent'], + query_params=['projectId'], + relative_path='v1/{+parent}/builds', + request_field='build', + request_type_name='CloudbuildProjectsLocationsBuildsCreateRequest', + response_type_name='Operation', + supports_download=False, + ) + + def Get(self, request, global_params=None): + r"""Returns information about a previously requested build. The `Build` that is returned includes its status (such as `SUCCESS`, `FAILURE`, or `WORKING`), and timing information. + + Args: + request: (CloudbuildProjectsLocationsBuildsGetRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Build) The response message. + """ + config = self.GetMethodConfig('Get') + return self._RunMethod(config, request, global_params=global_params) + + Get.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/builds/{buildsId}', + http_method='GET', + method_id='cloudbuild.projects.locations.builds.get', + ordered_params=['name'], + path_params=['name'], + query_params=['id', 'projectId'], + relative_path='v1/{+name}', + request_field='', + request_type_name='CloudbuildProjectsLocationsBuildsGetRequest', + response_type_name='Build', + supports_download=False, + ) + + def List(self, request, global_params=None): + r"""Lists previously requested builds. Previously requested builds may still be in-progress, or may have finished successfully or unsuccessfully. + + Args: + request: (CloudbuildProjectsLocationsBuildsListRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (ListBuildsResponse) The response message. + """ + config = self.GetMethodConfig('List') + return self._RunMethod(config, request, global_params=global_params) + + List.method_config = lambda: base_api.ApiMethodInfo( + flat_path='v1/projects/{projectsId}/locations/{locationsId}/builds', + http_method='GET', + method_id='cloudbuild.projects.locations.builds.list', + ordered_params=['parent'], + path_params=['parent'], + query_params=['filter', 'pageSize', 'pageToken', 'projectId'], + relative_path='v1/{+parent}/builds', + request_field='', + request_type_name='CloudbuildProjectsLocationsBuildsListRequest', + response_type_name='ListBuildsResponse', + supports_download=False, + ) + + def Retry(self, request, global_params=None): + r"""Creates a new build based on the specified build. This method creates a new build using the original build request, which may or may not result in an identical build. For triggered builds: * Triggered builds resolve to a precise revision; therefore a retry of a triggered build will result in a build that uses the same revision. For non-triggered builds that specify `RepoSource`: * If the original build built from the tip of a branch, the retried build will build from the tip of that branch, which may not be the same revision as the original build. * If the original build specified a commit sha or revision ID, the retried build will use the identical source. For builds that specify `StorageSource`: * If the original build pulled source from Google Cloud Storage without specifying the generation of the object, the new build will use the current object, which may be different from the original build source. * If the original build pulled source from Cloud Storage and specified the generation of the object, the new build will attempt to use the same object, which may or may not be available depending on the bucket's lifecycle management settings. + + Args: + request: (RetryBuildRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Operation) The response message. + """ + config = self.GetMethodConfig('Retry') + return self._RunMethod(config, request, global_params=global_params) + + Retry.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/builds/{buildsId}:retry', + http_method='POST', + method_id='cloudbuild.projects.locations.builds.retry', + ordered_params=['name'], + path_params=['name'], + query_params=[], + relative_path='v1/{+name}:retry', + request_field='', + request_type_name='RetryBuildRequest', + response_type_name='Operation', + supports_download=False, + ) + + class ProjectsLocationsGithubEnterpriseConfigsService(base_api.BaseApiService + ): + """Service class for the projects_locations_githubEnterpriseConfigs resource.""" + + _NAME = 'projects_locations_githubEnterpriseConfigs' + + def __init__(self, client): + super(CloudbuildV1.ProjectsLocationsGithubEnterpriseConfigsService, + self).__init__(client) + self._upload_configs = {} + + def Create(self, request, global_params=None): + r"""Create an association between a GCP project and a GitHub Enterprise server. + + Args: + request: (CloudbuildProjectsLocationsGithubEnterpriseConfigsCreateRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Operation) The response message. + """ + config = self.GetMethodConfig('Create') + return self._RunMethod(config, request, global_params=global_params) + + Create.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/githubEnterpriseConfigs', + http_method='POST', + method_id= + 'cloudbuild.projects.locations.githubEnterpriseConfigs.create', + ordered_params=['parent'], + path_params=['parent'], + query_params=['gheConfigId', 'projectId'], + relative_path='v1/{+parent}/githubEnterpriseConfigs', + request_field='gitHubEnterpriseConfig', + request_type_name= + 'CloudbuildProjectsLocationsGithubEnterpriseConfigsCreateRequest', + response_type_name='Operation', + supports_download=False, + ) + + def Delete(self, request, global_params=None): + r"""Delete an association between a GCP project and a GitHub Enterprise server. + + Args: + request: (CloudbuildProjectsLocationsGithubEnterpriseConfigsDeleteRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Operation) The response message. + """ + config = self.GetMethodConfig('Delete') + return self._RunMethod(config, request, global_params=global_params) + + Delete.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/githubEnterpriseConfigs/{githubEnterpriseConfigsId}', + http_method='DELETE', + method_id= + 'cloudbuild.projects.locations.githubEnterpriseConfigs.delete', + ordered_params=['name'], + path_params=['name'], + query_params=['configId', 'projectId'], + relative_path='v1/{+name}', + request_field='', + request_type_name= + 'CloudbuildProjectsLocationsGithubEnterpriseConfigsDeleteRequest', + response_type_name='Operation', + supports_download=False, + ) + + def Get(self, request, global_params=None): + r"""Retrieve a GitHubEnterpriseConfig. + + Args: + request: (CloudbuildProjectsLocationsGithubEnterpriseConfigsGetRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (GitHubEnterpriseConfig) The response message. + """ + config = self.GetMethodConfig('Get') + return self._RunMethod(config, request, global_params=global_params) + + Get.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/githubEnterpriseConfigs/{githubEnterpriseConfigsId}', + http_method='GET', + method_id='cloudbuild.projects.locations.githubEnterpriseConfigs.get', + ordered_params=['name'], + path_params=['name'], + query_params=['configId', 'projectId'], + relative_path='v1/{+name}', + request_field='', + request_type_name= + 'CloudbuildProjectsLocationsGithubEnterpriseConfigsGetRequest', + response_type_name='GitHubEnterpriseConfig', + supports_download=False, + ) + + def List(self, request, global_params=None): + r"""List all GitHubEnterpriseConfigs for a given project. + + Args: + request: (CloudbuildProjectsLocationsGithubEnterpriseConfigsListRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (ListGithubEnterpriseConfigsResponse) The response message. + """ + config = self.GetMethodConfig('List') + return self._RunMethod(config, request, global_params=global_params) + + List.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/githubEnterpriseConfigs', + http_method='GET', + method_id='cloudbuild.projects.locations.githubEnterpriseConfigs.list', + ordered_params=['parent'], + path_params=['parent'], + query_params=['projectId'], + relative_path='v1/{+parent}/githubEnterpriseConfigs', + request_field='', + request_type_name= + 'CloudbuildProjectsLocationsGithubEnterpriseConfigsListRequest', + response_type_name='ListGithubEnterpriseConfigsResponse', + supports_download=False, + ) + + def Patch(self, request, global_params=None): + r"""Update an association between a GCP project and a GitHub Enterprise server. + + Args: + request: (CloudbuildProjectsLocationsGithubEnterpriseConfigsPatchRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Operation) The response message. + """ + config = self.GetMethodConfig('Patch') + return self._RunMethod(config, request, global_params=global_params) + + Patch.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/githubEnterpriseConfigs/{githubEnterpriseConfigsId}', + http_method='PATCH', + method_id='cloudbuild.projects.locations.githubEnterpriseConfigs.patch', + ordered_params=['name'], + path_params=['name'], + query_params=['updateMask'], + relative_path='v1/{+name}', + request_field='gitHubEnterpriseConfig', + request_type_name= + 'CloudbuildProjectsLocationsGithubEnterpriseConfigsPatchRequest', + response_type_name='Operation', + supports_download=False, + ) + + class ProjectsLocationsOperationsService(base_api.BaseApiService): + """Service class for the projects_locations_operations resource.""" + + _NAME = 'projects_locations_operations' + + def __init__(self, client): + super(CloudbuildV1.ProjectsLocationsOperationsService, + self).__init__(client) + self._upload_configs = {} + + def Cancel(self, request, global_params=None): + r"""Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + + Args: + request: (CloudbuildProjectsLocationsOperationsCancelRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Empty) The response message. + """ + config = self.GetMethodConfig('Cancel') + return self._RunMethod(config, request, global_params=global_params) + + Cancel.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel', + http_method='POST', + method_id='cloudbuild.projects.locations.operations.cancel', + ordered_params=['name'], + path_params=['name'], + query_params=[], + relative_path='v1/{+name}:cancel', + request_field='cancelOperationRequest', + request_type_name='CloudbuildProjectsLocationsOperationsCancelRequest', + response_type_name='Empty', + supports_download=False, + ) + + def Get(self, request, global_params=None): + r"""Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. + + Args: + request: (CloudbuildProjectsLocationsOperationsGetRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Operation) The response message. + """ + config = self.GetMethodConfig('Get') + return self._RunMethod(config, request, global_params=global_params) + + Get.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}', + http_method='GET', + method_id='cloudbuild.projects.locations.operations.get', + ordered_params=['name'], + path_params=['name'], + query_params=[], + relative_path='v1/{+name}', + request_field='', + request_type_name='CloudbuildProjectsLocationsOperationsGetRequest', + response_type_name='Operation', + supports_download=False, + ) + + class ProjectsLocationsTriggersService(base_api.BaseApiService): + """Service class for the projects_locations_triggers resource.""" + + _NAME = 'projects_locations_triggers' + + def __init__(self, client): + super(CloudbuildV1.ProjectsLocationsTriggersService, + self).__init__(client) + self._upload_configs = {} + + def Create(self, request, global_params=None): + r"""Creates a new `BuildTrigger`. This API is experimental. + + Args: + request: (CloudbuildProjectsLocationsTriggersCreateRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (BuildTrigger) The response message. + """ + config = self.GetMethodConfig('Create') + return self._RunMethod(config, request, global_params=global_params) + + Create.method_config = lambda: base_api.ApiMethodInfo( + flat_path='v1/projects/{projectsId}/locations/{locationsId}/triggers', + http_method='POST', + method_id='cloudbuild.projects.locations.triggers.create', + ordered_params=['parent'], + path_params=['parent'], + query_params=['projectId'], + relative_path='v1/{+parent}/triggers', + request_field='buildTrigger', + request_type_name='CloudbuildProjectsLocationsTriggersCreateRequest', + response_type_name='BuildTrigger', + supports_download=False, + ) + + def Delete(self, request, global_params=None): + r"""Deletes a `BuildTrigger` by its project ID and trigger ID. This API is experimental. + + Args: + request: (CloudbuildProjectsLocationsTriggersDeleteRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Empty) The response message. + """ + config = self.GetMethodConfig('Delete') + return self._RunMethod(config, request, global_params=global_params) + + Delete.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/triggers/{triggersId}', + http_method='DELETE', + method_id='cloudbuild.projects.locations.triggers.delete', + ordered_params=['name'], + path_params=['name'], + query_params=['projectId', 'triggerId'], + relative_path='v1/{+name}', + request_field='', + request_type_name='CloudbuildProjectsLocationsTriggersDeleteRequest', + response_type_name='Empty', + supports_download=False, + ) + + def Get(self, request, global_params=None): + r"""Returns information about a `BuildTrigger`. This API is experimental. + + Args: + request: (CloudbuildProjectsLocationsTriggersGetRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (BuildTrigger) The response message. + """ + config = self.GetMethodConfig('Get') + return self._RunMethod(config, request, global_params=global_params) + + Get.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/triggers/{triggersId}', + http_method='GET', + method_id='cloudbuild.projects.locations.triggers.get', + ordered_params=['name'], + path_params=['name'], + query_params=['projectId', 'triggerId'], + relative_path='v1/{+name}', + request_field='', + request_type_name='CloudbuildProjectsLocationsTriggersGetRequest', + response_type_name='BuildTrigger', + supports_download=False, + ) + + def List(self, request, global_params=None): + r"""Lists existing `BuildTrigger`s. This API is experimental. + + Args: + request: (CloudbuildProjectsLocationsTriggersListRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (ListBuildTriggersResponse) The response message. + """ + config = self.GetMethodConfig('List') + return self._RunMethod(config, request, global_params=global_params) + + List.method_config = lambda: base_api.ApiMethodInfo( + flat_path='v1/projects/{projectsId}/locations/{locationsId}/triggers', + http_method='GET', + method_id='cloudbuild.projects.locations.triggers.list', + ordered_params=['parent'], + path_params=['parent'], + query_params=['pageSize', 'pageToken', 'projectId'], + relative_path='v1/{+parent}/triggers', + request_field='', + request_type_name='CloudbuildProjectsLocationsTriggersListRequest', + response_type_name='ListBuildTriggersResponse', + supports_download=False, + ) + + def Patch(self, request, global_params=None): + r"""Updates a `BuildTrigger` by its project ID and trigger ID. This API is experimental. + + Args: + request: (CloudbuildProjectsLocationsTriggersPatchRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (BuildTrigger) The response message. + """ + config = self.GetMethodConfig('Patch') + return self._RunMethod(config, request, global_params=global_params) + + Patch.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/triggers/{triggersId}', + http_method='PATCH', + method_id='cloudbuild.projects.locations.triggers.patch', + ordered_params=['resourceName'], + path_params=['resourceName'], + query_params=['projectId', 'triggerId'], + relative_path='v1/{+resourceName}', + request_field='buildTrigger', + request_type_name='CloudbuildProjectsLocationsTriggersPatchRequest', + response_type_name='BuildTrigger', + supports_download=False, + ) + + def Run(self, request, global_params=None): + r"""Runs a `BuildTrigger` at a particular source revision. + + Args: + request: (CloudbuildProjectsLocationsTriggersRunRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Operation) The response message. + """ + config = self.GetMethodConfig('Run') + return self._RunMethod(config, request, global_params=global_params) + + Run.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/triggers/{triggersId}:run', + http_method='POST', + method_id='cloudbuild.projects.locations.triggers.run', + ordered_params=['name'], + path_params=['name'], + query_params=[], + relative_path='v1/{+name}:run', + request_field='runBuildTriggerRequest', + request_type_name='CloudbuildProjectsLocationsTriggersRunRequest', + response_type_name='Operation', + supports_download=False, + ) + + def Webhook(self, request, global_params=None): + r"""ReceiveTriggerWebhook [Experimental] is called when the API receives a webhook request targeted at a specific trigger. + + Args: + request: (CloudbuildProjectsLocationsTriggersWebhookRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (ReceiveTriggerWebhookResponse) The response message. + """ + config = self.GetMethodConfig('Webhook') + return self._RunMethod(config, request, global_params=global_params) + + Webhook.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/triggers/{triggersId}:webhook', + http_method='POST', + method_id='cloudbuild.projects.locations.triggers.webhook', + ordered_params=['name'], + path_params=['name'], + query_params=['projectId', 'secret', 'trigger'], + relative_path='v1/{+name}:webhook', + request_field='httpBody', + request_type_name='CloudbuildProjectsLocationsTriggersWebhookRequest', + response_type_name='ReceiveTriggerWebhookResponse', + supports_download=False, + ) + + class ProjectsLocationsWorkerPoolsService(base_api.BaseApiService): + """Service class for the projects_locations_workerPools resource.""" + + _NAME = 'projects_locations_workerPools' + + def __init__(self, client): + super(CloudbuildV1.ProjectsLocationsWorkerPoolsService, + self).__init__(client) + self._upload_configs = {} + + def Create(self, request, global_params=None): + r"""Creates a `WorkerPool`. + + Args: + request: (CloudbuildProjectsLocationsWorkerPoolsCreateRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Operation) The response message. + """ + config = self.GetMethodConfig('Create') + return self._RunMethod(config, request, global_params=global_params) + + Create.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/workerPools', + http_method='POST', + method_id='cloudbuild.projects.locations.workerPools.create', + ordered_params=['parent'], + path_params=['parent'], + query_params=['validateOnly', 'workerPoolId'], + relative_path='v1/{+parent}/workerPools', + request_field='workerPool', + request_type_name='CloudbuildProjectsLocationsWorkerPoolsCreateRequest', + response_type_name='Operation', + supports_download=False, + ) + + def Delete(self, request, global_params=None): + r"""Deletes a `WorkerPool`. + + Args: + request: (CloudbuildProjectsLocationsWorkerPoolsDeleteRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Operation) The response message. + """ + config = self.GetMethodConfig('Delete') + return self._RunMethod(config, request, global_params=global_params) + + Delete.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/workerPools/{workerPoolsId}', + http_method='DELETE', + method_id='cloudbuild.projects.locations.workerPools.delete', + ordered_params=['name'], + path_params=['name'], + query_params=['allowMissing', 'etag', 'validateOnly'], + relative_path='v1/{+name}', + request_field='', + request_type_name='CloudbuildProjectsLocationsWorkerPoolsDeleteRequest', + response_type_name='Operation', + supports_download=False, + ) + + def Get(self, request, global_params=None): + r"""Returns details of a `WorkerPool`. + + Args: + request: (CloudbuildProjectsLocationsWorkerPoolsGetRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (WorkerPool) The response message. + """ + config = self.GetMethodConfig('Get') + return self._RunMethod(config, request, global_params=global_params) + + Get.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/workerPools/{workerPoolsId}', + http_method='GET', + method_id='cloudbuild.projects.locations.workerPools.get', + ordered_params=['name'], + path_params=['name'], + query_params=[], + relative_path='v1/{+name}', + request_field='', + request_type_name='CloudbuildProjectsLocationsWorkerPoolsGetRequest', + response_type_name='WorkerPool', + supports_download=False, + ) + + def List(self, request, global_params=None): + r"""Lists `WorkerPool`s. + + Args: + request: (CloudbuildProjectsLocationsWorkerPoolsListRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (ListWorkerPoolsResponse) The response message. + """ + config = self.GetMethodConfig('List') + return self._RunMethod(config, request, global_params=global_params) + + List.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/workerPools', + http_method='GET', + method_id='cloudbuild.projects.locations.workerPools.list', + ordered_params=['parent'], + path_params=['parent'], + query_params=['pageSize', 'pageToken'], + relative_path='v1/{+parent}/workerPools', + request_field='', + request_type_name='CloudbuildProjectsLocationsWorkerPoolsListRequest', + response_type_name='ListWorkerPoolsResponse', + supports_download=False, + ) + + def Patch(self, request, global_params=None): + r"""Updates a `WorkerPool`. + + Args: + request: (CloudbuildProjectsLocationsWorkerPoolsPatchRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Operation) The response message. + """ + config = self.GetMethodConfig('Patch') + return self._RunMethod(config, request, global_params=global_params) + + Patch.method_config = lambda: base_api.ApiMethodInfo( + flat_path= + 'v1/projects/{projectsId}/locations/{locationsId}/workerPools/{workerPoolsId}', + http_method='PATCH', + method_id='cloudbuild.projects.locations.workerPools.patch', + ordered_params=['name'], + path_params=['name'], + query_params=['updateMask', 'validateOnly'], + relative_path='v1/{+name}', + request_field='workerPool', + request_type_name='CloudbuildProjectsLocationsWorkerPoolsPatchRequest', + response_type_name='Operation', + supports_download=False, + ) + + class ProjectsLocationsService(base_api.BaseApiService): + """Service class for the projects_locations resource.""" + + _NAME = 'projects_locations' + + def __init__(self, client): + super(CloudbuildV1.ProjectsLocationsService, self).__init__(client) + self._upload_configs = {} + + class ProjectsTriggersService(base_api.BaseApiService): + """Service class for the projects_triggers resource.""" + + _NAME = 'projects_triggers' + + def __init__(self, client): + super(CloudbuildV1.ProjectsTriggersService, self).__init__(client) + self._upload_configs = {} + + def Create(self, request, global_params=None): + r"""Creates a new `BuildTrigger`. This API is experimental. + + Args: + request: (CloudbuildProjectsTriggersCreateRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (BuildTrigger) The response message. + """ + config = self.GetMethodConfig('Create') + return self._RunMethod(config, request, global_params=global_params) + + Create.method_config = lambda: base_api.ApiMethodInfo( + http_method='POST', + method_id='cloudbuild.projects.triggers.create', + ordered_params=['projectId'], + path_params=['projectId'], + query_params=['parent'], + relative_path='v1/projects/{projectId}/triggers', + request_field='buildTrigger', + request_type_name='CloudbuildProjectsTriggersCreateRequest', + response_type_name='BuildTrigger', + supports_download=False, + ) + + def Delete(self, request, global_params=None): + r"""Deletes a `BuildTrigger` by its project ID and trigger ID. This API is experimental. + + Args: + request: (CloudbuildProjectsTriggersDeleteRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Empty) The response message. + """ + config = self.GetMethodConfig('Delete') + return self._RunMethod(config, request, global_params=global_params) + + Delete.method_config = lambda: base_api.ApiMethodInfo( + http_method='DELETE', + method_id='cloudbuild.projects.triggers.delete', + ordered_params=['projectId', 'triggerId'], + path_params=['projectId', 'triggerId'], + query_params=['name'], + relative_path='v1/projects/{projectId}/triggers/{triggerId}', + request_field='', + request_type_name='CloudbuildProjectsTriggersDeleteRequest', + response_type_name='Empty', + supports_download=False, + ) + + def Get(self, request, global_params=None): + r"""Returns information about a `BuildTrigger`. This API is experimental. + + Args: + request: (CloudbuildProjectsTriggersGetRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (BuildTrigger) The response message. + """ + config = self.GetMethodConfig('Get') + return self._RunMethod(config, request, global_params=global_params) + + Get.method_config = lambda: base_api.ApiMethodInfo( + http_method='GET', + method_id='cloudbuild.projects.triggers.get', + ordered_params=['projectId', 'triggerId'], + path_params=['projectId', 'triggerId'], + query_params=['name'], + relative_path='v1/projects/{projectId}/triggers/{triggerId}', + request_field='', + request_type_name='CloudbuildProjectsTriggersGetRequest', + response_type_name='BuildTrigger', + supports_download=False, + ) + + def List(self, request, global_params=None): + r"""Lists existing `BuildTrigger`s. This API is experimental. + + Args: + request: (CloudbuildProjectsTriggersListRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (ListBuildTriggersResponse) The response message. + """ + config = self.GetMethodConfig('List') + return self._RunMethod(config, request, global_params=global_params) + + List.method_config = lambda: base_api.ApiMethodInfo( + http_method='GET', + method_id='cloudbuild.projects.triggers.list', + ordered_params=['projectId'], + path_params=['projectId'], + query_params=['pageSize', 'pageToken', 'parent'], + relative_path='v1/projects/{projectId}/triggers', + request_field='', + request_type_name='CloudbuildProjectsTriggersListRequest', response_type_name='ListBuildTriggersResponse', supports_download=False, ) @@ -643,7 +1682,7 @@ def Run(self, request, global_params=None): method_id='cloudbuild.projects.triggers.run', ordered_params=['projectId', 'triggerId'], path_params=['projectId', 'triggerId'], - query_params=[], + query_params=['name'], relative_path='v1/projects/{projectId}/triggers/{triggerId}:run', request_field='repoSource', request_type_name='CloudbuildProjectsTriggersRunRequest', @@ -668,7 +1707,7 @@ def Webhook(self, request, global_params=None): method_id='cloudbuild.projects.triggers.webhook', ordered_params=['projectId', 'trigger'], path_params=['projectId', 'trigger'], - query_params=['secret'], + query_params=['name', 'secret'], relative_path='v1/projects/{projectId}/triggers/{trigger}:webhook', request_field='httpBody', request_type_name='CloudbuildProjectsTriggersWebhookRequest', @@ -684,3 +1723,37 @@ class ProjectsService(base_api.BaseApiService): def __init__(self, client): super(CloudbuildV1.ProjectsService, self).__init__(client) self._upload_configs = {} + + class V1Service(base_api.BaseApiService): + """Service class for the v1 resource.""" + + _NAME = 'v1' + + def __init__(self, client): + super(CloudbuildV1.V1Service, self).__init__(client) + self._upload_configs = {} + + def Webhook(self, request, global_params=None): + r"""ReceiveWebhook is called when the API receives a GitHub webhook. + + Args: + request: (CloudbuildWebhookRequest) input message + global_params: (StandardQueryParameters, default: None) global arguments + Returns: + (Empty) The response message. + """ + config = self.GetMethodConfig('Webhook') + return self._RunMethod(config, request, global_params=global_params) + + Webhook.method_config = lambda: base_api.ApiMethodInfo( + http_method='POST', + method_id='cloudbuild.webhook', + ordered_params=[], + path_params=[], + query_params=['webhookKey'], + relative_path='v1/webhook', + request_field='httpBody', + request_type_name='CloudbuildWebhookRequest', + response_type_name='Empty', + supports_download=False, + ) diff --git a/sdks/python/apache_beam/runners/dataflow/internal/clients/cloudbuild/cloudbuild_v1_messages.py b/sdks/python/apache_beam/runners/dataflow/internal/clients/cloudbuild/cloudbuild_v1_messages.py index 9dbef65b21372..1e3a75efcc0b1 100644 --- a/sdks/python/apache_beam/runners/dataflow/internal/clients/cloudbuild/cloudbuild_v1_messages.py +++ b/sdks/python/apache_beam/runners/dataflow/internal/clients/cloudbuild/cloudbuild_v1_messages.py @@ -21,6 +21,11 @@ """ # NOTE: This file is autogenerated and should not be edited by hand. # mypy: ignore-errors +# To regenerate the client: +# pip install google-apitools[cli] +# gen_client --discovery_url=cloudbuild.v1 --overwrite \ +# --outdir=apache_beam/runners/dataflow/internal/clients/cloudbuild \ +# --root_package=. client from apitools.base.protorpclite import messages as _messages from apitools.base.py import encoding @@ -29,6 +34,92 @@ package = 'cloudbuild' +class AddBitbucketServerConnectedRepositoryRequest(_messages.Message): + r"""RPC request object accepted by the AddBitbucketServerConnectedRepository + RPC method. + + Fields: + connectedRepository: The connected repository to add. + """ + + connectedRepository = _messages.MessageField('BitbucketServerRepositoryId', 1) + + +class AddBitbucketServerConnectedRepositoryResponse(_messages.Message): + r"""RPC request object returned by the AddBitbucketServerConnectedRepository + RPC method. + + Fields: + config: The name of the `BitbucketServerConfig` that added connected + repository. Format: `projects/{project}/locations/{location}/bitbucketSe + rverConfigs/{config}` + connectedRepository: The connected repository. + """ + + config = _messages.StringField(1) + connectedRepository = _messages.MessageField('BitbucketServerRepositoryId', 2) + + +class ApprovalConfig(_messages.Message): + r"""ApprovalConfig describes configuration for manual approval of a build. + + Fields: + approvalRequired: Whether or not approval is needed. If this is set on a + build, it will become pending when created, and will need to be + explicitly approved to start. + """ + + approvalRequired = _messages.BooleanField(1) + + +class ApprovalResult(_messages.Message): + r"""ApprovalResult describes the decision and associated metadata of a + manual approval of a build. + + Enums: + DecisionValueValuesEnum: Required. The decision of this manual approval. + + Fields: + approvalTime: Output only. The time when the approval decision was made. + approverAccount: Output only. Email of the user that called the + ApproveBuild API to approve or reject a build at the time that the API + was called. + comment: Optional. An optional comment for this manual approval result. + decision: Required. The decision of this manual approval. + url: Optional. An optional URL tied to this manual approval result. This + field is essentially the same as comment, except that it will be + rendered by the UI differently. An example use case is a link to an + external job that approved this Build. + """ + class DecisionValueValuesEnum(_messages.Enum): + r"""Required. The decision of this manual approval. + + Values: + DECISION_UNSPECIFIED: Default enum type. This should not be used. + APPROVED: Build is approved. + REJECTED: Build is rejected. + """ + DECISION_UNSPECIFIED = 0 + APPROVED = 1 + REJECTED = 2 + + approvalTime = _messages.StringField(1) + approverAccount = _messages.StringField(2) + comment = _messages.StringField(3) + decision = _messages.EnumField('DecisionValueValuesEnum', 4) + url = _messages.StringField(5) + + +class ApproveBuildRequest(_messages.Message): + r"""Request to approve or reject a pending build. + + Fields: + approvalResult: Approval decision and metadata. + """ + + approvalResult = _messages.MessageField('ApprovalResult', 1) + + class ArtifactObjects(_messages.Message): r"""Files in the workspace to upload to Cloud Storage upon successful completion of all build steps. @@ -87,19 +178,212 @@ class Artifacts(_messages.Message): objects = _messages.MessageField('ArtifactObjects', 2) +class BatchCreateBitbucketServerConnectedRepositoriesRequest(_messages.Message): + r"""RPC request object accepted by + BatchCreateBitbucketServerConnectedRepositories RPC method. + + Fields: + requests: Required. Requests to connect Bitbucket Server repositories. + """ + + requests = _messages.MessageField( + 'CreateBitbucketServerConnectedRepositoryRequest', 1, repeated=True) + + +class BatchCreateBitbucketServerConnectedRepositoriesResponse(_messages.Message + ): + r"""Response of BatchCreateBitbucketServerConnectedRepositories RPC method + including all successfully connected Bitbucket Server repositories. + + Fields: + bitbucketServerConnectedRepositories: The connected Bitbucket Server + repositories. + """ + + bitbucketServerConnectedRepositories = _messages.MessageField( + 'BitbucketServerConnectedRepository', 1, repeated=True) + + +class BatchCreateBitbucketServerConnectedRepositoriesResponseMetadata( + _messages.Message): + r"""Metadata for `BatchCreateBitbucketServerConnectedRepositories` + operation. + + Fields: + completeTime: Time the operation was completed. + config: The name of the `BitbucketServerConfig` that added connected + repositories. Format: `projects/{project}/locations/{location}/bitbucket + ServerConfigs/{config}` + createTime: Time the operation was created. + """ + + completeTime = _messages.StringField(1) + config = _messages.StringField(2) + createTime = _messages.StringField(3) + + +class BitbucketServerConfig(_messages.Message): + r"""BitbucketServerConfig represents the configuration for a Bitbucket + Server. + + Fields: + apiKey: Required. Immutable. API Key that will be attached to webhook. + Once this field has been set, it cannot be changed. If you need to + change it, please create another BitbucketServerConfig. + connectedRepositories: Output only. Connected Bitbucket Server + repositories for this config. + createTime: Time when the config was created. + hostUri: Required. Immutable. The URI of the Bitbucket Server host. Once + this field has been set, it cannot be changed. If you need to change it, + please create another BitbucketServerConfig. + name: The resource name for the config. + peeredNetwork: Optional. The network to be used when reaching out to the + Bitbucket Server instance. The VPC network must be enabled for private + service connection. This should be set if the Bitbucket Server instance + is hosted on-premises and not reachable by public internet. If this + field is left empty, no network peering will occur and calls to the + Bitbucket Server instance will be made over the public internet. Must be + in the format `projects/{project}/global/networks/{network}`, where + {project} is a project number or id and {network} is the name of a VPC + network in the project. + secrets: Required. Secret Manager secrets needed by the config. + sslCa: Optional. SSL certificate to use for requests to Bitbucket Server. + The format should be PEM format but the extension can be one of .pem, + .cer, or .crt. + username: Username of the account Cloud Build will use on Bitbucket + Server. + webhookKey: Output only. UUID included in webhook requests. The UUID is + used to look up the corresponding config. + """ + + apiKey = _messages.StringField(1) + connectedRepositories = _messages.MessageField( + 'BitbucketServerRepositoryId', 2, repeated=True) + createTime = _messages.StringField(3) + hostUri = _messages.StringField(4) + name = _messages.StringField(5) + peeredNetwork = _messages.StringField(6) + secrets = _messages.MessageField('BitbucketServerSecrets', 7) + sslCa = _messages.StringField(8) + username = _messages.StringField(9) + webhookKey = _messages.StringField(10) + + +class BitbucketServerConnectedRepository(_messages.Message): + r"""/ BitbucketServerConnectedRepository represents a connected Bitbucket + Server / repository. + + Fields: + parent: The name of the `BitbucketServerConfig` that added connected + repository. Format: `projects/{project}/locations/{location}/bitbucketSe + rverConfigs/{config}` + repo: The Bitbucket Server repositories to connect. + status: Output only. The status of the repo connection request. + """ + + parent = _messages.StringField(1) + repo = _messages.MessageField('BitbucketServerRepositoryId', 2) + status = _messages.MessageField('Status', 3) + + +class BitbucketServerRepository(_messages.Message): + r"""BitbucketServerRepository represents a repository hosted on a Bitbucket + Server. + + Fields: + browseUri: Link to the browse repo page on the Bitbucket Server instance. + description: Description of the repository. + displayName: Display name of the repository. + name: The resource name of the repository. + repoId: Identifier for a repository hosted on a Bitbucket Server. + """ + + browseUri = _messages.StringField(1) + description = _messages.StringField(2) + displayName = _messages.StringField(3) + name = _messages.StringField(4) + repoId = _messages.MessageField('BitbucketServerRepositoryId', 5) + + +class BitbucketServerRepositoryId(_messages.Message): + r"""BitbucketServerRepositoryId identifies a specific repository hosted on a + Bitbucket Server. + + Fields: + projectKey: Required. Identifier for the project storing the repository. + repoSlug: Required. Identifier for the repository. + webhookId: Output only. The ID of the webhook that was created for + receiving events from this repo. We only create and manage a single + webhook for each repo. + """ + + projectKey = _messages.StringField(1) + repoSlug = _messages.StringField(2) + webhookId = _messages.IntegerField(3, variant=_messages.Variant.INT32) + + +class BitbucketServerSecrets(_messages.Message): + r"""BitbucketServerSecrets represents the secrets in Secret Manager for a + Bitbucket Server. + + Fields: + adminAccessTokenVersionName: Required. The resource name for the admin + access token's secret version. + readAccessTokenVersionName: Required. The resource name for the read + access token's secret version. + webhookSecretVersionName: Required. Immutable. The resource name for the + webhook secret's secret version. Once this field has been set, it cannot + be changed. If you need to change it, please create another + BitbucketServerConfig. + """ + + adminAccessTokenVersionName = _messages.StringField(1) + readAccessTokenVersionName = _messages.StringField(2) + webhookSecretVersionName = _messages.StringField(3) + + +class BitbucketServerTriggerConfig(_messages.Message): + r"""BitbucketServerTriggerConfig describes the configuration of a trigger + that creates a build whenever a Bitbucket Server event is received. + + Fields: + bitbucketServerConfig: Output only. The BitbucketServerConfig specified in + the bitbucket_server_config_resource field. + bitbucketServerConfigResource: Required. The Bitbucket server config + resource that this trigger config maps to. + projectKey: Required. Key of the project that the repo is in. For example: + The key for http://mybitbucket.server/projects/TEST/repos/test-repo is + "TEST". + pullRequest: Filter to match changes in pull requests. + push: Filter to match changes in refs like branches, tags. + repoSlug: Required. Slug of the repository. A repository slug is a URL- + friendly version of a repository name, automatically generated by + Bitbucket for use in the URL. For example, if the repository name is + 'test repo', in the URL it would become 'test-repo' as in + http://mybitbucket.server/projects/TEST/repos/test-repo. + """ + + bitbucketServerConfig = _messages.MessageField('BitbucketServerConfig', 1) + bitbucketServerConfigResource = _messages.StringField(2) + projectKey = _messages.StringField(3) + pullRequest = _messages.MessageField('PullRequestFilter', 4) + push = _messages.MessageField('PushFilter', 5) + repoSlug = _messages.StringField(6) + + class Build(_messages.Message): r"""A build resource in the Cloud Build API. At a high level, a `Build` describes where to find source code, how to build it (for example, the builder image to run on the source), and where to store the built artifacts. Fields can include the following variables, which will be expanded when the build is created: - $PROJECT_ID: the project ID of the build. - - $PROJECT_NUMBER: the project number of the build. - $BUILD_ID: the - autogenerated ID of the build. - $REPO_NAME: the source repository name - specified by RepoSource. - $BRANCH_NAME: the branch name specified by - RepoSource. - $TAG_NAME: the tag name specified by RepoSource. - - $REVISION_ID or $COMMIT_SHA: the commit SHA specified by RepoSource or - resolved from the specified branch or tag. - $SHORT_SHA: first 7 characters - of $REVISION_ID or $COMMIT_SHA. + $PROJECT_NUMBER: the project number of the build. - $LOCATION: the + location/region of the build. - $BUILD_ID: the autogenerated ID of the + build. - $REPO_NAME: the source repository name specified by RepoSource. - + $BRANCH_NAME: the branch name specified by RepoSource. - $TAG_NAME: the tag + name specified by RepoSource. - $REVISION_ID or $COMMIT_SHA: the commit SHA + specified by RepoSource or resolved from the specified branch or tag. - + $SHORT_SHA: first 7 characters of $REVISION_ID or $COMMIT_SHA. Enums: StatusValueValuesEnum: Output only. Status of the build. @@ -107,12 +391,14 @@ class Build(_messages.Message): Messages: SubstitutionsValue: Substitutions data for `Build` resource. TimingValue: Output only. Stores timing information for phases of the - build. Valid keys are: * BUILD: time to execute all build steps * PUSH: + build. Valid keys are: * BUILD: time to execute all build steps. * PUSH: time to push all specified images. * FETCHSOURCE: time to fetch source. - If the build does not specify source or images, these keys will not be - included. + * SETUPBUILD: time to set up build. If the build does not specify source + or images, these keys will not be included. Fields: + approval: Output only. Describes this build's approval configuration, + status, and result. artifacts: Artifacts produced by the build that should be uploaded upon successful completion of all build steps. availableSecrets: Secrets and secret environment variables. @@ -120,6 +406,8 @@ class Build(_messages.Message): this build, if it was triggered automatically. createTime: Output only. Time at which the request to create the build was received. + failureInfo: Output only. Contains information about the build when + status=FAILURE. finishTime: Output only. Time at which execution of the build was finished. The difference between finish_time and start_time is the duration of the build's execution. @@ -151,7 +439,7 @@ class Build(_messages.Message): serviceAccount: IAM service account whose credentials will be used at build runtime. Must be of the format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. ACCOUNT can be email - address or uniqueId of the service account. This field is in beta. + address or uniqueId of the service account. source: The location of the source files to build. sourceProvenance: Output only. A permanent fixed identifier for source. startTime: Output only. Time at which execution of the build was started. @@ -166,16 +454,20 @@ class Build(_messages.Message): will cease and the build status will be `TIMEOUT`. `timeout` starts ticking from `startTime`. Default time is ten minutes. timing: Output only. Stores timing information for phases of the build. - Valid keys are: * BUILD: time to execute all build steps * PUSH: time to - push all specified images. * FETCHSOURCE: time to fetch source. If the - build does not specify source or images, these keys will not be - included. + Valid keys are: * BUILD: time to execute all build steps. * PUSH: time + to push all specified images. * FETCHSOURCE: time to fetch source. * + SETUPBUILD: time to set up build. If the build does not specify source + or images, these keys will not be included. + warnings: Output only. Non-fatal problems encountered during the execution + of the build. """ class StatusValueValuesEnum(_messages.Enum): r"""Output only. Status of the build. Values: STATUS_UNKNOWN: Status of the build is unknown. + PENDING: Build has been created and is pending execution and queuing. It + has not been queued. QUEUED: Build or step is queued; work has not yet begun. WORKING: Build or step is being executed. SUCCESS: Build or step finished successfully. @@ -186,14 +478,15 @@ class StatusValueValuesEnum(_messages.Enum): EXPIRED: Build was enqueued for longer than the value of `queue_ttl`. """ STATUS_UNKNOWN = 0 - QUEUED = 1 - WORKING = 2 - SUCCESS = 3 - FAILURE = 4 - INTERNAL_ERROR = 5 - TIMEOUT = 6 - CANCELLED = 7 - EXPIRED = 8 + PENDING = 1 + QUEUED = 2 + WORKING = 3 + SUCCESS = 4 + FAILURE = 5 + INTERNAL_ERROR = 6 + TIMEOUT = 7 + CANCELLED = 8 + EXPIRED = 9 @encoding.MapUnrecognizedFields('additionalProperties') class SubstitutionsValue(_messages.Message): @@ -223,9 +516,10 @@ class AdditionalProperty(_messages.Message): @encoding.MapUnrecognizedFields('additionalProperties') class TimingValue(_messages.Message): r"""Output only. Stores timing information for phases of the build. Valid - keys are: * BUILD: time to execute all build steps * PUSH: time to push - all specified images. * FETCHSOURCE: time to fetch source. If the build - does not specify source or images, these keys will not be included. + keys are: * BUILD: time to execute all build steps. * PUSH: time to push + all specified images. * FETCHSOURCE: time to fetch source. * SETUPBUILD: + time to set up build. If the build does not specify source or images, + these keys will not be included. Messages: AdditionalProperty: An additional property for a TimingValue object. @@ -247,32 +541,68 @@ class AdditionalProperty(_messages.Message): additionalProperties = _messages.MessageField( 'AdditionalProperty', 1, repeated=True) - artifacts = _messages.MessageField('Artifacts', 1) - availableSecrets = _messages.MessageField('Secrets', 2) - buildTriggerId = _messages.StringField(3) - createTime = _messages.StringField(4) - finishTime = _messages.StringField(5) - id = _messages.StringField(6) - images = _messages.StringField(7, repeated=True) - logUrl = _messages.StringField(8) - logsBucket = _messages.StringField(9) - name = _messages.StringField(10) - options = _messages.MessageField('BuildOptions', 11) - projectId = _messages.StringField(12) - queueTtl = _messages.StringField(13) - results = _messages.MessageField('Results', 14) - secrets = _messages.MessageField('Secret', 15, repeated=True) - serviceAccount = _messages.StringField(16) - source = _messages.MessageField('Source', 17) - sourceProvenance = _messages.MessageField('SourceProvenance', 18) - startTime = _messages.StringField(19) - status = _messages.EnumField('StatusValueValuesEnum', 20) - statusDetail = _messages.StringField(21) - steps = _messages.MessageField('BuildStep', 22, repeated=True) - substitutions = _messages.MessageField('SubstitutionsValue', 23) - tags = _messages.StringField(24, repeated=True) - timeout = _messages.StringField(25) - timing = _messages.MessageField('TimingValue', 26) + approval = _messages.MessageField('BuildApproval', 1) + artifacts = _messages.MessageField('Artifacts', 2) + availableSecrets = _messages.MessageField('Secrets', 3) + buildTriggerId = _messages.StringField(4) + createTime = _messages.StringField(5) + failureInfo = _messages.MessageField('FailureInfo', 6) + finishTime = _messages.StringField(7) + id = _messages.StringField(8) + images = _messages.StringField(9, repeated=True) + logUrl = _messages.StringField(10) + logsBucket = _messages.StringField(11) + name = _messages.StringField(12) + options = _messages.MessageField('BuildOptions', 13) + projectId = _messages.StringField(14) + queueTtl = _messages.StringField(15) + results = _messages.MessageField('Results', 16) + secrets = _messages.MessageField('Secret', 17, repeated=True) + serviceAccount = _messages.StringField(18) + source = _messages.MessageField('Source', 19) + sourceProvenance = _messages.MessageField('SourceProvenance', 20) + startTime = _messages.StringField(21) + status = _messages.EnumField('StatusValueValuesEnum', 22) + statusDetail = _messages.StringField(23) + steps = _messages.MessageField('BuildStep', 24, repeated=True) + substitutions = _messages.MessageField('SubstitutionsValue', 25) + tags = _messages.StringField(26, repeated=True) + timeout = _messages.StringField(27) + timing = _messages.MessageField('TimingValue', 28) + warnings = _messages.MessageField('Warning', 29, repeated=True) + + +class BuildApproval(_messages.Message): + r"""BuildApproval describes a build's approval configuration, state, and + result. + + Enums: + StateValueValuesEnum: Output only. The state of this build's approval. + + Fields: + config: Output only. Configuration for manual approval of this build. + result: Output only. Result of manual approval for this Build. + state: Output only. The state of this build's approval. + """ + class StateValueValuesEnum(_messages.Enum): + r"""Output only. The state of this build's approval. + + Values: + STATE_UNSPECIFIED: Default enum type. This should not be used. + PENDING: Build approval is pending. + APPROVED: Build approval has been approved. + REJECTED: Build approval has been rejected. + CANCELLED: Build was cancelled while it was still pending approval. + """ + STATE_UNSPECIFIED = 0 + PENDING = 1 + APPROVED = 2 + REJECTED = 3 + CANCELLED = 4 + + config = _messages.MessageField('ApprovalConfig', 1) + result = _messages.MessageField('ApprovalResult', 2) + state = _messages.EnumField('StateValueValuesEnum', 3) class BuildOperationMetadata(_messages.Message): @@ -324,6 +654,10 @@ class BuildOptions(_messages.Message): logging: Option to specify the logging mode, which determines if and where build logs are stored. machineType: Compute Engine machine type on which to run the build. + pool: Optional. Specification for execution on a `WorkerPool`. See + [running builds in a private + pool](https://cloud.google.com/build/docs/private-pools/run-builds-in- + private-pool) for more information. requestedVerifyOption: Requested verifiability options. secretEnv: A list of global environment variables, which are encrypted using a Cloud Key Management Service crypto key. These values must be @@ -341,9 +675,7 @@ class BuildOptions(_messages.Message): build step. Using a global volume in a build with only one step is not valid as it is indicative of a build request with an incorrect configuration. - workerPool: Option to specify a `WorkerPool` for the build. Format: - projects/{project}/locations/{location}/workerPools/{workerPool} This - field is in beta and is available only to restricted users. + workerPool: This field deprecated; please use `pool.name` instead. """ class LogStreamingOptionValueValuesEnum(_messages.Enum): r"""Option to define build log streaming behavior to Google Cloud Storage. @@ -367,12 +699,12 @@ class LoggingValueValuesEnum(_messages.Enum): LOGGING_UNSPECIFIED: The service determines the logging mode. The default is `LEGACY`. Do not rely on the default logging behavior as it may change in the future. - LEGACY: Cloud Logging and Cloud Storage logging are enabled. - GCS_ONLY: Only Cloud Storage logging is enabled. + LEGACY: Build logs are stored in Cloud Logging and Cloud Storage. + GCS_ONLY: Build logs are stored in Cloud Storage. STACKDRIVER_ONLY: This option is the same as CLOUD_LOGGING_ONLY. - CLOUD_LOGGING_ONLY: Only Cloud Logging is enabled. Note that logs for - both the Cloud Console UI and Cloud SDK are based on Cloud Storage - logs, so neither will provide logs if this option is chosen. + CLOUD_LOGGING_ONLY: Build logs are stored in Cloud Logging. Selecting + this option will not allow [logs + streaming](https://cloud.google.com/sdk/gcloud/reference/builds/log). NONE: Turn off all logging. No build logs will be captured. """ LOGGING_UNSPECIFIED = 0 @@ -440,15 +772,16 @@ class SubstitutionOptionValueValuesEnum(_messages.Enum): 'LogStreamingOptionValueValuesEnum', 4) logging = _messages.EnumField('LoggingValueValuesEnum', 5) machineType = _messages.EnumField('MachineTypeValueValuesEnum', 6) + pool = _messages.MessageField('PoolOption', 7) requestedVerifyOption = _messages.EnumField( - 'RequestedVerifyOptionValueValuesEnum', 7) - secretEnv = _messages.StringField(8, repeated=True) + 'RequestedVerifyOptionValueValuesEnum', 8) + secretEnv = _messages.StringField(9, repeated=True) sourceProvenanceHash = _messages.EnumField( - 'SourceProvenanceHashValueListEntryValuesEnum', 9, repeated=True) + 'SourceProvenanceHashValueListEntryValuesEnum', 10, repeated=True) substitutionOption = _messages.EnumField( - 'SubstitutionOptionValueValuesEnum', 10) - volumes = _messages.MessageField('Volume', 11, repeated=True) - workerPool = _messages.StringField(12) + 'SubstitutionOptionValueValuesEnum', 11) + volumes = _messages.MessageField('Volume', 12, repeated=True) + workerPool = _messages.StringField(13) class BuildStep(_messages.Message): @@ -495,6 +828,8 @@ class BuildStep(_messages.Message): to use as the name for a later build step. pullTiming: Output only. Stores timing information for pulling this build step's builder image only. + script: A shell script to be executed in the step. When script is + provided, the user cannot specify the entrypoint or args. secretEnv: A list of environment variables which are encrypted using a Cloud Key Management Service crypto key. These values must be specified in the build's `Secret`. @@ -524,6 +859,8 @@ class StatusValueValuesEnum(_messages.Enum): Values: STATUS_UNKNOWN: Status of the build is unknown. + PENDING: Build has been created and is pending execution and queuing. It + has not been queued. QUEUED: Build or step is queued; work has not yet begun. WORKING: Build or step is being executed. SUCCESS: Build or step finished successfully. @@ -534,14 +871,15 @@ class StatusValueValuesEnum(_messages.Enum): EXPIRED: Build was enqueued for longer than the value of `queue_ttl`. """ STATUS_UNKNOWN = 0 - QUEUED = 1 - WORKING = 2 - SUCCESS = 3 - FAILURE = 4 - INTERNAL_ERROR = 5 - TIMEOUT = 6 - CANCELLED = 7 - EXPIRED = 8 + PENDING = 1 + QUEUED = 2 + WORKING = 3 + SUCCESS = 4 + FAILURE = 5 + INTERNAL_ERROR = 6 + TIMEOUT = 7 + CANCELLED = 8 + EXPIRED = 9 args = _messages.StringField(1, repeated=True) dir = _messages.StringField(2) @@ -550,29 +888,50 @@ class StatusValueValuesEnum(_messages.Enum): id = _messages.StringField(5) name = _messages.StringField(6) pullTiming = _messages.MessageField('TimeSpan', 7) - secretEnv = _messages.StringField(8, repeated=True) - status = _messages.EnumField('StatusValueValuesEnum', 9) - timeout = _messages.StringField(10) - timing = _messages.MessageField('TimeSpan', 11) - volumes = _messages.MessageField('Volume', 12, repeated=True) - waitFor = _messages.StringField(13, repeated=True) + script = _messages.StringField(8) + secretEnv = _messages.StringField(9, repeated=True) + status = _messages.EnumField('StatusValueValuesEnum', 10) + timeout = _messages.StringField(11) + timing = _messages.MessageField('TimeSpan', 12) + volumes = _messages.MessageField('Volume', 13, repeated=True) + waitFor = _messages.StringField(14, repeated=True) class BuildTrigger(_messages.Message): r"""Configuration for an automated build in response to source repository changes. + Enums: + EventTypeValueValuesEnum: EventType allows the user to explicitly set the + type of event to which this BuildTrigger should respond. This field will + be validated against the rest of the configuration if it is set. + Messages: SubstitutionsValue: Substitutions for Build resource. The keys must match the following regular expression: `^_[A-Z0-9_]+$`. Fields: + approvalConfig: Configuration for manual approval to start a build + invocation of this BuildTrigger. + autodetect: Autodetect build configuration. The following precedence is + used (case insensitive): 1. cloudbuild.yaml 2. cloudbuild.yml 3. + cloudbuild.json 4. Dockerfile Currently only available for GitHub App + Triggers. + bitbucketServerTriggerConfig: BitbucketServerTriggerConfig describes the + configuration of a trigger that creates a build whenever a Bitbucket + Server event is received. build: Contents of the build template. createTime: Output only. Time when the trigger was created. description: Human-readable description of this trigger. disabled: If true, the trigger will never automatically execute a build. - filename: Path, from the source root, to a file whose contents is used for - the template. + eventType: EventType allows the user to explicitly set the type of event + to which this BuildTrigger should respond. This field will be validated + against the rest of the configuration if it is set. + filename: Path, from the source root, to the build configuration file + (i.e. cloudbuild.yaml). + filter: A Common Expression Language string. + gitFileSource: The file source describing the local or remote Build + template. github: GitHubEventsConfig describes the configuration of a trigger that creates a build whenever a GitHub event is received. Mutually exclusive with `trigger_template`. @@ -595,6 +954,22 @@ class BuildTrigger(_messages.Message): contain only alphanumeric characters and dashes. + They can be 1-64 characters long. + They must begin and end with an alphanumeric character. + pubsubConfig: PubsubConfig describes the configuration of a trigger that + creates a build whenever a Pub/Sub message is published. + resourceName: The `Trigger` name with format: + `projects/{project}/locations/{location}/triggers/{trigger}`, where + {trigger} is a unique identifier generated by the service. + serviceAccount: The service account used for all user-controlled + operations including UpdateBuildTrigger, RunBuildTrigger, CreateBuild, + and CancelBuild. If no service account is set, then the standard Cloud + Build service account ([PROJECT_NUM]@system.gserviceaccount.com) will be + used instead. Format: + `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}` + sourceToBuild: The repo and ref of the repository from which to build. + This field is used only for those triggers that do not respond to SCM + events. Triggers that respond to such events build source at whatever + commit caused the event. This field is currently only used by Webhook, + Pub/Sub, Manual, and Cron triggers. substitutions: Substitutions for Build resource. The keys must match the following regular expression: `^_[A-Z0-9_]+$`. tags: Tags for annotation of a `BuildTrigger` @@ -603,7 +978,27 @@ class BuildTrigger(_messages.Message): interpreted as regular expressions. Any branch or tag change that matches that regular expression will trigger a build. Mutually exclusive with `github`. + webhookConfig: WebhookConfig describes the configuration of a trigger that + creates a build whenever a webhook is sent to a trigger's webhook URL. """ + class EventTypeValueValuesEnum(_messages.Enum): + r"""EventType allows the user to explicitly set the type of event to which + this BuildTrigger should respond. This field will be validated against the + rest of the configuration if it is set. + + Values: + EVENT_TYPE_UNSPECIFIED: EVENT_TYPE_UNSPECIFIED event_types are ignored. + REPO: REPO corresponds to the supported VCS integrations. + WEBHOOK: WEBHOOK corresponds to webhook triggers. + PUBSUB: PUBSUB corresponds to pubsub triggers. + MANUAL: MANUAL corresponds to manual-only invoked triggers. + """ + EVENT_TYPE_UNSPECIFIED = 0 + REPO = 1 + WEBHOOK = 2 + PUBSUB = 3 + MANUAL = 4 + @encoding.MapUnrecognizedFields('additionalProperties') class SubstitutionsValue(_messages.Message): r"""Substitutions for Build resource. The keys must match the following @@ -630,19 +1025,31 @@ class AdditionalProperty(_messages.Message): additionalProperties = _messages.MessageField( 'AdditionalProperty', 1, repeated=True) - build = _messages.MessageField('Build', 1) - createTime = _messages.StringField(2) - description = _messages.StringField(3) - disabled = _messages.BooleanField(4) - filename = _messages.StringField(5) - github = _messages.MessageField('GitHubEventsConfig', 6) - id = _messages.StringField(7) - ignoredFiles = _messages.StringField(8, repeated=True) - includedFiles = _messages.StringField(9, repeated=True) - name = _messages.StringField(10) - substitutions = _messages.MessageField('SubstitutionsValue', 11) - tags = _messages.StringField(12, repeated=True) - triggerTemplate = _messages.MessageField('RepoSource', 13) + approvalConfig = _messages.MessageField('ApprovalConfig', 1) + autodetect = _messages.BooleanField(2) + bitbucketServerTriggerConfig = _messages.MessageField( + 'BitbucketServerTriggerConfig', 3) + build = _messages.MessageField('Build', 4) + createTime = _messages.StringField(5) + description = _messages.StringField(6) + disabled = _messages.BooleanField(7) + eventType = _messages.EnumField('EventTypeValueValuesEnum', 8) + filename = _messages.StringField(9) + filter = _messages.StringField(10) + gitFileSource = _messages.MessageField('GitFileSource', 11) + github = _messages.MessageField('GitHubEventsConfig', 12) + id = _messages.StringField(13) + ignoredFiles = _messages.StringField(14, repeated=True) + includedFiles = _messages.StringField(15, repeated=True) + name = _messages.StringField(16) + pubsubConfig = _messages.MessageField('PubsubConfig', 17) + resourceName = _messages.StringField(18) + serviceAccount = _messages.StringField(19) + sourceToBuild = _messages.MessageField('GitRepoSource', 20) + substitutions = _messages.MessageField('SubstitutionsValue', 21) + tags = _messages.StringField(22, repeated=True) + triggerTemplate = _messages.MessageField('RepoSource', 23) + webhookConfig = _messages.MessageField('WebhookConfig', 24) class BuiltImage(_messages.Message): @@ -680,6 +1087,22 @@ class CancelOperationRequest(_messages.Message): r"""The request message for Operations.CancelOperation.""" +class CloudbuildLocationsRegionalWebhookRequest(_messages.Message): + r"""A CloudbuildLocationsRegionalWebhookRequest object. + + Fields: + httpBody: A HttpBody resource to be passed as the request body. + location: Required. The location where the webhook should be sent. + webhookKey: For GitHub Enterprise webhooks, this key is used to associate + the webhook request with the GitHubEnterpriseConfig to use for + validation. + """ + + httpBody = _messages.MessageField('HttpBody', 1) + location = _messages.StringField(2, required=True) + webhookKey = _messages.StringField(3) + + class CloudbuildOperationsCancelRequest(_messages.Message): r"""A CloudbuildOperationsCancelRequest object. @@ -703,6 +1126,20 @@ class CloudbuildOperationsGetRequest(_messages.Message): name = _messages.StringField(1, required=True) +class CloudbuildProjectsBuildsApproveRequest(_messages.Message): + r"""A CloudbuildProjectsBuildsApproveRequest object. + + Fields: + approveBuildRequest: A ApproveBuildRequest resource to be passed as the + request body. + name: Required. Name of the target build. For example: + "projects/{$project_id}/builds/{$build_id}" + """ + + approveBuildRequest = _messages.MessageField('ApproveBuildRequest', 1) + name = _messages.StringField(2, required=True) + + class CloudbuildProjectsBuildsCreateRequest(_messages.Message): r"""A CloudbuildProjectsBuildsCreateRequest object. @@ -756,204 +1193,1097 @@ class CloudbuildProjectsBuildsListRequest(_messages.Message): projectId = _messages.StringField(5, required=True) -class CloudbuildProjectsLocationsBuildsCreateRequest(_messages.Message): - r"""A CloudbuildProjectsLocationsBuildsCreateRequest object. +class CloudbuildProjectsGithubEnterpriseConfigsCreateRequest(_messages.Message): + r"""A CloudbuildProjectsGithubEnterpriseConfigsCreateRequest object. Fields: - build: A Build resource to be passed as the request body. - parent: The parent resource where this build will be created. Format: - `projects/{project}/locations/{location}` - projectId: Required. ID of the project. + gheConfigId: Optional. The ID to use for the GithubEnterpriseConfig, which + will become the final component of the GithubEnterpriseConfig's resource + name. ghe_config_id must meet the following requirements: + They must + contain only alphanumeric characters and dashes. + They can be 1-64 + characters long. + They must begin and end with an alphanumeric + character + gitHubEnterpriseConfig: A GitHubEnterpriseConfig resource to be passed as + the request body. + parent: Name of the parent project. For example: + projects/{$project_number} or projects/{$project_id} + projectId: ID of the project. """ - build = _messages.MessageField('Build', 1) - parent = _messages.StringField(2, required=True) + gheConfigId = _messages.StringField(1) + gitHubEnterpriseConfig = _messages.MessageField('GitHubEnterpriseConfig', 2) + parent = _messages.StringField(3, required=True) + projectId = _messages.StringField(4) + + +class CloudbuildProjectsGithubEnterpriseConfigsDeleteRequest(_messages.Message): + r"""A CloudbuildProjectsGithubEnterpriseConfigsDeleteRequest object. + + Fields: + configId: Unique identifier of the `GitHubEnterpriseConfig` + name: This field should contain the name of the enterprise config + resource. For example: + "projects/{$project_id}/githubEnterpriseConfigs/{$config_id}" + projectId: ID of the project + """ + + configId = _messages.StringField(1) + name = _messages.StringField(2, required=True) projectId = _messages.StringField(3) -class CloudbuildProjectsLocationsBuildsGetRequest(_messages.Message): - r"""A CloudbuildProjectsLocationsBuildsGetRequest object. +class CloudbuildProjectsGithubEnterpriseConfigsGetRequest(_messages.Message): + r"""A CloudbuildProjectsGithubEnterpriseConfigsGetRequest object. Fields: - id: Required. ID of the build. - name: The name of the `Build` to retrieve. Format: - `projects/{project}/locations/{location}/builds/{build}` - projectId: Required. ID of the project. + configId: Unique identifier of the `GitHubEnterpriseConfig` + name: This field should contain the name of the enterprise config + resource. For example: + "projects/{$project_id}/githubEnterpriseConfigs/{$config_id}" + projectId: ID of the project """ - id = _messages.StringField(1) + configId = _messages.StringField(1) name = _messages.StringField(2, required=True) projectId = _messages.StringField(3) -class CloudbuildProjectsLocationsBuildsListRequest(_messages.Message): - r"""A CloudbuildProjectsLocationsBuildsListRequest object. +class CloudbuildProjectsGithubEnterpriseConfigsListRequest(_messages.Message): + r"""A CloudbuildProjectsGithubEnterpriseConfigsListRequest object. Fields: - filter: The raw filter text to constrain the results. - pageSize: Number of results to return in the list. - pageToken: The page token for the next page of Builds. If unspecified, the - first page of results is returned. If the token is rejected for any - reason, INVALID_ARGUMENT will be thrown. In this case, the token should - be discarded, and pagination should be restarted from the first page of - results. See https://google.aip.dev/158 for more. - parent: The parent of the collection of `Builds`. Format: - `projects/{project}/locations/location` - projectId: Required. ID of the project. + parent: Name of the parent project. For example: + projects/{$project_number} or projects/{$project_id} + projectId: ID of the project """ - filter = _messages.StringField(1) - pageSize = _messages.IntegerField(2, variant=_messages.Variant.INT32) - pageToken = _messages.StringField(3) - parent = _messages.StringField(4, required=True) - projectId = _messages.StringField(5) + parent = _messages.StringField(1, required=True) + projectId = _messages.StringField(2) -class CloudbuildProjectsLocationsOperationsCancelRequest(_messages.Message): - r"""A CloudbuildProjectsLocationsOperationsCancelRequest object. +class CloudbuildProjectsGithubEnterpriseConfigsPatchRequest(_messages.Message): + r"""A CloudbuildProjectsGithubEnterpriseConfigsPatchRequest object. Fields: - cancelOperationRequest: A CancelOperationRequest resource to be passed as + gitHubEnterpriseConfig: A GitHubEnterpriseConfig resource to be passed as the request body. - name: The name of the operation resource to be cancelled. + name: Optional. The full resource name for the GitHubEnterpriseConfig For + example: "projects/{$project_id}/githubEnterpriseConfigs/{$config_id}" + updateMask: Update mask for the resource. If this is set, the server will + only update the fields specified in the field mask. Otherwise, a full + update of the mutable resource fields will be performed. """ - cancelOperationRequest = _messages.MessageField('CancelOperationRequest', 1) + gitHubEnterpriseConfig = _messages.MessageField('GitHubEnterpriseConfig', 1) name = _messages.StringField(2, required=True) + updateMask = _messages.StringField(3) -class CloudbuildProjectsLocationsOperationsGetRequest(_messages.Message): - r"""A CloudbuildProjectsLocationsOperationsGetRequest object. +class CloudbuildProjectsLocationsBitbucketServerConfigsAddBitbucketServerConnectedRepositoryRequest( + _messages.Message): + r"""A CloudbuildProjectsLocationsBitbucketServerConfigsAddBitbucketServerCon + nectedRepositoryRequest object. Fields: - name: The name of the operation resource. + addBitbucketServerConnectedRepositoryRequest: A + AddBitbucketServerConnectedRepositoryRequest resource to be passed as + the request body. + config: Required. The name of the `BitbucketServerConfig` to add a + connected repository. Format: `projects/{project}/locations/{location}/b + itbucketServerConfigs/{config}` + """ + + addBitbucketServerConnectedRepositoryRequest = _messages.MessageField( + 'AddBitbucketServerConnectedRepositoryRequest', 1) + config = _messages.StringField(2, required=True) + + +class CloudbuildProjectsLocationsBitbucketServerConfigsConnectedRepositoriesBatchCreateRequest( + _messages.Message): + r"""A CloudbuildProjectsLocationsBitbucketServerConfigsConnectedRepositories + BatchCreateRequest object. + + Fields: + batchCreateBitbucketServerConnectedRepositoriesRequest: A + BatchCreateBitbucketServerConnectedRepositoriesRequest resource to be + passed as the request body. + parent: The name of the `BitbucketServerConfig` that added connected + repository. Format: `projects/{project}/locations/{location}/bitbucketSe + rverConfigs/{config}` + """ + + batchCreateBitbucketServerConnectedRepositoriesRequest = _messages.MessageField( + 'BatchCreateBitbucketServerConnectedRepositoriesRequest', 1) + parent = _messages.StringField(2, required=True) + + +class CloudbuildProjectsLocationsBitbucketServerConfigsCreateRequest( + _messages.Message): + r"""A CloudbuildProjectsLocationsBitbucketServerConfigsCreateRequest object. + + Fields: + bitbucketServerConfig: A BitbucketServerConfig resource to be passed as + the request body. + bitbucketServerConfigId: Optional. The ID to use for the + BitbucketServerConfig, which will become the final component of the + BitbucketServerConfig's resource name. bitbucket_server_config_id must + meet the following requirements: + They must contain only alphanumeric + characters and dashes. + They can be 1-64 characters long. + They must + begin and end with an alphanumeric character. + parent: Required. Name of the parent resource. + """ + + bitbucketServerConfig = _messages.MessageField('BitbucketServerConfig', 1) + bitbucketServerConfigId = _messages.StringField(2) + parent = _messages.StringField(3, required=True) + + +class CloudbuildProjectsLocationsBitbucketServerConfigsDeleteRequest( + _messages.Message): + r"""A CloudbuildProjectsLocationsBitbucketServerConfigsDeleteRequest object. + + Fields: + name: Required. The config resource name. """ name = _messages.StringField(1, required=True) -class CloudbuildProjectsTriggersCreateRequest(_messages.Message): - r"""A CloudbuildProjectsTriggersCreateRequest object. +class CloudbuildProjectsLocationsBitbucketServerConfigsGetRequest( + _messages.Message): + r"""A CloudbuildProjectsLocationsBitbucketServerConfigsGetRequest object. Fields: - buildTrigger: A BuildTrigger resource to be passed as the request body. - projectId: Required. ID of the project for which to configure automatic - builds. + name: Required. The config resource name. """ - buildTrigger = _messages.MessageField('BuildTrigger', 1) - projectId = _messages.StringField(2, required=True) + name = _messages.StringField(1, required=True) -class CloudbuildProjectsTriggersDeleteRequest(_messages.Message): - r"""A CloudbuildProjectsTriggersDeleteRequest object. +class CloudbuildProjectsLocationsBitbucketServerConfigsListRequest( + _messages.Message): + r"""A CloudbuildProjectsLocationsBitbucketServerConfigsListRequest object. Fields: - projectId: Required. ID of the project that owns the trigger. - triggerId: Required. ID of the `BuildTrigger` to delete. + pageSize: The maximum number of configs to return. The service may return + fewer than this value. If unspecified, at most 50 configs will be + returned. The maximum value is 1000; values above 1000 will be coerced + to 1000. + pageToken: A page token, received from a previous + `ListBitbucketServerConfigsRequest` call. Provide this to retrieve the + subsequent page. When paginating, all other parameters provided to + `ListBitbucketServerConfigsRequest` must match the call that provided + the page token. + parent: Required. Name of the parent resource. """ - projectId = _messages.StringField(1, required=True) - triggerId = _messages.StringField(2, required=True) + pageSize = _messages.IntegerField(1, variant=_messages.Variant.INT32) + pageToken = _messages.StringField(2) + parent = _messages.StringField(3, required=True) -class CloudbuildProjectsTriggersGetRequest(_messages.Message): - r"""A CloudbuildProjectsTriggersGetRequest object. +class CloudbuildProjectsLocationsBitbucketServerConfigsPatchRequest( + _messages.Message): + r"""A CloudbuildProjectsLocationsBitbucketServerConfigsPatchRequest object. Fields: - projectId: Required. ID of the project that owns the trigger. - triggerId: Required. Identifier (`id` or `name`) of the `BuildTrigger` to - get. + bitbucketServerConfig: A BitbucketServerConfig resource to be passed as + the request body. + name: The resource name for the config. + updateMask: Update mask for the resource. If this is set, the server will + only update the fields specified in the field mask. Otherwise, a full + update of the mutable resource fields will be performed. """ - projectId = _messages.StringField(1, required=True) - triggerId = _messages.StringField(2, required=True) + bitbucketServerConfig = _messages.MessageField('BitbucketServerConfig', 1) + name = _messages.StringField(2, required=True) + updateMask = _messages.StringField(3) -class CloudbuildProjectsTriggersListRequest(_messages.Message): - r"""A CloudbuildProjectsTriggersListRequest object. +class CloudbuildProjectsLocationsBitbucketServerConfigsRemoveBitbucketServerConnectedRepositoryRequest( + _messages.Message): + r"""A CloudbuildProjectsLocationsBitbucketServerConfigsRemoveBitbucketServer + ConnectedRepositoryRequest object. Fields: - pageSize: Number of results to return in the list. - pageToken: Token to provide to skip to a particular spot in the list. - projectId: Required. ID of the project for which to list BuildTriggers. + config: Required. The name of the `BitbucketServerConfig` to remove a + connected repository. Format: `projects/{project}/locations/{location}/b + itbucketServerConfigs/{config}` + removeBitbucketServerConnectedRepositoryRequest: A + RemoveBitbucketServerConnectedRepositoryRequest resource to be passed as + the request body. + """ + + config = _messages.StringField(1, required=True) + removeBitbucketServerConnectedRepositoryRequest = _messages.MessageField( + 'RemoveBitbucketServerConnectedRepositoryRequest', 2) + + +class CloudbuildProjectsLocationsBitbucketServerConfigsReposListRequest( + _messages.Message): + r"""A CloudbuildProjectsLocationsBitbucketServerConfigsReposListRequest + object. + + Fields: + pageSize: The maximum number of configs to return. The service may return + fewer than this value. If unspecified, at most 50 configs will be + returned. The maximum value is 1000; values above 1000 will be coerced + to 1000. + pageToken: A page token, received from a previous + `ListBitbucketServerRepositoriesRequest` call. Provide this to retrieve + the subsequent page. When paginating, all other parameters provided to + `ListBitbucketServerConfigsRequest` must match the call that provided + the page token. + parent: Required. Name of the parent resource. """ pageSize = _messages.IntegerField(1, variant=_messages.Variant.INT32) pageToken = _messages.StringField(2) - projectId = _messages.StringField(3, required=True) + parent = _messages.StringField(3, required=True) -class CloudbuildProjectsTriggersPatchRequest(_messages.Message): - r"""A CloudbuildProjectsTriggersPatchRequest object. +class CloudbuildProjectsLocationsBuildsApproveRequest(_messages.Message): + r"""A CloudbuildProjectsLocationsBuildsApproveRequest object. Fields: - buildTrigger: A BuildTrigger resource to be passed as the request body. - projectId: Required. ID of the project that owns the trigger. - triggerId: Required. ID of the `BuildTrigger` to update. + approveBuildRequest: A ApproveBuildRequest resource to be passed as the + request body. + name: Required. Name of the target build. For example: + "projects/{$project_id}/builds/{$build_id}" """ - buildTrigger = _messages.MessageField('BuildTrigger', 1) - projectId = _messages.StringField(2, required=True) - triggerId = _messages.StringField(3, required=True) + approveBuildRequest = _messages.MessageField('ApproveBuildRequest', 1) + name = _messages.StringField(2, required=True) -class CloudbuildProjectsTriggersRunRequest(_messages.Message): - r"""A CloudbuildProjectsTriggersRunRequest object. +class CloudbuildProjectsLocationsBuildsCreateRequest(_messages.Message): + r"""A CloudbuildProjectsLocationsBuildsCreateRequest object. Fields: + build: A Build resource to be passed as the request body. + parent: The parent resource where this build will be created. Format: + `projects/{project}/locations/{location}` projectId: Required. ID of the project. - repoSource: A RepoSource resource to be passed as the request body. - triggerId: Required. ID of the trigger. """ - projectId = _messages.StringField(1, required=True) - repoSource = _messages.MessageField('RepoSource', 2) - triggerId = _messages.StringField(3, required=True) + build = _messages.MessageField('Build', 1) + parent = _messages.StringField(2, required=True) + projectId = _messages.StringField(3) + + +class CloudbuildProjectsLocationsBuildsGetRequest(_messages.Message): + r"""A CloudbuildProjectsLocationsBuildsGetRequest object. + + Fields: + id: Required. ID of the build. + name: The name of the `Build` to retrieve. Format: + `projects/{project}/locations/{location}/builds/{build}` + projectId: Required. ID of the project. + """ + + id = _messages.StringField(1) + name = _messages.StringField(2, required=True) + projectId = _messages.StringField(3) + + +class CloudbuildProjectsLocationsBuildsListRequest(_messages.Message): + r"""A CloudbuildProjectsLocationsBuildsListRequest object. + + Fields: + filter: The raw filter text to constrain the results. + pageSize: Number of results to return in the list. + pageToken: The page token for the next page of Builds. If unspecified, the + first page of results is returned. If the token is rejected for any + reason, INVALID_ARGUMENT will be thrown. In this case, the token should + be discarded, and pagination should be restarted from the first page of + results. See https://google.aip.dev/158 for more. + parent: The parent of the collection of `Builds`. Format: + `projects/{project}/locations/location` + projectId: Required. ID of the project. + """ + + filter = _messages.StringField(1) + pageSize = _messages.IntegerField(2, variant=_messages.Variant.INT32) + pageToken = _messages.StringField(3) + parent = _messages.StringField(4, required=True) + projectId = _messages.StringField(5) + + +class CloudbuildProjectsLocationsGithubEnterpriseConfigsCreateRequest( + _messages.Message): + r"""A CloudbuildProjectsLocationsGithubEnterpriseConfigsCreateRequest + object. + + Fields: + gheConfigId: Optional. The ID to use for the GithubEnterpriseConfig, which + will become the final component of the GithubEnterpriseConfig's resource + name. ghe_config_id must meet the following requirements: + They must + contain only alphanumeric characters and dashes. + They can be 1-64 + characters long. + They must begin and end with an alphanumeric + character + gitHubEnterpriseConfig: A GitHubEnterpriseConfig resource to be passed as + the request body. + parent: Name of the parent project. For example: + projects/{$project_number} or projects/{$project_id} + projectId: ID of the project. + """ + + gheConfigId = _messages.StringField(1) + gitHubEnterpriseConfig = _messages.MessageField('GitHubEnterpriseConfig', 2) + parent = _messages.StringField(3, required=True) + projectId = _messages.StringField(4) + + +class CloudbuildProjectsLocationsGithubEnterpriseConfigsDeleteRequest( + _messages.Message): + r"""A CloudbuildProjectsLocationsGithubEnterpriseConfigsDeleteRequest + object. + + Fields: + configId: Unique identifier of the `GitHubEnterpriseConfig` + name: This field should contain the name of the enterprise config + resource. For example: + "projects/{$project_id}/githubEnterpriseConfigs/{$config_id}" + projectId: ID of the project + """ + + configId = _messages.StringField(1) + name = _messages.StringField(2, required=True) + projectId = _messages.StringField(3) + + +class CloudbuildProjectsLocationsGithubEnterpriseConfigsGetRequest( + _messages.Message): + r"""A CloudbuildProjectsLocationsGithubEnterpriseConfigsGetRequest object. + + Fields: + configId: Unique identifier of the `GitHubEnterpriseConfig` + name: This field should contain the name of the enterprise config + resource. For example: + "projects/{$project_id}/githubEnterpriseConfigs/{$config_id}" + projectId: ID of the project + """ + + configId = _messages.StringField(1) + name = _messages.StringField(2, required=True) + projectId = _messages.StringField(3) + + +class CloudbuildProjectsLocationsGithubEnterpriseConfigsListRequest( + _messages.Message): + r"""A CloudbuildProjectsLocationsGithubEnterpriseConfigsListRequest object. + + Fields: + parent: Name of the parent project. For example: + projects/{$project_number} or projects/{$project_id} + projectId: ID of the project + """ + + parent = _messages.StringField(1, required=True) + projectId = _messages.StringField(2) + + +class CloudbuildProjectsLocationsGithubEnterpriseConfigsPatchRequest( + _messages.Message): + r"""A CloudbuildProjectsLocationsGithubEnterpriseConfigsPatchRequest object. + + Fields: + gitHubEnterpriseConfig: A GitHubEnterpriseConfig resource to be passed as + the request body. + name: Optional. The full resource name for the GitHubEnterpriseConfig For + example: "projects/{$project_id}/githubEnterpriseConfigs/{$config_id}" + updateMask: Update mask for the resource. If this is set, the server will + only update the fields specified in the field mask. Otherwise, a full + update of the mutable resource fields will be performed. + """ + + gitHubEnterpriseConfig = _messages.MessageField('GitHubEnterpriseConfig', 1) + name = _messages.StringField(2, required=True) + updateMask = _messages.StringField(3) + + +class CloudbuildProjectsLocationsOperationsCancelRequest(_messages.Message): + r"""A CloudbuildProjectsLocationsOperationsCancelRequest object. + + Fields: + cancelOperationRequest: A CancelOperationRequest resource to be passed as + the request body. + name: The name of the operation resource to be cancelled. + """ + + cancelOperationRequest = _messages.MessageField('CancelOperationRequest', 1) + name = _messages.StringField(2, required=True) + + +class CloudbuildProjectsLocationsOperationsGetRequest(_messages.Message): + r"""A CloudbuildProjectsLocationsOperationsGetRequest object. + + Fields: + name: The name of the operation resource. + """ + + name = _messages.StringField(1, required=True) + + +class CloudbuildProjectsLocationsTriggersCreateRequest(_messages.Message): + r"""A CloudbuildProjectsLocationsTriggersCreateRequest object. + + Fields: + buildTrigger: A BuildTrigger resource to be passed as the request body. + parent: The parent resource where this trigger will be created. Format: + `projects/{project}/locations/{location}` + projectId: Required. ID of the project for which to configure automatic + builds. + """ + + buildTrigger = _messages.MessageField('BuildTrigger', 1) + parent = _messages.StringField(2, required=True) + projectId = _messages.StringField(3) + + +class CloudbuildProjectsLocationsTriggersDeleteRequest(_messages.Message): + r"""A CloudbuildProjectsLocationsTriggersDeleteRequest object. + + Fields: + name: The name of the `Trigger` to delete. Format: + `projects/{project}/locations/{location}/triggers/{trigger}` + projectId: Required. ID of the project that owns the trigger. + triggerId: Required. ID of the `BuildTrigger` to delete. + """ + + name = _messages.StringField(1, required=True) + projectId = _messages.StringField(2) + triggerId = _messages.StringField(3) + + +class CloudbuildProjectsLocationsTriggersGetRequest(_messages.Message): + r"""A CloudbuildProjectsLocationsTriggersGetRequest object. + + Fields: + name: The name of the `Trigger` to retrieve. Format: + `projects/{project}/locations/{location}/triggers/{trigger}` + projectId: Required. ID of the project that owns the trigger. + triggerId: Required. Identifier (`id` or `name`) of the `BuildTrigger` to + get. + """ + + name = _messages.StringField(1, required=True) + projectId = _messages.StringField(2) + triggerId = _messages.StringField(3) + + +class CloudbuildProjectsLocationsTriggersListRequest(_messages.Message): + r"""A CloudbuildProjectsLocationsTriggersListRequest object. + + Fields: + pageSize: Number of results to return in the list. + pageToken: Token to provide to skip to a particular spot in the list. + parent: The parent of the collection of `Triggers`. Format: + `projects/{project}/locations/{location}` + projectId: Required. ID of the project for which to list BuildTriggers. + """ + + pageSize = _messages.IntegerField(1, variant=_messages.Variant.INT32) + pageToken = _messages.StringField(2) + parent = _messages.StringField(3, required=True) + projectId = _messages.StringField(4) + + +class CloudbuildProjectsLocationsTriggersPatchRequest(_messages.Message): + r"""A CloudbuildProjectsLocationsTriggersPatchRequest object. + + Fields: + buildTrigger: A BuildTrigger resource to be passed as the request body. + projectId: Required. ID of the project that owns the trigger. + resourceName: The `Trigger` name with format: + `projects/{project}/locations/{location}/triggers/{trigger}`, where + {trigger} is a unique identifier generated by the service. + triggerId: Required. ID of the `BuildTrigger` to update. + """ + + buildTrigger = _messages.MessageField('BuildTrigger', 1) + projectId = _messages.StringField(2) + resourceName = _messages.StringField(3, required=True) + triggerId = _messages.StringField(4) + + +class CloudbuildProjectsLocationsTriggersRunRequest(_messages.Message): + r"""A CloudbuildProjectsLocationsTriggersRunRequest object. + + Fields: + name: The name of the `Trigger` to run. Format: + `projects/{project}/locations/{location}/triggers/{trigger}` + runBuildTriggerRequest: A RunBuildTriggerRequest resource to be passed as + the request body. + """ + + name = _messages.StringField(1, required=True) + runBuildTriggerRequest = _messages.MessageField('RunBuildTriggerRequest', 2) + + +class CloudbuildProjectsLocationsTriggersWebhookRequest(_messages.Message): + r"""A CloudbuildProjectsLocationsTriggersWebhookRequest object. + + Fields: + httpBody: A HttpBody resource to be passed as the request body. + name: The name of the `ReceiveTriggerWebhook` to retrieve. Format: + `projects/{project}/locations/{location}/triggers/{trigger}` + projectId: Project in which the specified trigger lives + secret: Secret token used for authorization if an OAuth token isn't + provided. + trigger: Name of the trigger to run the payload against + """ + + httpBody = _messages.MessageField('HttpBody', 1) + name = _messages.StringField(2, required=True) + projectId = _messages.StringField(3) + secret = _messages.StringField(4) + trigger = _messages.StringField(5) + + +class CloudbuildProjectsLocationsWorkerPoolsCreateRequest(_messages.Message): + r"""A CloudbuildProjectsLocationsWorkerPoolsCreateRequest object. + + Fields: + parent: Required. The parent resource where this worker pool will be + created. Format: `projects/{project}/locations/{location}`. + validateOnly: If set, validate the request and preview the response, but + do not actually post it. + workerPool: A WorkerPool resource to be passed as the request body. + workerPoolId: Required. Immutable. The ID to use for the `WorkerPool`, + which will become the final component of the resource name. This value + should be 1-63 characters, and valid characters are /a-z-/. + """ + + parent = _messages.StringField(1, required=True) + validateOnly = _messages.BooleanField(2) + workerPool = _messages.MessageField('WorkerPool', 3) + workerPoolId = _messages.StringField(4) + + +class CloudbuildProjectsLocationsWorkerPoolsDeleteRequest(_messages.Message): + r"""A CloudbuildProjectsLocationsWorkerPoolsDeleteRequest object. + + Fields: + allowMissing: If set to true, and the `WorkerPool` is not found, the + request will succeed but no action will be taken on the server. + etag: Optional. If provided, it must match the server's etag on the + workerpool for the request to be processed. + name: Required. The name of the `WorkerPool` to delete. Format: + `projects/{project}/locations/{workerPool}/workerPools/{workerPool}`. + validateOnly: If set, validate the request and preview the response, but + do not actually post it. + """ + + allowMissing = _messages.BooleanField(1) + etag = _messages.StringField(2) + name = _messages.StringField(3, required=True) + validateOnly = _messages.BooleanField(4) + + +class CloudbuildProjectsLocationsWorkerPoolsGetRequest(_messages.Message): + r"""A CloudbuildProjectsLocationsWorkerPoolsGetRequest object. + + Fields: + name: Required. The name of the `WorkerPool` to retrieve. Format: + `projects/{project}/locations/{location}/workerPools/{workerPool}`. + """ + + name = _messages.StringField(1, required=True) + + +class CloudbuildProjectsLocationsWorkerPoolsListRequest(_messages.Message): + r"""A CloudbuildProjectsLocationsWorkerPoolsListRequest object. + + Fields: + pageSize: The maximum number of `WorkerPool`s to return. The service may + return fewer than this value. If omitted, the server will use a sensible + default. + pageToken: A page token, received from a previous `ListWorkerPools` call. + Provide this to retrieve the subsequent page. + parent: Required. The parent of the collection of `WorkerPools`. Format: + `projects/{project}/locations/{location}`. + """ + + pageSize = _messages.IntegerField(1, variant=_messages.Variant.INT32) + pageToken = _messages.StringField(2) + parent = _messages.StringField(3, required=True) + + +class CloudbuildProjectsLocationsWorkerPoolsPatchRequest(_messages.Message): + r"""A CloudbuildProjectsLocationsWorkerPoolsPatchRequest object. + + Fields: + name: Output only. The resource name of the `WorkerPool`, with format + `projects/{project}/locations/{location}/workerPools/{worker_pool}`. The + value of `{worker_pool}` is provided by `worker_pool_id` in + `CreateWorkerPool` request and the value of `{location}` is determined + by the endpoint accessed. + updateMask: A mask specifying which fields in `worker_pool` to update. + validateOnly: If set, validate the request and preview the response, but + do not actually post it. + workerPool: A WorkerPool resource to be passed as the request body. + """ + + name = _messages.StringField(1, required=True) + updateMask = _messages.StringField(2) + validateOnly = _messages.BooleanField(3) + workerPool = _messages.MessageField('WorkerPool', 4) + + +class CloudbuildProjectsTriggersCreateRequest(_messages.Message): + r"""A CloudbuildProjectsTriggersCreateRequest object. + + Fields: + buildTrigger: A BuildTrigger resource to be passed as the request body. + parent: The parent resource where this trigger will be created. Format: + `projects/{project}/locations/{location}` + projectId: Required. ID of the project for which to configure automatic + builds. + """ + + buildTrigger = _messages.MessageField('BuildTrigger', 1) + parent = _messages.StringField(2) + projectId = _messages.StringField(3, required=True) + + +class CloudbuildProjectsTriggersDeleteRequest(_messages.Message): + r"""A CloudbuildProjectsTriggersDeleteRequest object. + + Fields: + name: The name of the `Trigger` to delete. Format: + `projects/{project}/locations/{location}/triggers/{trigger}` + projectId: Required. ID of the project that owns the trigger. + triggerId: Required. ID of the `BuildTrigger` to delete. + """ + + name = _messages.StringField(1) + projectId = _messages.StringField(2, required=True) + triggerId = _messages.StringField(3, required=True) + + +class CloudbuildProjectsTriggersGetRequest(_messages.Message): + r"""A CloudbuildProjectsTriggersGetRequest object. + + Fields: + name: The name of the `Trigger` to retrieve. Format: + `projects/{project}/locations/{location}/triggers/{trigger}` + projectId: Required. ID of the project that owns the trigger. + triggerId: Required. Identifier (`id` or `name`) of the `BuildTrigger` to + get. + """ + + name = _messages.StringField(1) + projectId = _messages.StringField(2, required=True) + triggerId = _messages.StringField(3, required=True) + + +class CloudbuildProjectsTriggersListRequest(_messages.Message): + r"""A CloudbuildProjectsTriggersListRequest object. + + Fields: + pageSize: Number of results to return in the list. + pageToken: Token to provide to skip to a particular spot in the list. + parent: The parent of the collection of `Triggers`. Format: + `projects/{project}/locations/{location}` + projectId: Required. ID of the project for which to list BuildTriggers. + """ + + pageSize = _messages.IntegerField(1, variant=_messages.Variant.INT32) + pageToken = _messages.StringField(2) + parent = _messages.StringField(3) + projectId = _messages.StringField(4, required=True) + + +class CloudbuildProjectsTriggersPatchRequest(_messages.Message): + r"""A CloudbuildProjectsTriggersPatchRequest object. + + Fields: + buildTrigger: A BuildTrigger resource to be passed as the request body. + projectId: Required. ID of the project that owns the trigger. + triggerId: Required. ID of the `BuildTrigger` to update. + """ + + buildTrigger = _messages.MessageField('BuildTrigger', 1) + projectId = _messages.StringField(2, required=True) + triggerId = _messages.StringField(3, required=True) + + +class CloudbuildProjectsTriggersRunRequest(_messages.Message): + r"""A CloudbuildProjectsTriggersRunRequest object. + + Fields: + name: The name of the `Trigger` to run. Format: + `projects/{project}/locations/{location}/triggers/{trigger}` + projectId: Required. ID of the project. + repoSource: A RepoSource resource to be passed as the request body. + triggerId: Required. ID of the trigger. + """ + + name = _messages.StringField(1) + projectId = _messages.StringField(2, required=True) + repoSource = _messages.MessageField('RepoSource', 3) + triggerId = _messages.StringField(4, required=True) + + +class CloudbuildProjectsTriggersWebhookRequest(_messages.Message): + r"""A CloudbuildProjectsTriggersWebhookRequest object. + + Fields: + httpBody: A HttpBody resource to be passed as the request body. + name: The name of the `ReceiveTriggerWebhook` to retrieve. Format: + `projects/{project}/locations/{location}/triggers/{trigger}` + projectId: Project in which the specified trigger lives + secret: Secret token used for authorization if an OAuth token isn't + provided. + trigger: Name of the trigger to run the payload against + """ + + httpBody = _messages.MessageField('HttpBody', 1) + name = _messages.StringField(2) + projectId = _messages.StringField(3, required=True) + secret = _messages.StringField(4) + trigger = _messages.StringField(5, required=True) + + +class CloudbuildWebhookRequest(_messages.Message): + r"""A CloudbuildWebhookRequest object. + + Fields: + httpBody: A HttpBody resource to be passed as the request body. + webhookKey: For GitHub Enterprise webhooks, this key is used to associate + the webhook request with the GitHubEnterpriseConfig to use for + validation. + """ + + httpBody = _messages.MessageField('HttpBody', 1) + webhookKey = _messages.StringField(2) + + +class CreateBitbucketServerConfigOperationMetadata(_messages.Message): + r"""Metadata for `CreateBitbucketServerConfig` operation. + + Fields: + bitbucketServerConfig: The resource name of the BitbucketServerConfig to + be created. Format: + `projects/{project}/locations/{location}/bitbucketServerConfigs/{id}`. + completeTime: Time the operation was completed. + createTime: Time the operation was created. + """ + + bitbucketServerConfig = _messages.StringField(1) + completeTime = _messages.StringField(2) + createTime = _messages.StringField(3) + + +class CreateBitbucketServerConnectedRepositoryRequest(_messages.Message): + r"""Request to connect a repository from a connected Bitbucket Server host. + + Fields: + bitbucketServerConnectedRepository: Required. The Bitbucket Server + repository to connect. + parent: Required. The name of the `BitbucketServerConfig` that added + connected repository. Format: `projects/{project}/locations/{location}/b + itbucketServerConfigs/{config}` + """ + + bitbucketServerConnectedRepository = _messages.MessageField( + 'BitbucketServerConnectedRepository', 1) + parent = _messages.StringField(2) + + +class CreateGitHubEnterpriseConfigOperationMetadata(_messages.Message): + r"""Metadata for `CreateGithubEnterpriseConfig` operation. + + Fields: + completeTime: Time the operation was completed. + createTime: Time the operation was created. + githubEnterpriseConfig: The resource name of the GitHubEnterprise to be + created. Format: + `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. + """ + + completeTime = _messages.StringField(1) + createTime = _messages.StringField(2) + githubEnterpriseConfig = _messages.StringField(3) + + +class CreateGitLabConfigOperationMetadata(_messages.Message): + r"""Metadata for `CreateGitLabConfig` operation. + + Fields: + completeTime: Time the operation was completed. + createTime: Time the operation was created. + gitlabConfig: The resource name of the GitLabConfig to be created. Format: + `projects/{project}/locations/{location}/gitlabConfigs/{id}`. + """ + + completeTime = _messages.StringField(1) + createTime = _messages.StringField(2) + gitlabConfig = _messages.StringField(3) + + +class CreateWorkerPoolOperationMetadata(_messages.Message): + r"""Metadata for the `CreateWorkerPool` operation. + + Fields: + completeTime: Time the operation was completed. + createTime: Time the operation was created. + workerPool: The resource name of the `WorkerPool` to create. Format: + `projects/{project}/locations/{location}/workerPools/{worker_pool}`. + """ + + completeTime = _messages.StringField(1) + createTime = _messages.StringField(2) + workerPool = _messages.StringField(3) + + +class DeleteBitbucketServerConfigOperationMetadata(_messages.Message): + r"""Metadata for `DeleteBitbucketServerConfig` operation. + + Fields: + bitbucketServerConfig: The resource name of the BitbucketServerConfig to + be deleted. Format: + `projects/{project}/locations/{location}/bitbucketServerConfigs/{id}`. + completeTime: Time the operation was completed. + createTime: Time the operation was created. + """ + + bitbucketServerConfig = _messages.StringField(1) + completeTime = _messages.StringField(2) + createTime = _messages.StringField(3) + + +class DeleteGitHubEnterpriseConfigOperationMetadata(_messages.Message): + r"""Metadata for `DeleteGitHubEnterpriseConfig` operation. + + Fields: + completeTime: Time the operation was completed. + createTime: Time the operation was created. + githubEnterpriseConfig: The resource name of the GitHubEnterprise to be + deleted. Format: + `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. + """ + + completeTime = _messages.StringField(1) + createTime = _messages.StringField(2) + githubEnterpriseConfig = _messages.StringField(3) + + +class DeleteGitLabConfigOperationMetadata(_messages.Message): + r"""Metadata for `DeleteGitLabConfig` operation. + + Fields: + completeTime: Time the operation was completed. + createTime: Time the operation was created. + gitlabConfig: The resource name of the GitLabConfig to be created. Format: + `projects/{project}/locations/{location}/gitlabConfigs/{id}`. + """ + + completeTime = _messages.StringField(1) + createTime = _messages.StringField(2) + gitlabConfig = _messages.StringField(3) + + +class DeleteWorkerPoolOperationMetadata(_messages.Message): + r"""Metadata for the `DeleteWorkerPool` operation. + + Fields: + completeTime: Time the operation was completed. + createTime: Time the operation was created. + workerPool: The resource name of the `WorkerPool` being deleted. Format: + `projects/{project}/locations/{location}/workerPools/{worker_pool}`. + """ + + completeTime = _messages.StringField(1) + createTime = _messages.StringField(2) + workerPool = _messages.StringField(3) + + +class Empty(_messages.Message): + r"""A generic empty message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to use it as the request + or the response type of an API method. For instance: service Foo { rpc + Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + representation for `Empty` is empty JSON object `{}`. + """ + + +class FailureInfo(_messages.Message): + r"""A fatal problem encountered during the execution of the build. + + Enums: + TypeValueValuesEnum: The name of the failure. + + Fields: + detail: Explains the failure issue in more detail using hard-coded text. + type: The name of the failure. + """ + class TypeValueValuesEnum(_messages.Enum): + r"""The name of the failure. + + Values: + FAILURE_TYPE_UNSPECIFIED: Type unspecified + PUSH_FAILED: Unable to push the image to the repository. + PUSH_IMAGE_NOT_FOUND: Final image not found. + PUSH_NOT_AUTHORIZED: Unauthorized push of the final image. + LOGGING_FAILURE: Backend logging failures. Should retry. + USER_BUILD_STEP: A build step has failed. + FETCH_SOURCE_FAILED: The source fetching has failed. + """ + FAILURE_TYPE_UNSPECIFIED = 0 + PUSH_FAILED = 1 + PUSH_IMAGE_NOT_FOUND = 2 + PUSH_NOT_AUTHORIZED = 3 + LOGGING_FAILURE = 4 + USER_BUILD_STEP = 5 + FETCH_SOURCE_FAILED = 6 + + detail = _messages.StringField(1) + type = _messages.EnumField('TypeValueValuesEnum', 2) + + +class FileHashes(_messages.Message): + r"""Container message for hashes of byte content of files, used in + SourceProvenance messages to verify integrity of source input to the build. + + Fields: + fileHash: Collection of file hashes. + """ + + fileHash = _messages.MessageField('Hash', 1, repeated=True) -class CloudbuildProjectsTriggersWebhookRequest(_messages.Message): - r"""A CloudbuildProjectsTriggersWebhookRequest object. +class GitFileSource(_messages.Message): + r"""GitFileSource describes a file within a (possibly remote) code + repository. + + Enums: + RepoTypeValueValuesEnum: See RepoType above. Fields: - httpBody: A HttpBody resource to be passed as the request body. - projectId: Project in which the specified trigger lives - secret: Secret token used for authorization if an OAuth token isn't - provided. - trigger: Name of the trigger to run the payload against + bitbucketServerConfig: The full resource name of the bitbucket server + config. Format: + `projects/{project}/locations/{location}/bitbucketServerConfigs/{id}`. + githubEnterpriseConfig: The full resource name of the github enterprise + config. Format: + `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. + `projects/{project}/githubEnterpriseConfigs/{id}`. + path: The path of the file, with the repo root as the root of the path. + repoType: See RepoType above. + revision: The branch, tag, arbitrary ref, or SHA version of the repo to + use when resolving the filename (optional). This field respects the same + syntax/resolution as described here: https://git- + scm.com/docs/gitrevisions If unspecified, the revision from which the + trigger invocation originated is assumed to be the revision from which + to read the specified path. + uri: The URI of the repo (optional). If unspecified, the repo from which + the trigger invocation originated is assumed to be the repo from which + to read the specified path. """ + class RepoTypeValueValuesEnum(_messages.Enum): + r"""See RepoType above. - httpBody = _messages.MessageField('HttpBody', 1) - projectId = _messages.StringField(2, required=True) - secret = _messages.StringField(3) - trigger = _messages.StringField(4, required=True) + Values: + UNKNOWN: The default, unknown repo type. + CLOUD_SOURCE_REPOSITORIES: A Google Cloud Source Repositories-hosted + repo. + GITHUB: A GitHub-hosted repo not necessarily on "github.com" (i.e. + GitHub Enterprise). + BITBUCKET_SERVER: A Bitbucket Server-hosted repo. + """ + UNKNOWN = 0 + CLOUD_SOURCE_REPOSITORIES = 1 + GITHUB = 2 + BITBUCKET_SERVER = 3 + bitbucketServerConfig = _messages.StringField(1) + githubEnterpriseConfig = _messages.StringField(2) + path = _messages.StringField(3) + repoType = _messages.EnumField('RepoTypeValueValuesEnum', 4) + revision = _messages.StringField(5) + uri = _messages.StringField(6) -class Empty(_messages.Message): - r"""A generic empty message that you can re-use to avoid defining duplicated - empty messages in your APIs. A typical example is to use it as the request - or the response type of an API method. For instance: service Foo { rpc - Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - representation for `Empty` is empty JSON object `{}`. + +class GitHubEnterpriseConfig(_messages.Message): + r"""GitHubEnterpriseConfig represents a configuration for a GitHub + Enterprise server. + + Fields: + appId: Required. The GitHub app id of the Cloud Build app on the GitHub + Enterprise server. + createTime: Output only. Time when the installation was associated with + the project. + displayName: Name to display for this config. + hostUrl: The URL of the github enterprise host the configuration is for. + name: Optional. The full resource name for the GitHubEnterpriseConfig For + example: "projects/{$project_id}/githubEnterpriseConfigs/{$config_id}" + peeredNetwork: Optional. The network to be used when reaching out to the + GitHub Enterprise server. The VPC network must be enabled for private + service connection. This should be set if the GitHub Enterprise server + is hosted on-premises and not reachable by public internet. If this + field is left empty, no network peering will occur and calls to the + GitHub Enterprise server will be made over the public internet. Must be + in the format `projects/{project}/global/networks/{network}`, where + {project} is a project number or id and {network} is the name of a VPC + network in the project. + secrets: Names of secrets in Secret Manager. + sslCa: Optional. SSL certificate to use for requests to GitHub Enterprise. + webhookKey: The key that should be attached to webhook calls to the + ReceiveWebhook endpoint. """ + appId = _messages.IntegerField(1) + createTime = _messages.StringField(2) + displayName = _messages.StringField(3) + hostUrl = _messages.StringField(4) + name = _messages.StringField(5) + peeredNetwork = _messages.StringField(6) + secrets = _messages.MessageField('GitHubEnterpriseSecrets', 7) + sslCa = _messages.StringField(8) + webhookKey = _messages.StringField(9) -class FileHashes(_messages.Message): - r"""Container message for hashes of byte content of files, used in - SourceProvenance messages to verify integrity of source input to the build. + +class GitHubEnterpriseSecrets(_messages.Message): + r"""GitHubEnterpriseSecrets represents the names of all necessary secrets in + Secret Manager for a GitHub Enterprise server. Format is: + projects//secrets/. Fields: - fileHash: Collection of file hashes. + oauthClientIdName: The resource name for the OAuth client ID secret in + Secret Manager. + oauthClientIdVersionName: The resource name for the OAuth client ID secret + version in Secret Manager. + oauthSecretName: The resource name for the OAuth secret in Secret Manager. + oauthSecretVersionName: The resource name for the OAuth secret secret + version in Secret Manager. + privateKeyName: The resource name for the private key secret. + privateKeyVersionName: The resource name for the private key secret + version. + webhookSecretName: The resource name for the webhook secret in Secret + Manager. + webhookSecretVersionName: The resource name for the webhook secret secret + version in Secret Manager. """ - fileHash = _messages.MessageField('Hash', 1, repeated=True) + oauthClientIdName = _messages.StringField(1) + oauthClientIdVersionName = _messages.StringField(2) + oauthSecretName = _messages.StringField(3) + oauthSecretVersionName = _messages.StringField(4) + privateKeyName = _messages.StringField(5) + privateKeyVersionName = _messages.StringField(6) + webhookSecretName = _messages.StringField(7) + webhookSecretVersionName = _messages.StringField(8) class GitHubEventsConfig(_messages.Message): r"""GitHubEventsConfig describes the configuration of a trigger that creates - a build whenever a GitHub event is received. This message is experimental. + a build whenever a GitHub event is received. Fields: + enterpriseConfigResourceName: Optional. The resource name of the github + enterprise config that should be applied to this installation. For + example: "projects/{$project_id}/githubEnterpriseConfigs/{$config_id}" installationId: The installationID that emits the GitHub event. name: Name of the repository. For example: The name for https://github.com/googlecloudplatform/cloud-builders is "cloud- @@ -965,11 +2295,80 @@ class GitHubEventsConfig(_messages.Message): push: filter to match changes in refs like branches, tags. """ - installationId = _messages.IntegerField(1) - name = _messages.StringField(2) - owner = _messages.StringField(3) - pullRequest = _messages.MessageField('PullRequestFilter', 4) - push = _messages.MessageField('PushFilter', 5) + enterpriseConfigResourceName = _messages.StringField(1) + installationId = _messages.IntegerField(2) + name = _messages.StringField(3) + owner = _messages.StringField(4) + pullRequest = _messages.MessageField('PullRequestFilter', 5) + push = _messages.MessageField('PushFilter', 6) + + +class GitRepoSource(_messages.Message): + r"""GitRepoSource describes a repo and ref of a code repository. + + Enums: + RepoTypeValueValuesEnum: See RepoType below. + + Fields: + bitbucketServerConfig: The full resource name of the bitbucket server + config. Format: + `projects/{project}/locations/{location}/bitbucketServerConfigs/{id}`. + githubEnterpriseConfig: The full resource name of the github enterprise + config. Format: + `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. + `projects/{project}/githubEnterpriseConfigs/{id}`. + ref: The branch or tag to use. Must start with "refs/" (required). + repoType: See RepoType below. + uri: The URI of the repo (required). + """ + class RepoTypeValueValuesEnum(_messages.Enum): + r"""See RepoType below. + + Values: + UNKNOWN: The default, unknown repo type. + CLOUD_SOURCE_REPOSITORIES: A Google Cloud Source Repositories-hosted + repo. + GITHUB: A GitHub-hosted repo not necessarily on "github.com" (i.e. + GitHub Enterprise). + BITBUCKET_SERVER: A Bitbucket Server-hosted repo. + """ + UNKNOWN = 0 + CLOUD_SOURCE_REPOSITORIES = 1 + GITHUB = 2 + BITBUCKET_SERVER = 3 + + bitbucketServerConfig = _messages.StringField(1) + githubEnterpriseConfig = _messages.StringField(2) + ref = _messages.StringField(3) + repoType = _messages.EnumField('RepoTypeValueValuesEnum', 4) + uri = _messages.StringField(5) + + +class GoogleDevtoolsCloudbuildV2OperationMetadata(_messages.Message): + r"""Represents the metadata of the long-running operation. + + Fields: + apiVersion: Output only. API version used to start the operation. + createTime: Output only. The time the operation was created. + endTime: Output only. The time the operation finished running. + requestedCancellation: Output only. Identifies whether the user has + requested cancellation of the operation. Operations that have + successfully been cancelled have Operation.error value with a + google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + statusMessage: Output only. Human-readable status of the operation, if + any. + target: Output only. Server-defined resource path for the target of the + operation. + verb: Output only. Name of the verb executed by the operation. + """ + + apiVersion = _messages.StringField(1) + createTime = _messages.StringField(2) + endTime = _messages.StringField(3) + requestedCancellation = _messages.BooleanField(4) + statusMessage = _messages.StringField(5) + target = _messages.StringField(6) + verb = _messages.StringField(7) class HTTPDelivery(_messages.Message): @@ -1121,6 +2520,35 @@ class AdditionalProperty(_messages.Message): kmsKeyName = _messages.StringField(2) +class ListBitbucketServerConfigsResponse(_messages.Message): + r"""RPC response object returned by ListBitbucketServerConfigs RPC method. + + Fields: + bitbucketServerConfigs: A list of BitbucketServerConfigs + nextPageToken: A token that can be sent as `page_token` to retrieve the + next page. If this field is omitted, there are no subsequent pages. + """ + + bitbucketServerConfigs = _messages.MessageField( + 'BitbucketServerConfig', 1, repeated=True) + nextPageToken = _messages.StringField(2) + + +class ListBitbucketServerRepositoriesResponse(_messages.Message): + r"""RPC response object returned by the ListBitbucketServerRepositories RPC + method. + + Fields: + bitbucketServerRepositories: List of Bitbucket Server repositories. + nextPageToken: A token that can be sent as `page_token` to retrieve the + next page. If this field is omitted, there are no subsequent pages. + """ + + bitbucketServerRepositories = _messages.MessageField( + 'BitbucketServerRepository', 1, repeated=True) + nextPageToken = _messages.StringField(2) + + class ListBuildTriggersResponse(_messages.Message): r"""Response containing existing `BuildTriggers`. @@ -1147,6 +2575,67 @@ class ListBuildsResponse(_messages.Message): nextPageToken = _messages.StringField(2) +class ListGithubEnterpriseConfigsResponse(_messages.Message): + r"""RPC response object returned by ListGithubEnterpriseConfigs RPC method. + + Fields: + configs: A list of GitHubEnterpriseConfigs + """ + + configs = _messages.MessageField('GitHubEnterpriseConfig', 1, repeated=True) + + +class ListWorkerPoolsResponse(_messages.Message): + r"""Response containing existing `WorkerPools`. + + Fields: + nextPageToken: Continuation token used to page through large result sets. + Provide this value in a subsequent ListWorkerPoolsRequest to return the + next page of results. + workerPools: `WorkerPools` for the specified project. + """ + + nextPageToken = _messages.StringField(1) + workerPools = _messages.MessageField('WorkerPool', 2, repeated=True) + + +class NetworkConfig(_messages.Message): + r"""Defines the network configuration for the pool. + + Enums: + EgressOptionValueValuesEnum: Option to configure network egress for the + workers. + + Fields: + egressOption: Option to configure network egress for the workers. + peeredNetwork: Required. Immutable. The network definition that the + workers are peered to. If this section is left empty, the workers will + be peered to `WorkerPool.project_id` on the service producer network. + Must be in the format `projects/{project}/global/networks/{network}`, + where `{project}` is a project number, such as `12345`, and `{network}` + is the name of a VPC network in the project. See [Understanding network + configuration options](https://cloud.google.com/build/docs/private- + pools/set-up-private-pool-environment) + """ + class EgressOptionValueValuesEnum(_messages.Enum): + r"""Option to configure network egress for the workers. + + Values: + EGRESS_OPTION_UNSPECIFIED: If set, defaults to PUBLIC_EGRESS. + NO_PUBLIC_EGRESS: If set, workers are created without any public + address, which prevents network egress to public IPs unless a network + proxy is configured. + PUBLIC_EGRESS: If set, workers are created with a public address which + allows for public internet egress. + """ + EGRESS_OPTION_UNSPECIFIED = 0 + NO_PUBLIC_EGRESS = 1 + PUBLIC_EGRESS = 2 + + egressOption = _messages.EnumField('EgressOptionValueValuesEnum', 1) + peeredNetwork = _messages.StringField(2) + + class Notification(_messages.Message): r"""Notification is the container which holds the data that is relevant to this particular notification. @@ -1377,6 +2866,117 @@ class AdditionalProperty(_messages.Message): response = _messages.MessageField('ResponseValue', 5) +class OperationMetadata(_messages.Message): + r"""Represents the metadata of the long-running operation. + + Fields: + apiVersion: Output only. API version used to start the operation. + cancelRequested: Output only. Identifies whether the user has requested + cancellation of the operation. Operations that have been cancelled + successfully have Operation.error value with a google.rpc.Status.code of + 1, corresponding to `Code.CANCELLED`. + createTime: Output only. The time the operation was created. + endTime: Output only. The time the operation finished running. + statusDetail: Output only. Human-readable status of the operation, if any. + target: Output only. Server-defined resource path for the target of the + operation. + verb: Output only. Name of the verb executed by the operation. + """ + + apiVersion = _messages.StringField(1) + cancelRequested = _messages.BooleanField(2) + createTime = _messages.StringField(3) + endTime = _messages.StringField(4) + statusDetail = _messages.StringField(5) + target = _messages.StringField(6) + verb = _messages.StringField(7) + + +class PoolOption(_messages.Message): + r"""Details about how a build should be executed on a `WorkerPool`. See + [running builds in a private + pool](https://cloud.google.com/build/docs/private-pools/run-builds-in- + private-pool) for more information. + + Fields: + name: The `WorkerPool` resource to execute the build on. You must have + `cloudbuild.workerpools.use` on the project hosting the WorkerPool. + Format + projects/{project}/locations/{location}/workerPools/{workerPoolId} + """ + + name = _messages.StringField(1) + + +class PrivatePoolV1Config(_messages.Message): + r"""Configuration for a V1 `PrivatePool`. + + Fields: + networkConfig: Network configuration for the pool. + workerConfig: Machine configuration for the workers in the pool. + """ + + networkConfig = _messages.MessageField('NetworkConfig', 1) + workerConfig = _messages.MessageField('WorkerConfig', 2) + + +class ProcessAppManifestCallbackOperationMetadata(_messages.Message): + r"""Metadata for `ProcessAppManifestCallback` operation. + + Fields: + completeTime: Time the operation was completed. + createTime: Time the operation was created. + githubEnterpriseConfig: The resource name of the GitHubEnterprise to be + created. Format: + `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. + """ + + completeTime = _messages.StringField(1) + createTime = _messages.StringField(2) + githubEnterpriseConfig = _messages.StringField(3) + + +class PubsubConfig(_messages.Message): + r"""PubsubConfig describes the configuration of a trigger that creates a + build whenever a Pub/Sub message is published. + + Enums: + StateValueValuesEnum: Potential issues with the underlying Pub/Sub + subscription configuration. Only populated on get requests. + + Fields: + serviceAccountEmail: Service account that will make the push request. + state: Potential issues with the underlying Pub/Sub subscription + configuration. Only populated on get requests. + subscription: Output only. Name of the subscription. Format is + `projects/{project}/subscriptions/{subscription}`. + topic: The name of the topic from which this subscription is receiving + messages. Format is `projects/{project}/topics/{topic}`. + """ + class StateValueValuesEnum(_messages.Enum): + r"""Potential issues with the underlying Pub/Sub subscription + configuration. Only populated on get requests. + + Values: + STATE_UNSPECIFIED: The subscription configuration has not been checked. + OK: The Pub/Sub subscription is properly configured. + SUBSCRIPTION_DELETED: The subscription has been deleted. + TOPIC_DELETED: The topic has been deleted. + SUBSCRIPTION_MISCONFIGURED: Some of the subscription's field are + misconfigured. + """ + STATE_UNSPECIFIED = 0 + OK = 1 + SUBSCRIPTION_DELETED = 2 + TOPIC_DELETED = 3 + SUBSCRIPTION_MISCONFIGURED = 4 + + serviceAccountEmail = _messages.StringField(1) + state = _messages.EnumField('StateValueValuesEnum', 2) + subscription = _messages.StringField(3) + topic = _messages.StringField(4) + + class PullRequestFilter(_messages.Message): r"""PullRequestFilter contains filter properties for matching GitHub Pull Requests. @@ -1441,6 +3041,17 @@ class ReceiveTriggerWebhookResponse(_messages.Message): """ +class RemoveBitbucketServerConnectedRepositoryRequest(_messages.Message): + r"""RPC request object accepted by RemoveBitbucketServerConnectedRepository + RPC method. + + Fields: + connectedRepository: The connected repository to remove. + """ + + connectedRepository = _messages.MessageField('BitbucketServerRepositoryId', 1) + + class RepoSource(_messages.Message): r"""Location of the source in a Google Cloud Source Repository. @@ -1545,6 +3156,48 @@ class RetryBuildRequest(_messages.Message): projectId = _messages.StringField(3) +class RunBuildTriggerRequest(_messages.Message): + r"""Specifies a build trigger to run and the source to use. + + Fields: + projectId: Required. ID of the project. + source: Source to build against this trigger. Branch and tag names cannot + consist of regular expressions. + triggerId: Required. ID of the trigger. + """ + + projectId = _messages.StringField(1) + source = _messages.MessageField('RepoSource', 2) + triggerId = _messages.StringField(3) + + +class RunWorkflowCustomOperationMetadata(_messages.Message): + r"""Represents the custom metadata of the RunWorkflow long-running + operation. + + Fields: + apiVersion: Output only. API version used to start the operation. + createTime: Output only. The time the operation was created. + endTime: Output only. The time the operation finished running. + pipelineRunId: Output only. ID of the pipeline run created by RunWorkflow. + requestedCancellation: Output only. Identifies whether the user has + requested cancellation of the operation. Operations that have + successfully been cancelled have Operation.error value with a + google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + target: Output only. Server-defined resource path for the target of the + operation. + verb: Output only. Name of the verb executed by the operation. + """ + + apiVersion = _messages.StringField(1) + createTime = _messages.StringField(2) + endTime = _messages.StringField(3) + pipelineRunId = _messages.StringField(4) + requestedCancellation = _messages.BooleanField(5) + target = _messages.StringField(6) + verb = _messages.StringField(7) + + class SMTPDelivery(_messages.Message): r"""SMTPDelivery is the delivery configuration for an SMTP (email) notification. @@ -1675,10 +3328,15 @@ class Source(_messages.Message): Source Repository. storageSource: If provided, get the source from this location in Google Cloud Storage. + storageSourceManifest: If provided, get the source from this manifest in + Google Cloud Storage. This feature is in Preview; see description + [here](https://github.com/GoogleCloudPlatform/cloud- + builders/tree/master/gcs-fetcher). """ repoSource = _messages.MessageField('RepoSource', 1) storageSource = _messages.MessageField('StorageSource', 2) + storageSourceManifest = _messages.MessageField('StorageSourceManifest', 3) class SourceProvenance(_messages.Message): @@ -1708,6 +3366,9 @@ class SourceProvenance(_messages.Message): with any revisions resolved. resolvedStorageSource: A copy of the build's `source.storage_source`, if exists, with any generations resolved. + resolvedStorageSourceManifest: A copy of the build's + `source.storage_source_manifest`, if exists, with any revisions + resolved. This feature is in Preview. """ @encoding.MapUnrecognizedFields('additionalProperties') class FileHashesValue(_messages.Message): @@ -1742,6 +3403,8 @@ class AdditionalProperty(_messages.Message): fileHashes = _messages.MessageField('FileHashesValue', 1) resolvedRepoSource = _messages.MessageField('RepoSource', 2) resolvedStorageSource = _messages.MessageField('StorageSource', 3) + resolvedStorageSourceManifest = _messages.MessageField( + 'StorageSourceManifest', 4) class StandardQueryParameters(_messages.Message): @@ -1866,7 +3529,29 @@ class StorageSource(_messages.Message): generation: Google Cloud Storage generation for the object. If the generation is omitted, the latest generation will be used. object: Google Cloud Storage object containing the source. This object - must be a gzipped archive file (`.tar.gz`) containing source to build. + must be a zipped (`.zip`) or gzipped archive file (`.tar.gz`) containing + source to build. + """ + + bucket = _messages.StringField(1) + generation = _messages.IntegerField(2) + object = _messages.StringField(3) + + +class StorageSourceManifest(_messages.Message): + r"""Location of the source manifest in Google Cloud Storage. This feature is + in Preview; see description + [here](https://github.com/GoogleCloudPlatform/cloud- + builders/tree/master/gcs-fetcher). + + Fields: + bucket: Google Cloud Storage bucket containing the source manifest (see + [Bucket Name Requirements](https://cloud.google.com/storage/docs/bucket- + naming#requirements)). + generation: Google Cloud Storage generation for the object. If the + generation is omitted, the latest generation will be used. + object: Google Cloud Storage object containing the source manifest. This + object must be a JSON file. """ bucket = _messages.StringField(1) @@ -1886,6 +3571,68 @@ class TimeSpan(_messages.Message): startTime = _messages.StringField(2) +class UpdateBitbucketServerConfigOperationMetadata(_messages.Message): + r"""Metadata for `UpdateBitbucketServerConfig` operation. + + Fields: + bitbucketServerConfig: The resource name of the BitbucketServerConfig to + be updated. Format: + `projects/{project}/locations/{location}/bitbucketServerConfigs/{id}`. + completeTime: Time the operation was completed. + createTime: Time the operation was created. + """ + + bitbucketServerConfig = _messages.StringField(1) + completeTime = _messages.StringField(2) + createTime = _messages.StringField(3) + + +class UpdateGitHubEnterpriseConfigOperationMetadata(_messages.Message): + r"""Metadata for `UpdateGitHubEnterpriseConfig` operation. + + Fields: + completeTime: Time the operation was completed. + createTime: Time the operation was created. + githubEnterpriseConfig: The resource name of the GitHubEnterprise to be + updated. Format: + `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. + """ + + completeTime = _messages.StringField(1) + createTime = _messages.StringField(2) + githubEnterpriseConfig = _messages.StringField(3) + + +class UpdateGitLabConfigOperationMetadata(_messages.Message): + r"""Metadata for `UpdateGitLabConfig` operation. + + Fields: + completeTime: Time the operation was completed. + createTime: Time the operation was created. + gitlabConfig: The resource name of the GitLabConfig to be created. Format: + `projects/{project}/locations/{location}/gitlabConfigs/{id}`. + """ + + completeTime = _messages.StringField(1) + createTime = _messages.StringField(2) + gitlabConfig = _messages.StringField(3) + + +class UpdateWorkerPoolOperationMetadata(_messages.Message): + r"""Metadata for the `UpdateWorkerPool` operation. + + Fields: + completeTime: Time the operation was completed. + createTime: Time the operation was created. + workerPool: The resource name of the `WorkerPool` being updated. Format: + `projects/{project}/locations/{location}/workerPools/{worker_pool}`. + """ + + completeTime = _messages.StringField(1) + createTime = _messages.StringField(2) + workerPool = _messages.StringField(3) + + class Volume(_messages.Message): r"""Volume describes a Docker container volume which is mounted into build steps in order to persist files across build step execution. @@ -1903,6 +3650,184 @@ class Volume(_messages.Message): path = _messages.StringField(2) +class Warning(_messages.Message): + r"""A non-fatal problem encountered during the execution of the build. + + Enums: + PriorityValueValuesEnum: The priority for this warning. + + Fields: + priority: The priority for this warning. + text: Explanation of the warning generated. + """ + class PriorityValueValuesEnum(_messages.Enum): + r"""The priority for this warning. + + Values: + PRIORITY_UNSPECIFIED: Should not be used. + INFO: e.g. deprecation warnings and alternative feature highlights. + WARNING: e.g. automated detection of possible issues with the build. + ALERT: e.g. alerts that a feature used in the build is pending removal + """ + PRIORITY_UNSPECIFIED = 0 + INFO = 1 + WARNING = 2 + ALERT = 3 + + priority = _messages.EnumField('PriorityValueValuesEnum', 1) + text = _messages.StringField(2) + + +class WebhookConfig(_messages.Message): + r"""WebhookConfig describes the configuration of a trigger that creates a + build whenever a webhook is sent to a trigger's webhook URL. + + Enums: + StateValueValuesEnum: Potential issues with the underlying Pub/Sub + subscription configuration. Only populated on get requests. + + Fields: + secret: Required. Resource name for the secret required as a URL + parameter. + state: Potential issues with the underlying Pub/Sub subscription + configuration. Only populated on get requests. + """ + class StateValueValuesEnum(_messages.Enum): + r"""Potential issues with the underlying Pub/Sub subscription + configuration. Only populated on get requests. + + Values: + STATE_UNSPECIFIED: The webhook auth configuration not been checked. + OK: The auth configuration is properly setup. + SECRET_DELETED: The secret provided in auth_method has been deleted. + """ + STATE_UNSPECIFIED = 0 + OK = 1 + SECRET_DELETED = 2 + + secret = _messages.StringField(1) + state = _messages.EnumField('StateValueValuesEnum', 2) + + +class WorkerConfig(_messages.Message): + r"""Defines the configuration to be used for creating workers in the pool. + + Fields: + diskSizeGb: Size of the disk attached to the worker, in GB. See [Worker + pool config file](https://cloud.google.com/build/docs/private- + pools/worker-pool-config-file-schema). Specify a value of up to 1000. If + `0` is specified, Cloud Build will use a standard disk size. + machineType: Machine type of a worker, such as `e2-medium`. See [Worker + pool config file](https://cloud.google.com/build/docs/private- + pools/worker-pool-config-file-schema). If left blank, Cloud Build will + use a sensible default. + """ + + diskSizeGb = _messages.IntegerField(1) + machineType = _messages.StringField(2) + + +class WorkerPool(_messages.Message): + r"""Configuration for a `WorkerPool`. Cloud Build owns and maintains a pool + of workers for general use and have no access to a project's private + network. By default, builds submitted to Cloud Build will use a worker from + this pool. If your build needs access to resources on a private network, + create and use a `WorkerPool` to run your builds. Private `WorkerPool`s give + your builds access to any single VPC network that you administer, including + any on-prem resources connected to that VPC network. For an overview of + private pools, see [Private pools + overview](https://cloud.google.com/build/docs/private-pools/private-pools- + overview). + + Enums: + StateValueValuesEnum: Output only. `WorkerPool` state. + + Messages: + AnnotationsValue: User specified annotations. See + https://google.aip.dev/128#annotations for more details such as format + and size limitations. + + Fields: + annotations: User specified annotations. See + https://google.aip.dev/128#annotations for more details such as format + and size limitations. + createTime: Output only. Time at which the request to create the + `WorkerPool` was received. + deleteTime: Output only. Time at which the request to delete the + `WorkerPool` was received. + displayName: A user-specified, human-readable name for the `WorkerPool`. + If provided, this value must be 1-63 characters. + etag: Output only. Checksum computed by the server. May be sent on update + and delete requests to ensure that the client has an up-to-date value + before proceeding. + name: Output only. The resource name of the `WorkerPool`, with format + `projects/{project}/locations/{location}/workerPools/{worker_pool}`. The + value of `{worker_pool}` is provided by `worker_pool_id` in + `CreateWorkerPool` request and the value of `{location}` is determined + by the endpoint accessed. + privatePoolV1Config: Legacy Private Pool configuration. + state: Output only. `WorkerPool` state. + uid: Output only. A unique identifier for the `WorkerPool`. + updateTime: Output only. Time at which the request to update the + `WorkerPool` was received. + """ + class StateValueValuesEnum(_messages.Enum): + r"""Output only. `WorkerPool` state. + + Values: + STATE_UNSPECIFIED: State of the `WorkerPool` is unknown. + CREATING: `WorkerPool` is being created. + RUNNING: `WorkerPool` is running. + DELETING: `WorkerPool` is being deleted: cancelling builds and draining + workers. + DELETED: `WorkerPool` is deleted. + UPDATING: `WorkerPool` is being updated; new builds cannot be run. + """ + STATE_UNSPECIFIED = 0 + CREATING = 1 + RUNNING = 2 + DELETING = 3 + DELETED = 4 + UPDATING = 5 + + @encoding.MapUnrecognizedFields('additionalProperties') + class AnnotationsValue(_messages.Message): + r"""User specified annotations. See https://google.aip.dev/128#annotations + for more details such as format and size limitations. + + Messages: + AdditionalProperty: An additional property for a AnnotationsValue + object. + + Fields: + additionalProperties: Additional properties of type AnnotationsValue + """ + class AdditionalProperty(_messages.Message): + r"""An additional property for a AnnotationsValue object. + + Fields: + key: Name of the additional property. + value: A string attribute. + """ + + key = _messages.StringField(1) + value = _messages.StringField(2) + + additionalProperties = _messages.MessageField( + 'AdditionalProperty', 1, repeated=True) + + annotations = _messages.MessageField('AnnotationsValue', 1) + createTime = _messages.StringField(2) + deleteTime = _messages.StringField(3) + displayName = _messages.StringField(4) + etag = _messages.StringField(5) + name = _messages.StringField(6) + privatePoolV1Config = _messages.MessageField('PrivatePoolV1Config', 7) + state = _messages.EnumField('StateValueValuesEnum', 8) + uid = _messages.StringField(9) + updateTime = _messages.StringField(10) + + encoding.AddCustomJsonFieldMapping( StandardQueryParameters, 'f__xgafv', '$.xgafv') encoding.AddCustomJsonEnumMapping( diff --git a/sdks/python/apache_beam/runners/portability/sdk_container_builder.py b/sdks/python/apache_beam/runners/portability/sdk_container_builder.py index 7b4e81f21fae0..d06b005a4f0d1 100644 --- a/sdks/python/apache_beam/runners/portability/sdk_container_builder.py +++ b/sdks/python/apache_beam/runners/portability/sdk_container_builder.py @@ -45,6 +45,7 @@ from apache_beam.options.pipeline_options import GoogleCloudOptions from apache_beam.options.pipeline_options import PipelineOptions # pylint: disable=unused-import from apache_beam.options.pipeline_options import SetupOptions +from apache_beam.options.pipeline_options import WorkerOptions from apache_beam.portability import common_urns from apache_beam.portability.api import beam_runner_api_pb2 from apache_beam.runners.dataflow.internal.clients import cloudbuild @@ -74,7 +75,7 @@ def __init__(self, options): beam_version.__version__ if 'dev' not in beam_version.__version__ else 'latest') self._base_image = ( - self._options.view_as(SetupOptions).prebuild_sdk_container_base_image or + self._options.view_as(WorkerOptions).sdk_container_image or 'apache/beam_python%s.%s_sdk:%s' % (sys.version_info[0], sys.version_info[1], version)) self._temp_src_dir = None @@ -203,6 +204,8 @@ class _SdkContainerImageCloudBuilder(SdkContainerImageBuilder): def __init__(self, options): super().__init__(options) self._google_cloud_options = options.view_as(GoogleCloudOptions) + self._cloud_build_machine_type = self._get_cloud_build_machine_type_enum( + options.view_as(SetupOptions).cloud_build_machine_type) if self._google_cloud_options.no_auth: credentials = None else: @@ -243,6 +246,9 @@ def _invoke_docker_build_and_push(self, container_image_name): self._upload_to_gcs(tarball_path, gcs_location) build = cloudbuild.Build() + if self._cloud_build_machine_type: + build.options = cloudbuild.BuildOptions() + build.options.machineType = self._cloud_build_machine_type build.steps = [] step = cloudbuild.BuildStep() step.name = 'gcr.io/kaniko-project/executor:latest' @@ -276,6 +282,7 @@ def _invoke_docker_build_and_push(self, container_image_name): cloudbuild.CloudbuildProjectsBuildsGetRequest( id=build_id, projectId=project_id)) while response.status in [cloudbuild.Build.StatusValueValuesEnum.QUEUED, + cloudbuild.Build.StatusValueValuesEnum.PENDING, cloudbuild.Build.StatusValueValuesEnum.WORKING]: time.sleep(10) response = self._cloudbuild_client.projects_builds.Get( @@ -338,3 +345,24 @@ def _get_gcs_bucket_and_name(gcs_location): def _make_tarfile(output_filename, source_dir): with tarfile.open(output_filename, "w:gz") as tar: tar.add(source_dir, arcname=SOURCE_FOLDER) + + @staticmethod + def _get_cloud_build_machine_type_enum(machine_type: str): + if not machine_type: + return None + mappings = { + 'n1-highcpu-8': cloudbuild.BuildOptions.MachineTypeValueValuesEnum. + N1_HIGHCPU_8, + 'n1-highcpu-32': cloudbuild.BuildOptions.MachineTypeValueValuesEnum. + N1_HIGHCPU_32, + 'e2-highcpu-8': cloudbuild.BuildOptions.MachineTypeValueValuesEnum. + E2_HIGHCPU_8, + 'e2-highcpu-32': cloudbuild.BuildOptions.MachineTypeValueValuesEnum. + E2_HIGHCPU_32 + } + if machine_type.lower() in mappings: + return mappings[machine_type.lower()] + else: + raise ValueError( + 'Unknown Cloud Build Machine Type option, please specify one of ' + '[n1-highcpu-8, n1-highcpu-32, e2-highcpu-8, e2-highcpu-32].')