Class CloudBuildClient (1.2.0)

public abstract class CloudBuildClient

CloudBuild client wrapper, for convenient use.

Inheritance

Object > CloudBuildClient

Derived Types

Namespace

Google.Cloud.CloudBuild.V1

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.

Properties

CreateBuildOperationsClient

public virtual OperationsClient CreateBuildOperationsClient { get; }

The long-running operations client for CreateBuild.

Property Value
TypeDescription
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the CloudBuild service, which is a host of "cloudbuild.googleapis.com" and a port of 443.

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default CloudBuild scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default CloudBuild scopes are:

GrpcClient

public virtual CloudBuild.CloudBuildClient GrpcClient { get; }

The underlying gRPC CloudBuild client

Property Value
TypeDescription
CloudBuild.CloudBuildClient

RetryBuildOperationsClient

public virtual OperationsClient RetryBuildOperationsClient { get; }

The long-running operations client for RetryBuild.

Property Value
TypeDescription
OperationsClient

RunBuildTriggerOperationsClient

public virtual OperationsClient RunBuildTriggerOperationsClient { get; }

The long-running operations client for RunBuildTrigger.

Property Value
TypeDescription
OperationsClient

Methods

CancelBuild(CancelBuildRequest, CallSettings)

public virtual 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.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
CancelBuildRequest request = new CancelBuildRequest
{
    ProjectId = "",
    Id = "",
    BuildName = BuildName.FromProjectBuild("[PROJECT]", "[BUILD]"),
};
// Make the request
Build response = cloudBuildClient.CancelBuild(request);

CancelBuild(String, String, CallSettings)

public virtual Build CancelBuild(string projectId, string id, CallSettings callSettings = null)

Cancels a build in progress.

Parameters
NameDescription
projectIdString

Required. ID of the project.

idString

Required. ID of the build.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Build

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string projectId = "";
string id = "";
// Make the request
Build response = cloudBuildClient.CancelBuild(projectId, id);

CancelBuildAsync(CancelBuildRequest, CallSettings)

public virtual 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
Task<Build>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
CancelBuildRequest request = new CancelBuildRequest
{
    ProjectId = "",
    Id = "",
    BuildName = BuildName.FromProjectBuild("[PROJECT]", "[BUILD]"),
};
// Make the request
Build response = await cloudBuildClient.CancelBuildAsync(request);

CancelBuildAsync(CancelBuildRequest, CancellationToken)

public virtual Task<Build> CancelBuildAsync(CancelBuildRequest request, CancellationToken cancellationToken)

Cancels a build in progress.

Parameters
NameDescription
requestCancelBuildRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Build>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
CancelBuildRequest request = new CancelBuildRequest
{
    ProjectId = "",
    Id = "",
    BuildName = BuildName.FromProjectBuild("[PROJECT]", "[BUILD]"),
};
// Make the request
Build response = await cloudBuildClient.CancelBuildAsync(request);

CancelBuildAsync(String, String, CallSettings)

public virtual Task<Build> CancelBuildAsync(string projectId, string id, CallSettings callSettings = null)

Cancels a build in progress.

Parameters
NameDescription
projectIdString

Required. ID of the project.

idString

Required. ID of the build.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Build>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string id = "";
// Make the request
Build response = await cloudBuildClient.CancelBuildAsync(projectId, id);

CancelBuildAsync(String, String, CancellationToken)

public virtual Task<Build> CancelBuildAsync(string projectId, string id, CancellationToken cancellationToken)

Cancels a build in progress.

Parameters
NameDescription
projectIdString

Required. ID of the project.

idString

Required. ID of the build.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Build>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string id = "";
// Make the request
Build response = await cloudBuildClient.CancelBuildAsync(projectId, id);

Create()

public static CloudBuildClient Create()

Synchronously creates a CloudBuildClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CloudBuildClientBuilder.

Returns
TypeDescription
CloudBuildClient

The created CloudBuildClient.

CreateAsync(CancellationToken)

public static Task<CloudBuildClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a CloudBuildClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CloudBuildClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<CloudBuildClient>

The task representing the created CloudBuildClient.

CreateBuild(CreateBuildRequest, CallSettings)

public virtual 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
Operation<Build, BuildOperationMetadata>

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
CreateBuildRequest request = new CreateBuildRequest
{
    ProjectId = "",
    Build = new Build(),
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
Operation<Build, BuildOperationMetadata> response = cloudBuildClient.CreateBuild(request);

// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Build result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceCreateBuild(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Build retrievedResult = retrievedResponse.Result;
}

CreateBuild(String, Build, CallSettings)

public virtual Operation<Build, BuildOperationMetadata> CreateBuild(string projectId, Build build, 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
projectIdString

Required. ID of the project.

buildBuild

Required. Build resource to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Build, BuildOperationMetadata>

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string projectId = "";
Build build = new Build();
// Make the request
Operation<Build, BuildOperationMetadata> response = cloudBuildClient.CreateBuild(projectId, build);

// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Build result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceCreateBuild(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Build retrievedResult = retrievedResponse.Result;
}

CreateBuildAsync(CreateBuildRequest, CallSettings)

public virtual 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
Task<Operation<Build, BuildOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
CreateBuildRequest request = new CreateBuildRequest
{
    ProjectId = "",
    Build = new Build(),
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.CreateBuildAsync(request);

// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateBuildAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Build retrievedResult = retrievedResponse.Result;
}

