Cloud Build v1 API - Class CloudBuildClientImpl (2.3.0)

public sealed class CloudBuildClientImpl : CloudBuildClient

Reference documentation and code samples for the Cloud Build v1 API class CloudBuildClientImpl.

CloudBuild client wrapper implementation, for convenient use.

Inheritance

object > CloudBuildClient > CloudBuildClientImpl

Namespace

GoogleCloudGoogle.Cloud.CloudBuildV1

Assembly

Google.Cloud.CloudBuild.V1.dll

Remarks

Creates and manages builds on Google Cloud Platform.

The main concept used by this API is a Build, which describes the location of the source to build, how to build the source, and where to store the built artifacts, if any.

A user can list previously-requested builds or get builds by their ID to determine the status of the build.

Constructors

CloudBuildClientImpl(CloudBuildClient, CloudBuildSettings, ILogger)

public CloudBuildClientImpl(CloudBuild.CloudBuildClient grpcClient, CloudBuildSettings settings, ILogger logger)

Constructs a client wrapper for the CloudBuild service, with the specified gRPC client and settings.

Parameters
NameDescription
grpcClientCloudBuildCloudBuildClient

The underlying gRPC client.

settingsCloudBuildSettings

The base CloudBuildSettings used within this client.

loggerILogger

Optional ILogger to use within this client.

Properties

ApproveBuildOperationsClient

public override OperationsClient ApproveBuildOperationsClient { get; }

The long-running operations client for ApproveBuild.

Property Value
TypeDescription
OperationsClient
Overrides

CreateBuildOperationsClient

public override OperationsClient CreateBuildOperationsClient { get; }

The long-running operations client for CreateBuild.

Property Value
TypeDescription
OperationsClient
Overrides

CreateWorkerPoolOperationsClient

public override OperationsClient CreateWorkerPoolOperationsClient { get; }

The long-running operations client for CreateWorkerPool.

Property Value
TypeDescription
OperationsClient
Overrides

DeleteWorkerPoolOperationsClient

public override OperationsClient DeleteWorkerPoolOperationsClient { get; }

The long-running operations client for DeleteWorkerPool.

Property Value
TypeDescription
OperationsClient
Overrides

GrpcClient

public override CloudBuild.CloudBuildClient GrpcClient { get; }

The underlying gRPC CloudBuild client

Property Value
TypeDescription
CloudBuildCloudBuildClient
Overrides

RetryBuildOperationsClient

public override OperationsClient RetryBuildOperationsClient { get; }

The long-running operations client for RetryBuild.

Property Value
TypeDescription
OperationsClient
Overrides

RunBuildTriggerOperationsClient

public override OperationsClient RunBuildTriggerOperationsClient { get; }

The long-running operations client for RunBuildTrigger.

Property Value
TypeDescription
OperationsClient
Overrides

UpdateWorkerPoolOperationsClient

public override OperationsClient UpdateWorkerPoolOperationsClient { get; }

The long-running operations client for UpdateWorkerPool.

Property Value
TypeDescription
OperationsClient
Overrides

Methods

ApproveBuild(ApproveBuildRequest, CallSettings)

public override Operation<Build, BuildOperationMetadata> ApproveBuild(ApproveBuildRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestApproveBuildRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationBuildBuildOperationMetadata

The RPC response.

Overrides

ApproveBuildAsync(ApproveBuildRequest, CallSettings)

public override Task<Operation<Build, BuildOperationMetadata>> ApproveBuildAsync(ApproveBuildRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestApproveBuildRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationBuildBuildOperationMetadata

A Task containing the RPC response.

Overrides

CancelBuild(CancelBuildRequest, CallSettings)

public override Build CancelBuild(CancelBuildRequest request, CallSettings callSettings = null)

Cancels a build in progress.

Parameters
NameDescription
requestCancelBuildRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Build

The RPC response.

Overrides

CancelBuildAsync(CancelBuildRequest, CallSettings)

public override Task<Build> CancelBuildAsync(CancelBuildRequest request, CallSettings callSettings = null)

Cancels a build in progress.

Parameters
NameDescription
requestCancelBuildRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskBuild

A Task containing the RPC response.

Overrides

CreateBuild(CreateBuildRequest, CallSettings)

public override Operation<Build, BuildOperationMetadata> CreateBuild(CreateBuildRequest request, CallSettings callSettings = null)

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).

Parameters
NameDescription
requestCreateBuildRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationBuildBuildOperationMetadata

The RPC response.

Overrides

CreateBuildAsync(CreateBuildRequest, CallSettings)

public override Task<Operation<Build, BuildOperationMetadata>> CreateBuildAsync(CreateBuildRequest request, CallSettings callSettings = null)

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).