CreateBuildAsync(CreateBuildRequest, CancellationToken)

public virtual Task<Operation<Build, BuildOperationMetadata>> CreateBuildAsync(CreateBuildRequest request, CancellationToken cancellationToken)

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Build, BuildOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
CreateBuildRequest request = new CreateBuildRequest
{
    ProjectId = "",
    Build = new Build(),
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.CreateBuildAsync(request);

// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateBuildAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Build retrievedResult = retrievedResponse.Result;
}

CreateBuildAsync(String, Build, CallSettings)

public virtual Task<Operation<Build, BuildOperationMetadata>> CreateBuildAsync(string projectId, Build build, 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
projectIdString

Required. ID of the project.

buildBuild

Required. Build resource to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Build, BuildOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
Build build = new Build();
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.CreateBuildAsync(projectId, build);

// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateBuildAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Build retrievedResult = retrievedResponse.Result;
}

CreateBuildAsync(String, Build, CancellationToken)

public virtual Task<Operation<Build, BuildOperationMetadata>> CreateBuildAsync(string projectId, Build build, CancellationToken cancellationToken)

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
projectIdString

Required. ID of the project.

buildBuild

Required. Build resource to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Build, BuildOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
Build build = new Build();
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.CreateBuildAsync(projectId, build);

// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateBuildAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Build retrievedResult = retrievedResponse.Result;
}

CreateBuildTrigger(CreateBuildTriggerRequest, CallSettings)

public virtual 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.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
CreateBuildTriggerRequest request = new CreateBuildTriggerRequest
{
    ProjectId = "",
    Trigger = new BuildTrigger(),
};
// Make the request
BuildTrigger response = cloudBuildClient.CreateBuildTrigger(request);

CreateBuildTrigger(String, BuildTrigger, CallSettings)

public virtual BuildTrigger CreateBuildTrigger(string projectId, BuildTrigger trigger, CallSettings callSettings = null)

Creates a new BuildTrigger.

This API is experimental.

Parameters
NameDescription
projectIdString

Required. ID of the project for which to configure automatic builds.

triggerBuildTrigger

Required. BuildTrigger to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BuildTrigger

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string projectId = "";
BuildTrigger trigger = new BuildTrigger();
// Make the request
BuildTrigger response = cloudBuildClient.CreateBuildTrigger(projectId, trigger);

CreateBuildTriggerAsync(CreateBuildTriggerRequest, CallSettings)

public virtual 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
Task<BuildTrigger>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
CreateBuildTriggerRequest request = new CreateBuildTriggerRequest
{
    ProjectId = "",
    Trigger = new BuildTrigger(),
};
// Make the request
BuildTrigger response = await cloudBuildClient.CreateBuildTriggerAsync(request);

CreateBuildTriggerAsync(CreateBuildTriggerRequest, CancellationToken)

public virtual Task<BuildTrigger> CreateBuildTriggerAsync(CreateBuildTriggerRequest request, CancellationToken cancellationToken)

Creates a new BuildTrigger.

This API is experimental.

Parameters
NameDescription
requestCreateBuildTriggerRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<BuildTrigger>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
CreateBuildTriggerRequest request = new CreateBuildTriggerRequest
{
    ProjectId = "",
    Trigger = new BuildTrigger(),
};
// Make the request
BuildTrigger response = await cloudBuildClient.CreateBuildTriggerAsync(request);

CreateBuildTriggerAsync(String, BuildTrigger, CallSettings)

public virtual Task<BuildTrigger> CreateBuildTriggerAsync(string projectId, BuildTrigger trigger, CallSettings callSettings = null)

Creates a new BuildTrigger.

This API is experimental.

Parameters
NameDescription
projectIdString

Required. ID of the project for which to configure automatic builds.

triggerBuildTrigger

Required. BuildTrigger to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<BuildTrigger>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
BuildTrigger trigger = new BuildTrigger();
// Make the request
BuildTrigger response = await cloudBuildClient.CreateBuildTriggerAsync(projectId, trigger);

CreateBuildTriggerAsync(String, BuildTrigger, CancellationToken)

public virtual Task<BuildTrigger> CreateBuildTriggerAsync(string projectId, BuildTrigger trigger, CancellationToken cancellationToken)

Creates a new BuildTrigger.

This API is experimental.

Parameters
NameDescription
projectIdString

Required. ID of the project for which to configure automatic builds.

triggerBuildTrigger

Required. BuildTrigger to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<BuildTrigger>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
BuildTrigger trigger = new BuildTrigger();
// Make the request
BuildTrigger response = await cloudBuildClient.CreateBuildTriggerAsync(projectId, trigger);

CreateWorkerPool(CreateWorkerPoolRequest, CallSettings)

public virtual WorkerPool CreateWorkerPool(CreateWorkerPoolRequest request, CallSettings callSettings = null)

Creates a WorkerPool to run the builds, and returns the new worker pool.

This API is experimental.

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
WorkerPool

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
CreateWorkerPoolRequest request = new CreateWorkerPoolRequest
{
    Parent = "",
    WorkerPool = new WorkerPool(),
};
// Make the request
WorkerPool response = cloudBuildClient.CreateWorkerPool(request);

CreateWorkerPoolAsync(CreateWorkerPoolRequest, CallSettings)

public virtual Task<WorkerPool> CreateWorkerPoolAsync(CreateWorkerPoolRequest request, CallSettings callSettings = null)

Creates a WorkerPool to run the builds, and returns the new worker pool.

This API is experimental.

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
Task<WorkerPool>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
CreateWorkerPoolRequest request = new CreateWorkerPoolRequest
{
    Parent = "",
    WorkerPool = new WorkerPool(),
};
// Make the request
WorkerPool response = await cloudBuildClient.CreateWorkerPoolAsync(request);

CreateWorkerPoolAsync(CreateWorkerPoolRequest, CancellationToken)

public virtual Task<WorkerPool> CreateWorkerPoolAsync(CreateWorkerPoolRequest request, CancellationToken cancellationToken)

Creates a WorkerPool to run the builds, and returns the new worker pool.

This API is experimental.

Parameters
NameDescription
requestCreateWorkerPoolRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<WorkerPool>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
CreateWorkerPoolRequest request = new CreateWorkerPoolRequest
{
    Parent = "",
    WorkerPool = new WorkerPool(),
};
// Make the request
WorkerPool response = await cloudBuildClient.CreateWorkerPoolAsync(request);

DeleteBuildTrigger(DeleteBuildTriggerRequest, CallSettings)

public virtual 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.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
DeleteBuildTriggerRequest request = new DeleteBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
};
// Make the request
cloudBuildClient.DeleteBuildTrigger(request);

DeleteBuildTrigger(String, String, CallSettings)

public virtual void DeleteBuildTrigger(string projectId, string triggerId, CallSettings callSettings = null)

Deletes a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Parameters
NameDescription
projectIdString

Required. ID of the project that owns the trigger.

triggerIdString

Required. ID of the BuildTrigger to delete.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string projectId = "";
string triggerId = "";
// Make the request
cloudBuildClient.DeleteBuildTrigger(projectId, triggerId);

DeleteBuildTriggerAsync(DeleteBuildTriggerRequest, CallSettings)

public virtual 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.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
DeleteBuildTriggerRequest request = new DeleteBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
};
// Make the request
await cloudBuildClient.DeleteBuildTriggerAsync(request);

DeleteBuildTriggerAsync(DeleteBuildTriggerRequest, CancellationToken)

public virtual Task DeleteBuildTriggerAsync(DeleteBuildTriggerRequest request, CancellationToken cancellationToken)

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
DeleteBuildTriggerRequest request = new DeleteBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
};
// Make the request
await cloudBuildClient.DeleteBuildTriggerAsync(request);

DeleteBuildTriggerAsync(String, String, CallSettings)

public virtual Task DeleteBuildTriggerAsync(string projectId, string triggerId, CallSettings callSettings = null)

Deletes a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Parameters
NameDescription
projectIdString

Required. ID of the project that owns the trigger.

triggerIdString

Required. ID of the BuildTrigger to delete.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string triggerId = "";
// Make the request
await cloudBuildClient.DeleteBuildTriggerAsync(projectId, triggerId);

DeleteBuildTriggerAsync(String, String, CancellationToken)

public virtual Task DeleteBuildTriggerAsync(string projectId, string triggerId, CancellationToken cancellationToken)

Deletes a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Parameters
NameDescription
projectIdString

Required. ID of the project that owns the trigger.

triggerIdString

Required. ID of the BuildTrigger to delete.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string triggerId = "";
// Make the request
await cloudBuildClient.DeleteBuildTriggerAsync(projectId, triggerId);

DeleteWorkerPool(DeleteWorkerPoolRequest, CallSettings)

public virtual void DeleteWorkerPool(DeleteWorkerPoolRequest request, CallSettings callSettings = null)

Deletes a WorkerPool by its project ID and WorkerPool name.

This API is experimental.

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.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
DeleteWorkerPoolRequest request = new DeleteWorkerPoolRequest { Name = "", };
// Make the request
cloudBuildClient.DeleteWorkerPool(request);

DeleteWorkerPoolAsync(DeleteWorkerPoolRequest, CallSettings)

public virtual Task DeleteWorkerPoolAsync(DeleteWorkerPoolRequest request, CallSettings callSettings = null)

Deletes a WorkerPool by its project ID and WorkerPool name.

This API is experimental.

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
Task

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
DeleteWorkerPoolRequest request = new DeleteWorkerPoolRequest { Name = "", };
// Make the request
await cloudBuildClient.DeleteWorkerPoolAsync(request);

DeleteWorkerPoolAsync(DeleteWorkerPoolRequest, CancellationToken)

public virtual Task DeleteWorkerPoolAsync(DeleteWorkerPoolRequest request, CancellationToken cancellationToken)

Deletes a WorkerPool by its project ID and WorkerPool name.

This API is experimental.

Parameters
NameDescription
requestDeleteWorkerPoolRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
DeleteWorkerPoolRequest request = new DeleteWorkerPoolRequest { Name = "", };
// Make the request
await cloudBuildClient.DeleteWorkerPoolAsync(request);

GetBuild(GetBuildRequest, CallSettings)

public virtual 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.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
GetBuildRequest request = new GetBuildRequest
{
    ProjectId = "",
    Id = "",
    BuildName = BuildName.FromProjectBuild("[PROJECT]", "[BUILD]"),
};
// Make the request
Build response = cloudBuildClient.GetBuild(request);

GetBuild(String, String, CallSettings)