Parameters
NameDescription
requestCreateBuildRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationBuildBuildOperationMetadata

A Task containing the RPC response.

Overrides

CreateBuildTrigger(CreateBuildTriggerRequest, CallSettings)

public override BuildTrigger CreateBuildTrigger(CreateBuildTriggerRequest request, CallSettings callSettings = null)

Creates a new BuildTrigger.

This API is experimental.

Parameters
NameDescription
requestCreateBuildTriggerRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BuildTrigger

The RPC response.

Overrides

CreateBuildTriggerAsync(CreateBuildTriggerRequest, CallSettings)

public override Task<BuildTrigger> CreateBuildTriggerAsync(CreateBuildTriggerRequest request, CallSettings callSettings = null)

Creates a new BuildTrigger.

This API is experimental.

Parameters
NameDescription
requestCreateBuildTriggerRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskBuildTrigger

A Task containing the RPC response.

Overrides

CreateWorkerPool(CreateWorkerPoolRequest, CallSettings)

public override Operation<WorkerPool, CreateWorkerPoolOperationMetadata> CreateWorkerPool(CreateWorkerPoolRequest request, CallSettings callSettings = null)

Creates a WorkerPool.

Parameters
NameDescription
requestCreateWorkerPoolRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationWorkerPoolCreateWorkerPoolOperationMetadata

The RPC response.

Overrides

CreateWorkerPoolAsync(CreateWorkerPoolRequest, CallSettings)

public override Task<Operation<WorkerPool, CreateWorkerPoolOperationMetadata>> CreateWorkerPoolAsync(CreateWorkerPoolRequest request, CallSettings callSettings = null)

Creates a WorkerPool.

Parameters
NameDescription
requestCreateWorkerPoolRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationWorkerPoolCreateWorkerPoolOperationMetadata

A Task containing the RPC response.

Overrides

DeleteBuildTrigger(DeleteBuildTriggerRequest, CallSettings)

public override void DeleteBuildTrigger(DeleteBuildTriggerRequest request, CallSettings callSettings = null)

Deletes a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Parameters
NameDescription
requestDeleteBuildTriggerRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Overrides

DeleteBuildTriggerAsync(DeleteBuildTriggerRequest, CallSettings)

public override Task DeleteBuildTriggerAsync(DeleteBuildTriggerRequest request, CallSettings callSettings = null)

Deletes a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Parameters
NameDescription
requestDeleteBuildTriggerRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Overrides

DeleteWorkerPool(DeleteWorkerPoolRequest, CallSettings)

public override Operation<Empty, DeleteWorkerPoolOperationMetadata> DeleteWorkerPool(DeleteWorkerPoolRequest request, CallSettings callSettings = null)

Deletes a WorkerPool.

Parameters
NameDescription
requestDeleteWorkerPoolRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationEmptyDeleteWorkerPoolOperationMetadata

The RPC response.

Overrides

DeleteWorkerPoolAsync(DeleteWorkerPoolRequest, CallSettings)

public override Task<Operation<Empty, DeleteWorkerPoolOperationMetadata>> DeleteWorkerPoolAsync(DeleteWorkerPoolRequest request, CallSettings callSettings = null)

Deletes a WorkerPool.

Parameters
NameDescription
requestDeleteWorkerPoolRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationEmptyDeleteWorkerPoolOperationMetadata

A Task containing the RPC response.

Overrides

GetBuild(GetBuildRequest, CallSettings)

public override Build GetBuild(GetBuildRequest request, CallSettings callSettings = null)

Returns information about a previously requested build.

The Build that is returned includes its status (such as SUCCESS, FAILURE, or WORKING), and timing information.

Parameters
NameDescription
requestGetBuildRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Build

The RPC response.

Overrides

GetBuildAsync(GetBuildRequest, CallSettings)

public override Task<Build> GetBuildAsync(GetBuildRequest request, CallSettings callSettings = null)

Returns information about a previously requested build.