public virtual Build GetBuild(string projectId, string id, 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
projectIdString

Required. ID of the project.

idString

Required. ID of the build.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Build

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string projectId = "";
string id = "";
// Make the request
Build response = cloudBuildClient.GetBuild(projectId, id);

GetBuildAsync(GetBuildRequest, CallSettings)

public virtual 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
Task<Build>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
GetBuildRequest request = new GetBuildRequest
{
    ProjectId = "",
    Id = "",
    BuildName = BuildName.FromProjectBuild("[PROJECT]", "[BUILD]"),
};
// Make the request
Build response = await cloudBuildClient.GetBuildAsync(request);

GetBuildAsync(GetBuildRequest, CancellationToken)

public virtual Task<Build> GetBuildAsync(GetBuildRequest request, CancellationToken cancellationToken)

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Build>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
GetBuildRequest request = new GetBuildRequest
{
    ProjectId = "",
    Id = "",
    BuildName = BuildName.FromProjectBuild("[PROJECT]", "[BUILD]"),
};
// Make the request
Build response = await cloudBuildClient.GetBuildAsync(request);

GetBuildAsync(String, String, CallSettings)

public virtual Task<Build> GetBuildAsync(string projectId, string id, 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
projectIdString

Required. ID of the project.

idString

Required. ID of the build.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Build>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string id = "";
// Make the request
Build response = await cloudBuildClient.GetBuildAsync(projectId, id);

GetBuildAsync(String, String, CancellationToken)

public virtual Task<Build> GetBuildAsync(string projectId, string id, CancellationToken cancellationToken)

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
projectIdString

Required. ID of the project.

idString

Required. ID of the build.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Build>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string id = "";
// Make the request
Build response = await cloudBuildClient.GetBuildAsync(projectId, id);

GetBuildTrigger(GetBuildTriggerRequest, CallSettings)

public virtual 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.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
GetBuildTriggerRequest request = new GetBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
};
// Make the request
BuildTrigger response = cloudBuildClient.GetBuildTrigger(request);

GetBuildTrigger(String, String, CallSettings)

public virtual BuildTrigger GetBuildTrigger(string projectId, string triggerId, CallSettings callSettings = null)

Returns information about a BuildTrigger.

This API is experimental.

Parameters
NameDescription
projectIdString

Required. ID of the project that owns the trigger.

triggerIdString

Required. Identifier (id or name) of the BuildTrigger to get.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BuildTrigger

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string projectId = "";
string triggerId = "";
// Make the request
BuildTrigger response = cloudBuildClient.GetBuildTrigger(projectId, triggerId);

GetBuildTriggerAsync(GetBuildTriggerRequest, CallSettings)

public virtual 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
Task<BuildTrigger>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
GetBuildTriggerRequest request = new GetBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
};
// Make the request
BuildTrigger response = await cloudBuildClient.GetBuildTriggerAsync(request);

GetBuildTriggerAsync(GetBuildTriggerRequest, CancellationToken)

public virtual Task<BuildTrigger> GetBuildTriggerAsync(GetBuildTriggerRequest request, CancellationToken cancellationToken)

Returns information about a BuildTrigger.

This API is experimental.

Parameters
NameDescription
requestGetBuildTriggerRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<BuildTrigger>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
GetBuildTriggerRequest request = new GetBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
};
// Make the request
BuildTrigger response = await cloudBuildClient.GetBuildTriggerAsync(request);

GetBuildTriggerAsync(String, String, CallSettings)

public virtual Task<BuildTrigger> GetBuildTriggerAsync(string projectId, string triggerId, CallSettings callSettings = null)

Returns information about a BuildTrigger.

This API is experimental.

Parameters
NameDescription
projectIdString

Required. ID of the project that owns the trigger.

triggerIdString

Required. Identifier (id or name) of the BuildTrigger to get.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<BuildTrigger>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string triggerId = "";
// Make the request
BuildTrigger response = await cloudBuildClient.GetBuildTriggerAsync(projectId, triggerId);

GetBuildTriggerAsync(String, String, CancellationToken)

public virtual Task<BuildTrigger> GetBuildTriggerAsync(string projectId, string triggerId, CancellationToken cancellationToken)

Returns information about a BuildTrigger.

This API is experimental.

Parameters
NameDescription
projectIdString

Required. ID of the project that owns the trigger.

triggerIdString

Required. Identifier (id or name) of the BuildTrigger to get.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<BuildTrigger>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string triggerId = "";
// Make the request
BuildTrigger response = await cloudBuildClient.GetBuildTriggerAsync(projectId, triggerId);

GetWorkerPool(GetWorkerPoolRequest, CallSettings)

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

Returns information about a WorkerPool.

This API is experimental.

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.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
GetWorkerPoolRequest request = new GetWorkerPoolRequest { Name = "", };
// Make the request
WorkerPool response = cloudBuildClient.GetWorkerPool(request);

GetWorkerPoolAsync(GetWorkerPoolRequest, CallSettings)

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

Returns information about a WorkerPool.

This API is experimental.

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
Task<WorkerPool>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
GetWorkerPoolRequest request = new GetWorkerPoolRequest { Name = "", };
// Make the request
WorkerPool response = await cloudBuildClient.GetWorkerPoolAsync(request);

GetWorkerPoolAsync(GetWorkerPoolRequest, CancellationToken)

public virtual Task<WorkerPool> GetWorkerPoolAsync(GetWorkerPoolRequest request, CancellationToken cancellationToken)