The Build that is returned includes its status (such as SUCCESS, FAILURE, or WORKING), and timing information.

Parameters
NameDescription
requestGetBuildRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskBuild

A Task containing the RPC response.

Overrides

GetBuildTrigger(GetBuildTriggerRequest, CallSettings)

public override BuildTrigger GetBuildTrigger(GetBuildTriggerRequest request, CallSettings callSettings = null)

Returns information about a BuildTrigger.

This API is experimental.

Parameters
NameDescription
requestGetBuildTriggerRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BuildTrigger

The RPC response.

Overrides

GetBuildTriggerAsync(GetBuildTriggerRequest, CallSettings)

public override Task<BuildTrigger> GetBuildTriggerAsync(GetBuildTriggerRequest request, CallSettings callSettings = null)

Returns information about a BuildTrigger.

This API is experimental.

Parameters
NameDescription
requestGetBuildTriggerRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskBuildTrigger

A Task containing the RPC response.

Overrides

GetWorkerPool(GetWorkerPoolRequest, CallSettings)

public override WorkerPool GetWorkerPool(GetWorkerPoolRequest request, CallSettings callSettings = null)

Returns details of a WorkerPool.

Parameters
NameDescription
requestGetWorkerPoolRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
WorkerPool

The RPC response.

Overrides

GetWorkerPoolAsync(GetWorkerPoolRequest, CallSettings)

public override Task<WorkerPool> GetWorkerPoolAsync(GetWorkerPoolRequest request, CallSettings callSettings = null)

Returns details of a WorkerPool.

Parameters
NameDescription
requestGetWorkerPoolRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskWorkerPool

A Task containing the RPC response.

Overrides

ListBuilds(ListBuildsRequest, CallSettings)

public override PagedEnumerable<ListBuildsResponse, Build> ListBuilds(ListBuildsRequest request, CallSettings callSettings = null)

Lists previously requested builds.

Previously requested builds may still be in-progress, or may have finished successfully or unsuccessfully.

Parameters
NameDescription
requestListBuildsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListBuildsResponseBuild

A pageable sequence of Build resources.

Overrides

ListBuildsAsync(ListBuildsRequest, CallSettings)

public override PagedAsyncEnumerable<ListBuildsResponse, Build> ListBuildsAsync(ListBuildsRequest request, CallSettings callSettings = null)

Lists previously requested builds.

Previously requested builds may still be in-progress, or may have finished successfully or unsuccessfully.

Parameters
NameDescription
requestListBuildsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListBuildsResponseBuild

A pageable asynchronous sequence of Build resources.

Overrides

ListBuildTriggers(ListBuildTriggersRequest, CallSettings)

public override PagedEnumerable<ListBuildTriggersResponse, BuildTrigger> ListBuildTriggers(ListBuildTriggersRequest request, CallSettings callSettings = null)

Lists existing BuildTriggers.

This API is experimental.

Parameters
NameDescription
requestListBuildTriggersRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListBuildTriggersResponseBuildTrigger

A pageable sequence of BuildTrigger resources.

Overrides

ListBuildTriggersAsync(ListBuildTriggersRequest, CallSettings)

public override PagedAsyncEnumerable<ListBuildTriggersResponse, BuildTrigger> ListBuildTriggersAsync(ListBuildTriggersRequest request, CallSettings callSettings = null)

Lists existing BuildTriggers.

This API is experimental.

Parameters
NameDescription
requestListBuildTriggersRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListBuildTriggersResponseBuildTrigger

A pageable asynchronous sequence of BuildTrigger resources.

Overrides

ListWorkerPools(ListWorkerPoolsRequest, CallSettings)

public override PagedEnumerable<ListWorkerPoolsResponse, WorkerPool> ListWorkerPools(ListWorkerPoolsRequest request, CallSettings callSettings = null)

Lists WorkerPools.

Parameters
NameDescription
requestListWorkerPoolsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListWorkerPoolsResponseWorkerPool

A pageable sequence of WorkerPool resources.

Overrides

ListWorkerPoolsAsync(ListWorkerPoolsRequest, CallSettings)

public override PagedAsyncEnumerable<ListWorkerPoolsResponse, WorkerPool> ListWorkerPoolsAsync(ListWorkerPoolsRequest request, CallSettings callSettings = null)

Lists WorkerPools.

Parameters
NameDescription
requestListWorkerPoolsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListWorkerPoolsResponseWorkerPool

A pageable asynchronous sequence of WorkerPool resources.

Overrides

ReceiveTriggerWebhook(ReceiveTriggerWebhookRequest, CallSettings)

public override ReceiveTriggerWebhookResponse ReceiveTriggerWebhook(ReceiveTriggerWebhookRequest request, CallSettings callSettings = null)

ReceiveTriggerWebhook [Experimental] is called when the API receives a webhook request targeted at a specific trigger.

Parameters
NameDescription
requestReceiveTriggerWebhookRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ReceiveTriggerWebhookResponse

The RPC response.

Overrides

ReceiveTriggerWebhookAsync(ReceiveTriggerWebhookRequest, CallSettings)

public override Task<ReceiveTriggerWebhookResponse> ReceiveTriggerWebhookAsync(ReceiveTriggerWebhookRequest request, CallSettings callSettings = null)

ReceiveTriggerWebhook [Experimental] is called when the API receives a webhook request targeted at a specific trigger.

Parameters
NameDescription
requestReceiveTriggerWebhookRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskReceiveTriggerWebhookResponse

A Task containing the RPC response.

Overrides

RetryBuild(RetryBuildRequest, CallSettings)

public override Operation<Build, BuildOperationMetadata> RetryBuild(RetryBuildRequest request, CallSettings callSettings = null)

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.
Parameters
NameDescription
requestRetryBuildRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationBuildBuildOperationMetadata

The RPC response.

Overrides

RetryBuildAsync(RetryBuildRequest, CallSettings)

public override Task<Operation<Build, BuildOperationMetadata>> RetryBuildAsync(RetryBuildRequest request, CallSettings callSettings = null)

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.
Parameters
NameDescription
requestRetryBuildRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationBuildBuildOperationMetadata

A Task containing the RPC response.

Overrides

RunBuildTrigger(RunBuildTriggerRequest, CallSettings)

public override Operation<Build, BuildOperationMetadata> RunBuildTrigger(RunBuildTriggerRequest request, CallSettings callSettings = null)

Runs a BuildTrigger at a particular source revision.

Parameters
NameDescription
requestRunBuildTriggerRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationBuildBuildOperationMetadata

The RPC response.

Overrides

RunBuildTriggerAsync(RunBuildTriggerRequest, CallSettings)

public override Task<Operation<Build, BuildOperationMetadata>> RunBuildTriggerAsync(RunBuildTriggerRequest request, CallSettings callSettings = null)

Runs a BuildTrigger at a particular source revision.

Parameters
NameDescription
requestRunBuildTriggerRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationBuildBuildOperationMetadata

A Task containing the RPC response.

Overrides

UpdateBuildTrigger(UpdateBuildTriggerRequest, CallSettings)

public override BuildTrigger UpdateBuildTrigger(UpdateBuildTriggerRequest request, CallSettings callSettings = null)

Updates a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Parameters
NameDescription
requestUpdateBuildTriggerRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BuildTrigger

The RPC response.

Overrides

UpdateBuildTriggerAsync(UpdateBuildTriggerRequest, CallSettings)

public override Task<BuildTrigger> UpdateBuildTriggerAsync(UpdateBuildTriggerRequest request, CallSettings callSettings = null)

Updates a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Parameters
NameDescription
requestUpdateBuildTriggerRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskBuildTrigger

A Task containing the RPC response.

Overrides

UpdateWorkerPool(UpdateWorkerPoolRequest, CallSettings)

public override Operation<WorkerPool, UpdateWorkerPoolOperationMetadata> UpdateWorkerPool(UpdateWorkerPoolRequest request, CallSettings callSettings = null)

Updates a WorkerPool.

Parameters
NameDescription
requestUpdateWorkerPoolRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationWorkerPoolUpdateWorkerPoolOperationMetadata

The RPC response.

Overrides

UpdateWorkerPoolAsync(UpdateWorkerPoolRequest, CallSettings)

public override Task<Operation<WorkerPool, UpdateWorkerPoolOperationMetadata>> UpdateWorkerPoolAsync(UpdateWorkerPoolRequest request, CallSettings callSettings = null)

Updates a WorkerPool.

Parameters
NameDescription
requestUpdateWorkerPoolRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationWorkerPoolUpdateWorkerPoolOperationMetadata

A Task containing the RPC response.

Overrides