Returns information about a WorkerPool.

This API is experimental.

Parameters
NameDescription
requestGetWorkerPoolRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<WorkerPool>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
GetWorkerPoolRequest request = new GetWorkerPoolRequest { Name = "", };
// Make the request
WorkerPool response = await cloudBuildClient.GetWorkerPoolAsync(request);

ListBuilds(ListBuildsRequest, CallSettings)

public virtual 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
PagedEnumerable<ListBuildsResponse, Build>

A pageable sequence of Build resources.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
ListBuildsRequest request = new ListBuildsRequest
{
    ProjectId = "",
    Filter = "",
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
PagedEnumerable<ListBuildsResponse, Build> response = cloudBuildClient.ListBuilds(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Build item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListBuildsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Build item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Build> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Build item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListBuilds(String, String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListBuildsResponse, Build> ListBuilds(string projectId, string filter, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists previously requested builds.

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

Parameters
NameDescription
projectIdString

Required. ID of the project.

filterString

The raw filter text to constrain the results.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListBuildsResponse, Build>

A pageable sequence of Build resources.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string projectId = "";
string filter = "";
// Make the request
PagedEnumerable<ListBuildsResponse, Build> response = cloudBuildClient.ListBuilds(projectId, filter);

// Iterate over all response items, lazily performing RPCs as required
foreach (Build item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListBuildsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Build item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Build> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Build item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListBuildsAsync(ListBuildsRequest, CallSettings)

public virtual 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
PagedAsyncEnumerable<ListBuildsResponse, Build>

A pageable asynchronous sequence of Build resources.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
ListBuildsRequest request = new ListBuildsRequest
{
    ProjectId = "",
    Filter = "",
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
PagedAsyncEnumerable<ListBuildsResponse, Build> response = cloudBuildClient.ListBuildsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Build item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListBuildsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Build item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Build> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Build item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListBuildsAsync(String, String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListBuildsResponse, Build> ListBuildsAsync(string projectId, string filter, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists previously requested builds.

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

Parameters
NameDescription
projectIdString

Required. ID of the project.

filterString

The raw filter text to constrain the results.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListBuildsResponse, Build>

A pageable asynchronous sequence of Build resources.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string filter = "";
// Make the request
PagedAsyncEnumerable<ListBuildsResponse, Build> response = cloudBuildClient.ListBuildsAsync(projectId, filter);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Build item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListBuildsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Build item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Build> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Build item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListBuildTriggers(ListBuildTriggersRequest, CallSettings)

public virtual 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
PagedEnumerable<ListBuildTriggersResponse, BuildTrigger>

A pageable sequence of BuildTrigger resources.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
ListBuildTriggersRequest request = new ListBuildTriggersRequest { ProjectId = "", };
// Make the request
PagedEnumerable<ListBuildTriggersResponse, BuildTrigger> response = cloudBuildClient.ListBuildTriggers(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (BuildTrigger item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListBuildTriggersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (BuildTrigger item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<BuildTrigger> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (BuildTrigger item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListBuildTriggers(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListBuildTriggersResponse, BuildTrigger> ListBuildTriggers(string projectId, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists existing BuildTriggers.

This API is experimental.

Parameters
NameDescription
projectIdString

Required. ID of the project for which to list BuildTriggers.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListBuildTriggersResponse, BuildTrigger>

A pageable sequence of BuildTrigger resources.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string projectId = "";
// Make the request
PagedEnumerable<ListBuildTriggersResponse, BuildTrigger> response = cloudBuildClient.ListBuildTriggers(projectId);

// Iterate over all response items, lazily performing RPCs as required
foreach (BuildTrigger item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListBuildTriggersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (BuildTrigger item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<BuildTrigger> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (BuildTrigger item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListBuildTriggersAsync(ListBuildTriggersRequest, CallSettings)

public virtual 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
PagedAsyncEnumerable<ListBuildTriggersResponse, BuildTrigger>

A pageable asynchronous sequence of BuildTrigger resources.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
ListBuildTriggersRequest request = new ListBuildTriggersRequest { ProjectId = "", };
// Make the request
PagedAsyncEnumerable<ListBuildTriggersResponse, BuildTrigger> response = cloudBuildClient.ListBuildTriggersAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((BuildTrigger item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListBuildTriggersResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (BuildTrigger item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<BuildTrigger> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (BuildTrigger item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListBuildTriggersAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListBuildTriggersResponse, BuildTrigger> ListBuildTriggersAsync(string projectId, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists existing BuildTriggers.

This API is experimental.

Parameters
NameDescription
projectIdString

Required. ID of the project for which to list BuildTriggers.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListBuildTriggersResponse, BuildTrigger>

A pageable asynchronous sequence of BuildTrigger resources.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
// Make the request
PagedAsyncEnumerable<ListBuildTriggersResponse, BuildTrigger> response = cloudBuildClient.ListBuildTriggersAsync(projectId);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((BuildTrigger item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListBuildTriggersResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (BuildTrigger item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<BuildTrigger> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (BuildTrigger item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListWorkerPools(ListWorkerPoolsRequest, CallSettings)

public virtual ListWorkerPoolsResponse ListWorkerPools(ListWorkerPoolsRequest request, CallSettings callSettings = null)

List project's WorkerPools.

This API is experimental.

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
ListWorkerPoolsResponse

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
ListWorkerPoolsRequest request = new ListWorkerPoolsRequest { Parent = "", };
// Make the request
ListWorkerPoolsResponse response = cloudBuildClient.ListWorkerPools(request);

ListWorkerPoolsAsync(ListWorkerPoolsRequest, CallSettings)

public virtual Task<ListWorkerPoolsResponse> ListWorkerPoolsAsync(ListWorkerPoolsRequest request, CallSettings callSettings = null)

List project's WorkerPools.

This API is experimental.

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
Task<ListWorkerPoolsResponse>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
ListWorkerPoolsRequest request = new ListWorkerPoolsRequest { Parent = "", };
// Make the request
ListWorkerPoolsResponse response = await cloudBuildClient.ListWorkerPoolsAsync(request);

ListWorkerPoolsAsync(ListWorkerPoolsRequest, CancellationToken)

public virtual Task<ListWorkerPoolsResponse> ListWorkerPoolsAsync(ListWorkerPoolsRequest request, CancellationToken cancellationToken)

List project's WorkerPools.

This API is experimental.

Parameters
NameDescription
requestListWorkerPoolsRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ListWorkerPoolsResponse>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
ListWorkerPoolsRequest request = new ListWorkerPoolsRequest { Parent = "", };
// Make the request
ListWorkerPoolsResponse response = await cloudBuildClient.ListWorkerPoolsAsync(request);

PollOnceCreateBuild(String, CallSettings)

public virtual Operation<Build, BuildOperationMetadata> PollOnceCreateBuild(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of CreateBuild.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Build, BuildOperationMetadata>

The result of polling the operation.

PollOnceCreateBuildAsync(String, CallSettings)

public virtual Task<Operation<Build, BuildOperationMetadata>> PollOnceCreateBuildAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of CreateBuild.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Build, BuildOperationMetadata>>

A task representing the result of polling the operation.

PollOnceRetryBuild(String, CallSettings)

public virtual Operation<Build, BuildOperationMetadata> PollOnceRetryBuild(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of RetryBuild.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Build, BuildOperationMetadata>

The result of polling the operation.

PollOnceRetryBuildAsync(String, CallSettings)

public virtual Task<Operation<Build, BuildOperationMetadata>> PollOnceRetryBuildAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of RetryBuild.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Build, BuildOperationMetadata>>

A task representing the result of polling the operation.

PollOnceRunBuildTrigger(String, CallSettings)

public virtual Operation<Build, BuildOperationMetadata> PollOnceRunBuildTrigger(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of RunBuildTrigger.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Build, BuildOperationMetadata>

The result of polling the operation.

PollOnceRunBuildTriggerAsync(String, CallSettings)

public virtual Task<Operation<Build, BuildOperationMetadata>> PollOnceRunBuildTriggerAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of RunBuildTrigger.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Build, BuildOperationMetadata>>

A task representing the result of polling the operation.

ReceiveTriggerWebhook(ReceiveTriggerWebhookRequest, CallSettings)

public virtual 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.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
ReceiveTriggerWebhookRequest request = new ReceiveTriggerWebhookRequest
{
    Body = new HttpBody(),
    ProjectId = "",
    Trigger = "",
    Secret = "",
};
// Make the request
ReceiveTriggerWebhookResponse response = cloudBuildClient.ReceiveTriggerWebhook(request);

ReceiveTriggerWebhookAsync(ReceiveTriggerWebhookRequest, CallSettings)

public virtual 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
Task<ReceiveTriggerWebhookResponse>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
ReceiveTriggerWebhookRequest request = new ReceiveTriggerWebhookRequest
{
    Body = new HttpBody(),
    ProjectId = "",
    Trigger = "",
    Secret = "",
};
// Make the request
ReceiveTriggerWebhookResponse response = await cloudBuildClient.ReceiveTriggerWebhookAsync(request);

ReceiveTriggerWebhookAsync(ReceiveTriggerWebhookRequest, CancellationToken)

public virtual Task<ReceiveTriggerWebhookResponse> ReceiveTriggerWebhookAsync(ReceiveTriggerWebhookRequest request, CancellationToken cancellationToken)

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ReceiveTriggerWebhookResponse>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
ReceiveTriggerWebhookRequest request = new ReceiveTriggerWebhookRequest
{
    Body = new HttpBody(),
    ProjectId = "",
    Trigger = "",
    Secret = "",
};
// Make the request
ReceiveTriggerWebhookResponse response = await cloudBuildClient.ReceiveTriggerWebhookAsync(request);

RetryBuild(RetryBuildRequest, CallSettings)

public virtual 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
Operation<Build, BuildOperationMetadata>

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
RetryBuildRequest request = new RetryBuildRequest
{
    ProjectId = "",
    Id = "",
    BuildName = BuildName.FromProjectBuild("[PROJECT]", "[BUILD]"),
};
// Make the request
Operation<Build, BuildOperationMetadata> response = cloudBuildClient.RetryBuild(request);

// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Build result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceRetryBuild(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Build retrievedResult = retrievedResponse.Result;
}

RetryBuild(String, String, CallSettings)

public virtual Operation<Build, BuildOperationMetadata> RetryBuild(string projectId, string id, 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
projectIdString

Required. ID of the project.

idString

Required. Build ID of the original build.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Build, BuildOperationMetadata>

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string projectId = "";
string id = "";
// Make the request
Operation<Build, BuildOperationMetadata> response = cloudBuildClient.RetryBuild(projectId, id);

// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Build result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceRetryBuild(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Build retrievedResult = retrievedResponse.Result;
}

RetryBuildAsync(RetryBuildRequest, CallSettings)

public virtual 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
Task<Operation<Build, BuildOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
RetryBuildRequest request = new RetryBuildRequest
{
    ProjectId = "",
    Id = "",
    BuildName = BuildName.FromProjectBuild("[PROJECT]", "[BUILD]"),
};
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.RetryBuildAsync(request);

// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceRetryBuildAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Build retrievedResult = retrievedResponse.Result;
}

RetryBuildAsync(RetryBuildRequest, CancellationToken)

public virtual Task<Operation<Build, BuildOperationMetadata>> RetryBuildAsync(RetryBuildRequest request, CancellationToken cancellationToken)

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Build, BuildOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
RetryBuildRequest request = new RetryBuildRequest
{
    ProjectId = "",
    Id = "",
    BuildName = BuildName.FromProjectBuild("[PROJECT]", "[BUILD]"),
};
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.RetryBuildAsync(request);

// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceRetryBuildAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Build retrievedResult = retrievedResponse.Result;
}

RetryBuildAsync(String, String, CallSettings)

public virtual Task<Operation<Build, BuildOperationMetadata>> RetryBuildAsync(string projectId, string id, 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
projectIdString

Required. ID of the project.

idString

Required. Build ID of the original build.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Build, BuildOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string id = "";
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.RetryBuildAsync(projectId, id);

// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceRetryBuildAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Build retrievedResult = retrievedResponse.Result;
}

RetryBuildAsync(String, String, CancellationToken)

public virtual Task<Operation<Build, BuildOperationMetadata>> RetryBuildAsync(string projectId, string id, CancellationToken cancellationToken)

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
projectIdString

Required. ID of the project.

idString

Required. Build ID of the original build.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Build, BuildOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string id = "";
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.RetryBuildAsync(projectId, id);

// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceRetryBuildAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Build retrievedResult = retrievedResponse.Result;
}

RunBuildTrigger(RunBuildTriggerRequest, CallSettings)

public virtual 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
Operation<Build, BuildOperationMetadata>

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
RunBuildTriggerRequest request = new RunBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
    Source = new RepoSource(),
};
// Make the request
Operation<Build, BuildOperationMetadata> response = cloudBuildClient.RunBuildTrigger(request);

// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Build result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceRunBuildTrigger(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Build retrievedResult = retrievedResponse.Result;
}

RunBuildTrigger(String, String, RepoSource, CallSettings)

public virtual Operation<Build, BuildOperationMetadata> RunBuildTrigger(string projectId, string triggerId, RepoSource source, CallSettings callSettings = null)

Runs a BuildTrigger at a particular source revision.

Parameters
NameDescription
projectIdString

Required. ID of the project.

triggerIdString

Required. ID of the trigger.

sourceRepoSource

Source to build against this trigger.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Build, BuildOperationMetadata>

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string projectId = "";
string triggerId = "";
RepoSource source = new RepoSource();
// Make the request
Operation<Build, BuildOperationMetadata> response = cloudBuildClient.RunBuildTrigger(projectId, triggerId, source);

// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Build result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceRunBuildTrigger(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Build retrievedResult = retrievedResponse.Result;
}

RunBuildTriggerAsync(RunBuildTriggerRequest, CallSettings)

public virtual 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
Task<Operation<Build, BuildOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
RunBuildTriggerRequest request = new RunBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
    Source = new RepoSource(),
};
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.RunBuildTriggerAsync(request);

// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceRunBuildTriggerAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Build retrievedResult = retrievedResponse.Result;
}

RunBuildTriggerAsync(RunBuildTriggerRequest, CancellationToken)

public virtual Task<Operation<Build, BuildOperationMetadata>> RunBuildTriggerAsync(RunBuildTriggerRequest request, CancellationToken cancellationToken)

Runs a BuildTrigger at a particular source revision.

Parameters
NameDescription
requestRunBuildTriggerRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Build, BuildOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
RunBuildTriggerRequest request = new RunBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
    Source = new RepoSource(),
};
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.RunBuildTriggerAsync(request);

// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceRunBuildTriggerAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Build retrievedResult = retrievedResponse.Result;
}

RunBuildTriggerAsync(String, String, RepoSource, CallSettings)

public virtual Task<Operation<Build, BuildOperationMetadata>> RunBuildTriggerAsync(string projectId, string triggerId, RepoSource source, CallSettings callSettings = null)

Runs a BuildTrigger at a particular source revision.

Parameters
NameDescription
projectIdString

Required. ID of the project.

triggerIdString

Required. ID of the trigger.

sourceRepoSource

Source to build against this trigger.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Build, BuildOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string triggerId = "";
RepoSource source = new RepoSource();
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.RunBuildTriggerAsync(projectId, triggerId, source);

// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceRunBuildTriggerAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Build retrievedResult = retrievedResponse.Result;
}

RunBuildTriggerAsync(String, String, RepoSource, CancellationToken)

public virtual Task<Operation<Build, BuildOperationMetadata>> RunBuildTriggerAsync(string projectId, string triggerId, RepoSource source, CancellationToken cancellationToken)

Runs a BuildTrigger at a particular source revision.

Parameters
NameDescription
projectIdString

Required. ID of the project.

triggerIdString

Required. ID of the trigger.

sourceRepoSource

Source to build against this trigger.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Build, BuildOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string triggerId = "";
RepoSource source = new RepoSource();
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.RunBuildTriggerAsync(projectId, triggerId, source);

// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceRunBuildTriggerAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Build retrievedResult = retrievedResponse.Result;
}

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

UpdateBuildTrigger(UpdateBuildTriggerRequest, CallSettings)

public virtual 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.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
UpdateBuildTriggerRequest request = new UpdateBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
    Trigger = new BuildTrigger(),
};
// Make the request
BuildTrigger response = cloudBuildClient.UpdateBuildTrigger(request);

UpdateBuildTrigger(String, String, BuildTrigger, CallSettings)

public virtual BuildTrigger UpdateBuildTrigger(string projectId, string triggerId, BuildTrigger trigger, CallSettings callSettings = null)

Updates a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Parameters
NameDescription
projectIdString

Required. ID of the project that owns the trigger.

triggerIdString

Required. ID of the BuildTrigger to update.

triggerBuildTrigger

Required. BuildTrigger to update.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BuildTrigger

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string projectId = "";
string triggerId = "";
BuildTrigger trigger = new BuildTrigger();
// Make the request
BuildTrigger response = cloudBuildClient.UpdateBuildTrigger(projectId, triggerId, trigger);

UpdateBuildTriggerAsync(UpdateBuildTriggerRequest, CallSettings)

public virtual 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
Task<BuildTrigger>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
UpdateBuildTriggerRequest request = new UpdateBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
    Trigger = new BuildTrigger(),
};
// Make the request
BuildTrigger response = await cloudBuildClient.UpdateBuildTriggerAsync(request);

UpdateBuildTriggerAsync(UpdateBuildTriggerRequest, CancellationToken)

public virtual Task<BuildTrigger> UpdateBuildTriggerAsync(UpdateBuildTriggerRequest request, CancellationToken cancellationToken)

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<BuildTrigger>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
UpdateBuildTriggerRequest request = new UpdateBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
    Trigger = new BuildTrigger(),
};
// Make the request
BuildTrigger response = await cloudBuildClient.UpdateBuildTriggerAsync(request);

UpdateBuildTriggerAsync(String, String, BuildTrigger, CallSettings)

public virtual Task<BuildTrigger> UpdateBuildTriggerAsync(string projectId, string triggerId, BuildTrigger trigger, CallSettings callSettings = null)

Updates a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Parameters
NameDescription
projectIdString

Required. ID of the project that owns the trigger.

triggerIdString

Required. ID of the BuildTrigger to update.

triggerBuildTrigger

Required. BuildTrigger to update.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<BuildTrigger>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string triggerId = "";
BuildTrigger trigger = new BuildTrigger();
// Make the request
BuildTrigger response = await cloudBuildClient.UpdateBuildTriggerAsync(projectId, triggerId, trigger);

UpdateBuildTriggerAsync(String, String, BuildTrigger, CancellationToken)

public virtual Task<BuildTrigger> UpdateBuildTriggerAsync(string projectId, string triggerId, BuildTrigger trigger, CancellationToken cancellationToken)

Updates a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Parameters
NameDescription
projectIdString

Required. ID of the project that owns the trigger.

triggerIdString

Required. ID of the BuildTrigger to update.

triggerBuildTrigger

Required. BuildTrigger to update.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<BuildTrigger>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string triggerId = "";
BuildTrigger trigger = new BuildTrigger();
// Make the request
BuildTrigger response = await cloudBuildClient.UpdateBuildTriggerAsync(projectId, triggerId, trigger);

UpdateWorkerPool(UpdateWorkerPoolRequest, CallSettings)

public virtual WorkerPool UpdateWorkerPool(UpdateWorkerPoolRequest request, CallSettings callSettings = null)

Update a WorkerPool.

This API is experimental.

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
WorkerPool

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
UpdateWorkerPoolRequest request = new UpdateWorkerPoolRequest
{
    Name = "",
    WorkerPool = new WorkerPool(),
};
// Make the request
WorkerPool response = cloudBuildClient.UpdateWorkerPool(request);

UpdateWorkerPoolAsync(UpdateWorkerPoolRequest, CallSettings)

public virtual Task<WorkerPool> UpdateWorkerPoolAsync(UpdateWorkerPoolRequest request, CallSettings callSettings = null)

Update a WorkerPool.

This API is experimental.

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
Task<WorkerPool>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
UpdateWorkerPoolRequest request = new UpdateWorkerPoolRequest
{
    Name = "",
    WorkerPool = new WorkerPool(),
};
// Make the request
WorkerPool response = await cloudBuildClient.UpdateWorkerPoolAsync(request);

UpdateWorkerPoolAsync(UpdateWorkerPoolRequest, CancellationToken)

public virtual Task<WorkerPool> UpdateWorkerPoolAsync(UpdateWorkerPoolRequest request, CancellationToken cancellationToken)

Update a WorkerPool.

This API is experimental.

Parameters
NameDescription
requestUpdateWorkerPoolRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<WorkerPool>

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
UpdateWorkerPoolRequest request = new UpdateWorkerPoolRequest
{
    Name = "",
    WorkerPool = new WorkerPool(),
};
// Make the request
WorkerPool response = await cloudBuildClient.UpdateWorkerPoolAsync(request);