Cloud Build v1 API - Class CloudBuildClient (2.10.0)

public abstract class CloudBuildClient

Reference documentation and code samples for the Cloud Build v1 API 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

ApproveBuildOperationsClient

public virtual OperationsClient ApproveBuildOperationsClient { get; }

The long-running operations client for ApproveBuild.

Property Value
Type Description
OperationsClient

CreateBuildOperationsClient

public virtual OperationsClient CreateBuildOperationsClient { get; }

The long-running operations client for CreateBuild.

Property Value
Type Description
OperationsClient

CreateWorkerPoolOperationsClient

public virtual OperationsClient CreateWorkerPoolOperationsClient { get; }

The long-running operations client for CreateWorkerPool.

Property Value
Type Description
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
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default CloudBuild scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default CloudBuild scopes are:

DeleteWorkerPoolOperationsClient

public virtual OperationsClient DeleteWorkerPoolOperationsClient { get; }

The long-running operations client for DeleteWorkerPool.

Property Value
Type Description
OperationsClient

GrpcClient

public virtual CloudBuild.CloudBuildClient GrpcClient { get; }

The underlying gRPC CloudBuild client

Property Value
Type Description
CloudBuildCloudBuildClient

RetryBuildOperationsClient

public virtual OperationsClient RetryBuildOperationsClient { get; }

The long-running operations client for RetryBuild.

Property Value
Type Description
OperationsClient

RunBuildTriggerOperationsClient

public virtual OperationsClient RunBuildTriggerOperationsClient { get; }

The long-running operations client for RunBuildTrigger.

Property Value
Type Description
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

UpdateWorkerPoolOperationsClient

public virtual OperationsClient UpdateWorkerPoolOperationsClient { get; }

The long-running operations client for UpdateWorkerPool.

Property Value
Type Description
OperationsClient

Methods

ApproveBuild(ApproveBuildRequest, CallSettings)

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

Approves or rejects a pending build.

If approved, the returned LRO will be analogous to the LRO returned from a CreateBuild call.

If rejected, the returned LRO will be immediately done.

Parameters
Name Description
request ApproveBuildRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationBuildBuildOperationMetadata

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
ApproveBuildRequest request = new ApproveBuildRequest
{
    Name = "",
    ApprovalResult = new ApprovalResult(),
};
// Make the request
Operation<Build, BuildOperationMetadata> response = cloudBuildClient.ApproveBuild(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.PollOnceApproveBuild(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;
}

ApproveBuild(string, ApprovalResult, CallSettings)

public virtual Operation<Build, BuildOperationMetadata> ApproveBuild(string name, ApprovalResult approvalResult, CallSettings callSettings = null)

Approves or rejects a pending build.

If approved, the returned LRO will be analogous to the LRO returned from a CreateBuild call.

If rejected, the returned LRO will be immediately done.

Parameters
Name Description
name string

Required. Name of the target build. For example: "projects/{$project_id}/builds/{$build_id}"

approvalResult ApprovalResult

Approval decision and metadata.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationBuildBuildOperationMetadata

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string name = "";
ApprovalResult approvalResult = new ApprovalResult();
// Make the request
Operation<Build, BuildOperationMetadata> response = cloudBuildClient.ApproveBuild(name, approvalResult);

// 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.PollOnceApproveBuild(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;
}

ApproveBuildAsync(ApproveBuildRequest, CallSettings)

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

Approves or rejects a pending build.

If approved, the returned LRO will be analogous to the LRO returned from a CreateBuild call.

If rejected, the returned LRO will be immediately done.

Parameters
Name Description
request ApproveBuildRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
ApproveBuildRequest request = new ApproveBuildRequest
{
    Name = "",
    ApprovalResult = new ApprovalResult(),
};
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.ApproveBuildAsync(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.PollOnceApproveBuildAsync(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;
}

ApproveBuildAsync(ApproveBuildRequest, CancellationToken)

public virtual Task<Operation<Build, BuildOperationMetadata>> ApproveBuildAsync(ApproveBuildRequest request, CancellationToken cancellationToken)

Approves or rejects a pending build.

If approved, the returned LRO will be analogous to the LRO returned from a CreateBuild call.

If rejected, the returned LRO will be immediately done.

Parameters
Name Description
request ApproveBuildRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
ApproveBuildRequest request = new ApproveBuildRequest
{
    Name = "",
    ApprovalResult = new ApprovalResult(),
};
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.ApproveBuildAsync(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.PollOnceApproveBuildAsync(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;
}

ApproveBuildAsync(string, ApprovalResult, CallSettings)

public virtual Task<Operation<Build, BuildOperationMetadata>> ApproveBuildAsync(string name, ApprovalResult approvalResult, CallSettings callSettings = null)

Approves or rejects a pending build.

If approved, the returned LRO will be analogous to the LRO returned from a CreateBuild call.

If rejected, the returned LRO will be immediately done.

Parameters
Name Description
name string

Required. Name of the target build. For example: "projects/{$project_id}/builds/{$build_id}"

approvalResult ApprovalResult

Approval decision and metadata.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

A Task containing the RPC response.

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

// 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.PollOnceApproveBuildAsync(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;
}

ApproveBuildAsync(string, ApprovalResult, CancellationToken)

public virtual Task<Operation<Build, BuildOperationMetadata>> ApproveBuildAsync(string name, ApprovalResult approvalResult, CancellationToken cancellationToken)

Approves or rejects a pending build.

If approved, the returned LRO will be analogous to the LRO returned from a CreateBuild call.

If rejected, the returned LRO will be immediately done.

Parameters
Name Description
name string

Required. Name of the target build. For example: "projects/{$project_id}/builds/{$build_id}"

approvalResult ApprovalResult

Approval decision and metadata.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

A Task containing the RPC response.

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

// 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.PollOnceApproveBuildAsync(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;
}

CancelBuild(CancelBuildRequest, CallSettings)

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

Cancels a build in progress.

Parameters
Name Description
request CancelBuildRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
projectId string

Required. ID of the project.

id string

Required. ID of the build.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
request CancelBuildRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskBuild

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
Name Description
request CancelBuildRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskBuild

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
Name Description
projectId string

Required. ID of the project.

id string

Required. ID of the build.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskBuild

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
Name Description
projectId string

Required. ID of the project.

id string

Required. ID of the build.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskBuild

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
Type Description
CloudBuildClient

The created CloudBuildClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskCloudBuildClient

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
Name Description
request CreateBuildRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationBuildBuildOperationMetadata

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
Name Description
projectId string

Required. ID of the project.

build Build

Required. Build resource to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationBuildBuildOperationMetadata

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
Name Description
request CreateBuildRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

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
Name Description
request CreateBuildRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

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
Name Description
projectId string

Required. ID of the project.

build Build

Required. Build resource to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

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
Name Description
projectId string

Required. ID of the project.

build Build

Required. Build resource to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

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
Name Description
request CreateBuildTriggerRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BuildTrigger

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
CreateBuildTriggerRequest request = new CreateBuildTriggerRequest
{
    ProjectId = "",
    Trigger = new BuildTrigger(),
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// 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
Name Description
projectId string

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

trigger BuildTrigger

Required. BuildTrigger to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
request CreateBuildTriggerRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskBuildTrigger

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(),
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// 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
Name Description
request CreateBuildTriggerRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskBuildTrigger

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(),
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// 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
Name Description
projectId string

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

trigger BuildTrigger

Required. BuildTrigger to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskBuildTrigger

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
Name Description
projectId string

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

trigger BuildTrigger

Required. BuildTrigger to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskBuildTrigger

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(LocationName, WorkerPool, string, CallSettings)

public virtual Operation<WorkerPool, CreateWorkerPoolOperationMetadata> CreateWorkerPool(LocationName parent, WorkerPool workerPool, string workerPoolId, CallSettings callSettings = null)

Creates a WorkerPool.

Parameters
Name Description
parent LocationName

Required. The parent resource where this worker pool will be created. Format: projects/{project}/locations/{location}.

workerPool WorkerPool

Required. WorkerPool resource to create.

workerPoolId string

Required. Immutable. The ID to use for the WorkerPool, which will become the final component of the resource name.

This value should be 1-63 characters, and valid characters are /[a-z][0-9]-/.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationWorkerPoolCreateWorkerPoolOperationMetadata

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
WorkerPool workerPool = new WorkerPool();
string workerPoolId = "";
// Make the request
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> response = cloudBuildClient.CreateWorkerPool(parent, workerPool, workerPoolId);

// Poll until the returned long-running operation is complete
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
WorkerPool 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<WorkerPool, CreateWorkerPoolOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceCreateWorkerPool(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    WorkerPool retrievedResult = retrievedResponse.Result;
}

CreateWorkerPool(CreateWorkerPoolRequest, CallSettings)

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

Creates a WorkerPool.

Parameters
Name Description
request CreateWorkerPoolRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationWorkerPoolCreateWorkerPoolOperationMetadata

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
CreateWorkerPoolRequest request = new CreateWorkerPoolRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    WorkerPool = new WorkerPool(),
    WorkerPoolId = "",
    ValidateOnly = false,
};
// Make the request
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> response = cloudBuildClient.CreateWorkerPool(request);

// Poll until the returned long-running operation is complete
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
WorkerPool 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<WorkerPool, CreateWorkerPoolOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceCreateWorkerPool(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    WorkerPool retrievedResult = retrievedResponse.Result;
}

CreateWorkerPool(string, WorkerPool, string, CallSettings)

public virtual Operation<WorkerPool, CreateWorkerPoolOperationMetadata> CreateWorkerPool(string parent, WorkerPool workerPool, string workerPoolId, CallSettings callSettings = null)

Creates a WorkerPool.

Parameters
Name Description
parent string

Required. The parent resource where this worker pool will be created. Format: projects/{project}/locations/{location}.

workerPool WorkerPool

Required. WorkerPool resource to create.

workerPoolId string

Required. Immutable. The ID to use for the WorkerPool, which will become the final component of the resource name.

This value should be 1-63 characters, and valid characters are /[a-z][0-9]-/.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationWorkerPoolCreateWorkerPoolOperationMetadata

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
WorkerPool workerPool = new WorkerPool();
string workerPoolId = "";
// Make the request
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> response = cloudBuildClient.CreateWorkerPool(parent, workerPool, workerPoolId);

// Poll until the returned long-running operation is complete
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
WorkerPool 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<WorkerPool, CreateWorkerPoolOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceCreateWorkerPool(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    WorkerPool retrievedResult = retrievedResponse.Result;
}

CreateWorkerPoolAsync(LocationName, WorkerPool, string, CallSettings)

public virtual Task<Operation<WorkerPool, CreateWorkerPoolOperationMetadata>> CreateWorkerPoolAsync(LocationName parent, WorkerPool workerPool, string workerPoolId, CallSettings callSettings = null)

Creates a WorkerPool.

Parameters
Name Description
parent LocationName

Required. The parent resource where this worker pool will be created. Format: projects/{project}/locations/{location}.

workerPool WorkerPool

Required. WorkerPool resource to create.

workerPoolId string

Required. Immutable. The ID to use for the WorkerPool, which will become the final component of the resource name.

This value should be 1-63 characters, and valid characters are /[a-z][0-9]-/.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationWorkerPoolCreateWorkerPoolOperationMetadata

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
WorkerPool workerPool = new WorkerPool();
string workerPoolId = "";
// Make the request
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> response = await cloudBuildClient.CreateWorkerPoolAsync(parent, workerPool, workerPoolId);

// Poll until the returned long-running operation is complete
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
WorkerPool 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<WorkerPool, CreateWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    WorkerPool retrievedResult = retrievedResponse.Result;
}

CreateWorkerPoolAsync(LocationName, WorkerPool, string, CancellationToken)

public virtual Task<Operation<WorkerPool, CreateWorkerPoolOperationMetadata>> CreateWorkerPoolAsync(LocationName parent, WorkerPool workerPool, string workerPoolId, CancellationToken cancellationToken)

Creates a WorkerPool.

Parameters
Name Description
parent LocationName

Required. The parent resource where this worker pool will be created. Format: projects/{project}/locations/{location}.

workerPool WorkerPool

Required. WorkerPool resource to create.

workerPoolId string

Required. Immutable. The ID to use for the WorkerPool, which will become the final component of the resource name.

This value should be 1-63 characters, and valid characters are /[a-z][0-9]-/.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationWorkerPoolCreateWorkerPoolOperationMetadata

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
WorkerPool workerPool = new WorkerPool();
string workerPoolId = "";
// Make the request
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> response = await cloudBuildClient.CreateWorkerPoolAsync(parent, workerPool, workerPoolId);

// Poll until the returned long-running operation is complete
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
WorkerPool 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<WorkerPool, CreateWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    WorkerPool retrievedResult = retrievedResponse.Result;
}

CreateWorkerPoolAsync(CreateWorkerPoolRequest, CallSettings)

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

Creates a WorkerPool.

Parameters
Name Description
request CreateWorkerPoolRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationWorkerPoolCreateWorkerPoolOperationMetadata

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
CreateWorkerPoolRequest request = new CreateWorkerPoolRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    WorkerPool = new WorkerPool(),
    WorkerPoolId = "",
    ValidateOnly = false,
};
// Make the request
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> response = await cloudBuildClient.CreateWorkerPoolAsync(request);

// Poll until the returned long-running operation is complete
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
WorkerPool 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<WorkerPool, CreateWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    WorkerPool retrievedResult = retrievedResponse.Result;
}

CreateWorkerPoolAsync(CreateWorkerPoolRequest, CancellationToken)

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

Creates a WorkerPool.

Parameters
Name Description
request CreateWorkerPoolRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationWorkerPoolCreateWorkerPoolOperationMetadata

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
CreateWorkerPoolRequest request = new CreateWorkerPoolRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    WorkerPool = new WorkerPool(),
    WorkerPoolId = "",
    ValidateOnly = false,
};
// Make the request
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> response = await cloudBuildClient.CreateWorkerPoolAsync(request);

// Poll until the returned long-running operation is complete
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
WorkerPool 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<WorkerPool, CreateWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    WorkerPool retrievedResult = retrievedResponse.Result;
}

CreateWorkerPoolAsync(string, WorkerPool, string, CallSettings)

public virtual Task<Operation<WorkerPool, CreateWorkerPoolOperationMetadata>> CreateWorkerPoolAsync(string parent, WorkerPool workerPool, string workerPoolId, CallSettings callSettings = null)

Creates a WorkerPool.

Parameters
Name Description
parent string

Required. The parent resource where this worker pool will be created. Format: projects/{project}/locations/{location}.

workerPool WorkerPool

Required. WorkerPool resource to create.

workerPoolId string

Required. Immutable. The ID to use for the WorkerPool, which will become the final component of the resource name.

This value should be 1-63 characters, and valid characters are /[a-z][0-9]-/.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationWorkerPoolCreateWorkerPoolOperationMetadata

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
WorkerPool workerPool = new WorkerPool();
string workerPoolId = "";
// Make the request
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> response = await cloudBuildClient.CreateWorkerPoolAsync(parent, workerPool, workerPoolId);

// Poll until the returned long-running operation is complete
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
WorkerPool 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<WorkerPool, CreateWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    WorkerPool retrievedResult = retrievedResponse.Result;
}

CreateWorkerPoolAsync(string, WorkerPool, string, CancellationToken)

public virtual Task<Operation<WorkerPool, CreateWorkerPoolOperationMetadata>> CreateWorkerPoolAsync(string parent, WorkerPool workerPool, string workerPoolId, CancellationToken cancellationToken)

Creates a WorkerPool.

Parameters
Name Description
parent string

Required. The parent resource where this worker pool will be created. Format: projects/{project}/locations/{location}.

workerPool WorkerPool

Required. WorkerPool resource to create.

workerPoolId string

Required. Immutable. The ID to use for the WorkerPool, which will become the final component of the resource name.

This value should be 1-63 characters, and valid characters are /[a-z][0-9]-/.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationWorkerPoolCreateWorkerPoolOperationMetadata

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
WorkerPool workerPool = new WorkerPool();
string workerPoolId = "";
// Make the request
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> response = await cloudBuildClient.CreateWorkerPoolAsync(parent, workerPool, workerPoolId);

// Poll until the returned long-running operation is complete
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
WorkerPool 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<WorkerPool, CreateWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    WorkerPool retrievedResult = retrievedResponse.Result;
}

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
Name Description
request DeleteBuildTriggerRequest

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

callSettings CallSettings

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 = "",
    BuildTriggerName = BuildTriggerName.FromProjectTrigger("[PROJECT]", "[TRIGGER]"),
};
// 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
Name Description
projectId string

Required. ID of the project that owns the trigger.

triggerId string

Required. ID of the BuildTrigger to delete.

callSettings CallSettings

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
Name Description
request DeleteBuildTriggerRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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 = "",
    BuildTriggerName = BuildTriggerName.FromProjectTrigger("[PROJECT]", "[TRIGGER]"),
};
// 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
Name Description
request DeleteBuildTriggerRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
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 = "",
    BuildTriggerName = BuildTriggerName.FromProjectTrigger("[PROJECT]", "[TRIGGER]"),
};
// 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
Name Description
projectId string

Required. ID of the project that owns the trigger.

triggerId string

Required. ID of the BuildTrigger to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
projectId string

Required. ID of the project that owns the trigger.

triggerId string

Required. ID of the BuildTrigger to delete.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
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 Operation<Empty, DeleteWorkerPoolOperationMetadata> DeleteWorkerPool(DeleteWorkerPoolRequest request, CallSettings callSettings = null)

Deletes a WorkerPool.

Parameters
Name Description
request DeleteWorkerPoolRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyDeleteWorkerPoolOperationMetadata

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
DeleteWorkerPoolRequest request = new DeleteWorkerPoolRequest
{
    WorkerPoolName = WorkerPoolName.FromProjectLocationWorkerPool("[PROJECT]", "[LOCATION]", "[WORKER_POOL]"),
    Etag = "",
    AllowMissing = false,
    ValidateOnly = false,
};
// Make the request
Operation<Empty, DeleteWorkerPoolOperationMetadata> response = cloudBuildClient.DeleteWorkerPool(request);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteWorkerPoolOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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<Empty, DeleteWorkerPoolOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceDeleteWorkerPool(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteWorkerPool(WorkerPoolName, CallSettings)

public virtual Operation<Empty, DeleteWorkerPoolOperationMetadata> DeleteWorkerPool(WorkerPoolName name, CallSettings callSettings = null)

Deletes a WorkerPool.

Parameters
Name Description
name WorkerPoolName

Required. The name of the WorkerPool to delete. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyDeleteWorkerPoolOperationMetadata

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
WorkerPoolName name = WorkerPoolName.FromProjectLocationWorkerPool("[PROJECT]", "[LOCATION]", "[WORKER_POOL]");
// Make the request
Operation<Empty, DeleteWorkerPoolOperationMetadata> response = cloudBuildClient.DeleteWorkerPool(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteWorkerPoolOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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<Empty, DeleteWorkerPoolOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceDeleteWorkerPool(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteWorkerPool(string, CallSettings)

public virtual Operation<Empty, DeleteWorkerPoolOperationMetadata> DeleteWorkerPool(string name, CallSettings callSettings = null)

Deletes a WorkerPool.

Parameters
Name Description
name string

Required. The name of the WorkerPool to delete. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyDeleteWorkerPoolOperationMetadata

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/workerPools/[WORKER_POOL]";
// Make the request
Operation<Empty, DeleteWorkerPoolOperationMetadata> response = cloudBuildClient.DeleteWorkerPool(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteWorkerPoolOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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<Empty, DeleteWorkerPoolOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceDeleteWorkerPool(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteWorkerPoolAsync(DeleteWorkerPoolRequest, CallSettings)

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

Deletes a WorkerPool.

Parameters
Name Description
request DeleteWorkerPoolRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyDeleteWorkerPoolOperationMetadata

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
DeleteWorkerPoolRequest request = new DeleteWorkerPoolRequest
{
    WorkerPoolName = WorkerPoolName.FromProjectLocationWorkerPool("[PROJECT]", "[LOCATION]", "[WORKER_POOL]"),
    Etag = "",
    AllowMissing = false,
    ValidateOnly = false,
};
// Make the request
Operation<Empty, DeleteWorkerPoolOperationMetadata> response = await cloudBuildClient.DeleteWorkerPoolAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceDeleteWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteWorkerPoolAsync(DeleteWorkerPoolRequest, CancellationToken)

public virtual Task<Operation<Empty, DeleteWorkerPoolOperationMetadata>> DeleteWorkerPoolAsync(DeleteWorkerPoolRequest request, CancellationToken cancellationToken)

Deletes a WorkerPool.

Parameters
Name Description
request DeleteWorkerPoolRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyDeleteWorkerPoolOperationMetadata

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
DeleteWorkerPoolRequest request = new DeleteWorkerPoolRequest
{
    WorkerPoolName = WorkerPoolName.FromProjectLocationWorkerPool("[PROJECT]", "[LOCATION]", "[WORKER_POOL]"),
    Etag = "",
    AllowMissing = false,
    ValidateOnly = false,
};
// Make the request
Operation<Empty, DeleteWorkerPoolOperationMetadata> response = await cloudBuildClient.DeleteWorkerPoolAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceDeleteWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteWorkerPoolAsync(WorkerPoolName, CallSettings)

public virtual Task<Operation<Empty, DeleteWorkerPoolOperationMetadata>> DeleteWorkerPoolAsync(WorkerPoolName name, CallSettings callSettings = null)

Deletes a WorkerPool.

Parameters
Name Description
name WorkerPoolName

Required. The name of the WorkerPool to delete. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyDeleteWorkerPoolOperationMetadata

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
WorkerPoolName name = WorkerPoolName.FromProjectLocationWorkerPool("[PROJECT]", "[LOCATION]", "[WORKER_POOL]");
// Make the request
Operation<Empty, DeleteWorkerPoolOperationMetadata> response = await cloudBuildClient.DeleteWorkerPoolAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceDeleteWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteWorkerPoolAsync(WorkerPoolName, CancellationToken)

public virtual Task<Operation<Empty, DeleteWorkerPoolOperationMetadata>> DeleteWorkerPoolAsync(WorkerPoolName name, CancellationToken cancellationToken)

Deletes a WorkerPool.

Parameters
Name Description
name WorkerPoolName

Required. The name of the WorkerPool to delete. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyDeleteWorkerPoolOperationMetadata

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
WorkerPoolName name = WorkerPoolName.FromProjectLocationWorkerPool("[PROJECT]", "[LOCATION]", "[WORKER_POOL]");
// Make the request
Operation<Empty, DeleteWorkerPoolOperationMetadata> response = await cloudBuildClient.DeleteWorkerPoolAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceDeleteWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteWorkerPoolAsync(string, CallSettings)

public virtual Task<Operation<Empty, DeleteWorkerPoolOperationMetadata>> DeleteWorkerPoolAsync(string name, CallSettings callSettings = null)

Deletes a WorkerPool.

Parameters
Name Description
name string

Required. The name of the WorkerPool to delete. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyDeleteWorkerPoolOperationMetadata

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/workerPools/[WORKER_POOL]";
// Make the request
Operation<Empty, DeleteWorkerPoolOperationMetadata> response = await cloudBuildClient.DeleteWorkerPoolAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceDeleteWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteWorkerPoolAsync(string, CancellationToken)

public virtual Task<Operation<Empty, DeleteWorkerPoolOperationMetadata>> DeleteWorkerPoolAsync(string name, CancellationToken cancellationToken)

Deletes a WorkerPool.

Parameters
Name Description
name string

Required. The name of the WorkerPool to delete. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyDeleteWorkerPoolOperationMetadata

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/workerPools/[WORKER_POOL]";
// Make the request
Operation<Empty, DeleteWorkerPoolOperationMetadata> response = await cloudBuildClient.DeleteWorkerPoolAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceDeleteWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

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
Name Description
request GetBuildRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
projectId string

Required. ID of the project.

id string

Required. ID of the build.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
request GetBuildRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskBuild

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
Name Description
request GetBuildRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskBuild

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
Name Description
projectId string

Required. ID of the project.

id string

Required. ID of the build.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskBuild

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
Name Description
projectId string

Required. ID of the project.

id string

Required. ID of the build.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskBuild

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
Name Description
request GetBuildTriggerRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BuildTrigger

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
GetBuildTriggerRequest request = new GetBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
    BuildTriggerName = BuildTriggerName.FromProjectTrigger("[PROJECT]", "[TRIGGER]"),
};
// 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
Name Description
projectId string

Required. ID of the project that owns the trigger.

triggerId string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
request GetBuildTriggerRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskBuildTrigger

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
GetBuildTriggerRequest request = new GetBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
    BuildTriggerName = BuildTriggerName.FromProjectTrigger("[PROJECT]", "[TRIGGER]"),
};
// 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
Name Description
request GetBuildTriggerRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskBuildTrigger

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
GetBuildTriggerRequest request = new GetBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
    BuildTriggerName = BuildTriggerName.FromProjectTrigger("[PROJECT]", "[TRIGGER]"),
};
// 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
Name Description
projectId string

Required. ID of the project that owns the trigger.

triggerId string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskBuildTrigger

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
Name Description
projectId string

Required. ID of the project that owns the trigger.

triggerId string

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskBuildTrigger

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 details of a WorkerPool.

Parameters
Name Description
request GetWorkerPoolRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
WorkerPool

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
GetWorkerPoolRequest request = new GetWorkerPoolRequest
{
    WorkerPoolName = WorkerPoolName.FromProjectLocationWorkerPool("[PROJECT]", "[LOCATION]", "[WORKER_POOL]"),
};
// Make the request
WorkerPool response = cloudBuildClient.GetWorkerPool(request);

GetWorkerPool(WorkerPoolName, CallSettings)

public virtual WorkerPool GetWorkerPool(WorkerPoolName name, CallSettings callSettings = null)

Returns details of a WorkerPool.

Parameters
Name Description
name WorkerPoolName

Required. The name of the WorkerPool to retrieve. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
WorkerPool

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
WorkerPoolName name = WorkerPoolName.FromProjectLocationWorkerPool("[PROJECT]", "[LOCATION]", "[WORKER_POOL]");
// Make the request
WorkerPool response = cloudBuildClient.GetWorkerPool(name);

GetWorkerPool(string, CallSettings)

public virtual WorkerPool GetWorkerPool(string name, CallSettings callSettings = null)

Returns details of a WorkerPool.

Parameters
Name Description
name string

Required. The name of the WorkerPool to retrieve. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
WorkerPool

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/workerPools/[WORKER_POOL]";
// Make the request
WorkerPool response = cloudBuildClient.GetWorkerPool(name);

GetWorkerPoolAsync(GetWorkerPoolRequest, CallSettings)

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

Returns details of a WorkerPool.

Parameters
Name Description
request GetWorkerPoolRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskWorkerPool

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
GetWorkerPoolRequest request = new GetWorkerPoolRequest
{
    WorkerPoolName = WorkerPoolName.FromProjectLocationWorkerPool("[PROJECT]", "[LOCATION]", "[WORKER_POOL]"),
};
// Make the request
WorkerPool response = await cloudBuildClient.GetWorkerPoolAsync(request);

GetWorkerPoolAsync(GetWorkerPoolRequest, CancellationToken)

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

Returns details of a WorkerPool.

Parameters
Name Description
request GetWorkerPoolRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskWorkerPool

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
GetWorkerPoolRequest request = new GetWorkerPoolRequest
{
    WorkerPoolName = WorkerPoolName.FromProjectLocationWorkerPool("[PROJECT]", "[LOCATION]", "[WORKER_POOL]"),
};
// Make the request
WorkerPool response = await cloudBuildClient.GetWorkerPoolAsync(request);

GetWorkerPoolAsync(WorkerPoolName, CallSettings)

public virtual Task<WorkerPool> GetWorkerPoolAsync(WorkerPoolName name, CallSettings callSettings = null)

Returns details of a WorkerPool.

Parameters
Name Description
name WorkerPoolName

Required. The name of the WorkerPool to retrieve. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskWorkerPool

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
WorkerPoolName name = WorkerPoolName.FromProjectLocationWorkerPool("[PROJECT]", "[LOCATION]", "[WORKER_POOL]");
// Make the request
WorkerPool response = await cloudBuildClient.GetWorkerPoolAsync(name);

GetWorkerPoolAsync(WorkerPoolName, CancellationToken)

public virtual Task<WorkerPool> GetWorkerPoolAsync(WorkerPoolName name, CancellationToken cancellationToken)

Returns details of a WorkerPool.

Parameters
Name Description
name WorkerPoolName

Required. The name of the WorkerPool to retrieve. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskWorkerPool

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
WorkerPoolName name = WorkerPoolName.FromProjectLocationWorkerPool("[PROJECT]", "[LOCATION]", "[WORKER_POOL]");
// Make the request
WorkerPool response = await cloudBuildClient.GetWorkerPoolAsync(name);

GetWorkerPoolAsync(string, CallSettings)

public virtual Task<WorkerPool> GetWorkerPoolAsync(string name, CallSettings callSettings = null)

Returns details of a WorkerPool.

Parameters
Name Description
name string

Required. The name of the WorkerPool to retrieve. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskWorkerPool

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/workerPools/[WORKER_POOL]";
// Make the request
WorkerPool response = await cloudBuildClient.GetWorkerPoolAsync(name);

GetWorkerPoolAsync(string, CancellationToken)

public virtual Task<WorkerPool> GetWorkerPoolAsync(string name, CancellationToken cancellationToken)

Returns details of a WorkerPool.

Parameters
Name Description
name string

Required. The name of the WorkerPool to retrieve. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskWorkerPool

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/workerPools/[WORKER_POOL]";
// Make the request
WorkerPool response = await cloudBuildClient.GetWorkerPoolAsync(name);

ListBuildTriggers(ListBuildTriggersRequest, CallSettings)

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

Lists existing BuildTriggers.

This API is experimental.

Parameters
Name Description
request ListBuildTriggersRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListBuildTriggersResponseBuildTrigger

A pageable sequence of BuildTrigger resources.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
ListBuildTriggersRequest request = new ListBuildTriggersRequest
{
    ProjectId = "",
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// 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, int?, CallSettings)

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

Lists existing BuildTriggers.

This API is experimental.

Parameters
Name Description
projectId string

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

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListBuildTriggersResponseBuildTrigger

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
Name Description
request ListBuildTriggersRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListBuildTriggersResponseBuildTrigger

A pageable asynchronous sequence of BuildTrigger resources.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
ListBuildTriggersRequest request = new ListBuildTriggersRequest
{
    ProjectId = "",
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// 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, int?, CallSettings)

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

Lists existing BuildTriggers.

This API is experimental.

Parameters
Name Description
projectId string

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

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListBuildTriggersResponseBuildTrigger

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;

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
Name Description
request ListBuildsRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListBuildsResponseBuild

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, int?, CallSettings)

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

Lists previously requested builds.

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

Parameters
Name Description
projectId string

Required. ID of the project.

filter string

The raw filter text to constrain the results.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListBuildsResponseBuild

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
Name Description
request ListBuildsRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListBuildsResponseBuild

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, int?, CallSettings)

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

Lists previously requested builds.

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

Parameters
Name Description
projectId string

Required. ID of the project.

filter string

The raw filter text to constrain the results.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListBuildsResponseBuild

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;

ListWorkerPools(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListWorkerPoolsResponse, WorkerPool> ListWorkerPools(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists WorkerPools.

Parameters
Name Description
parent LocationName

Required. The parent of the collection of WorkerPools. Format: projects/{project}/locations/{location}.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListWorkerPoolsResponseWorkerPool

A pageable sequence of WorkerPool resources.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListWorkerPoolsResponse, WorkerPool> response = cloudBuildClient.ListWorkerPools(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (WorkerPool 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 (ListWorkerPoolsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (WorkerPool 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<WorkerPool> 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 (WorkerPool 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 PagedEnumerable<ListWorkerPoolsResponse, WorkerPool> ListWorkerPools(ListWorkerPoolsRequest request, CallSettings callSettings = null)

Lists WorkerPools.

Parameters
Name Description
request ListWorkerPoolsRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListWorkerPoolsResponseWorkerPool

A pageable sequence of WorkerPool resources.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
ListWorkerPoolsRequest request = new ListWorkerPoolsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedEnumerable<ListWorkerPoolsResponse, WorkerPool> response = cloudBuildClient.ListWorkerPools(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (WorkerPool 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 (ListWorkerPoolsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (WorkerPool 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<WorkerPool> 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 (WorkerPool 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(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListWorkerPoolsResponse, WorkerPool> ListWorkerPools(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists WorkerPools.

Parameters
Name Description
parent string

Required. The parent of the collection of WorkerPools. Format: projects/{project}/locations/{location}.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListWorkerPoolsResponseWorkerPool

A pageable sequence of WorkerPool resources.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListWorkerPoolsResponse, WorkerPool> response = cloudBuildClient.ListWorkerPools(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (WorkerPool 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 (ListWorkerPoolsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (WorkerPool 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<WorkerPool> 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 (WorkerPool 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;

ListWorkerPoolsAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListWorkerPoolsResponse, WorkerPool> ListWorkerPoolsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists WorkerPools.

Parameters
Name Description
parent LocationName

Required. The parent of the collection of WorkerPools. Format: projects/{project}/locations/{location}.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListWorkerPoolsResponseWorkerPool

A pageable asynchronous sequence of WorkerPool resources.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListWorkerPoolsResponse, WorkerPool> response = cloudBuildClient.ListWorkerPoolsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((WorkerPool 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((ListWorkerPoolsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (WorkerPool 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<WorkerPool> 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 (WorkerPool 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;

ListWorkerPoolsAsync(ListWorkerPoolsRequest, CallSettings)

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

Lists WorkerPools.

Parameters
Name Description
request ListWorkerPoolsRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListWorkerPoolsResponseWorkerPool

A pageable asynchronous sequence of WorkerPool resources.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
ListWorkerPoolsRequest request = new ListWorkerPoolsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedAsyncEnumerable<ListWorkerPoolsResponse, WorkerPool> response = cloudBuildClient.ListWorkerPoolsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((WorkerPool 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((ListWorkerPoolsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (WorkerPool 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<WorkerPool> 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 (WorkerPool 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;

ListWorkerPoolsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListWorkerPoolsResponse, WorkerPool> ListWorkerPoolsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists WorkerPools.

Parameters
Name Description
parent string

Required. The parent of the collection of WorkerPools. Format: projects/{project}/locations/{location}.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListWorkerPoolsResponseWorkerPool

A pageable asynchronous sequence of WorkerPool resources.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListWorkerPoolsResponse, WorkerPool> response = cloudBuildClient.ListWorkerPoolsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((WorkerPool 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((ListWorkerPoolsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (WorkerPool 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<WorkerPool> 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 (WorkerPool 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;

PollOnceApproveBuild(string, CallSettings)

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

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationBuildBuildOperationMetadata

The result of polling the operation.

PollOnceApproveBuildAsync(string, CallSettings)

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

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

A task representing the result of polling the operation.

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
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationBuildBuildOperationMetadata

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
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

A task representing the result of polling the operation.

PollOnceCreateWorkerPool(string, CallSettings)

public virtual Operation<WorkerPool, CreateWorkerPoolOperationMetadata> PollOnceCreateWorkerPool(string operationName, CallSettings callSettings = null)

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationWorkerPoolCreateWorkerPoolOperationMetadata

The result of polling the operation.

PollOnceCreateWorkerPoolAsync(string, CallSettings)

public virtual Task<Operation<WorkerPool, CreateWorkerPoolOperationMetadata>> PollOnceCreateWorkerPoolAsync(string operationName, CallSettings callSettings = null)

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationWorkerPoolCreateWorkerPoolOperationMetadata

A task representing the result of polling the operation.

PollOnceDeleteWorkerPool(string, CallSettings)

public virtual Operation<Empty, DeleteWorkerPoolOperationMetadata> PollOnceDeleteWorkerPool(string operationName, CallSettings callSettings = null)

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyDeleteWorkerPoolOperationMetadata

The result of polling the operation.

PollOnceDeleteWorkerPoolAsync(string, CallSettings)

public virtual Task<Operation<Empty, DeleteWorkerPoolOperationMetadata>> PollOnceDeleteWorkerPoolAsync(string operationName, CallSettings callSettings = null)

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyDeleteWorkerPoolOperationMetadata

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
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationBuildBuildOperationMetadata

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
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

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
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationBuildBuildOperationMetadata

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
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

A task representing the result of polling the operation.

PollOnceUpdateWorkerPool(string, CallSettings)

public virtual Operation<WorkerPool, UpdateWorkerPoolOperationMetadata> PollOnceUpdateWorkerPool(string operationName, CallSettings callSettings = null)

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationWorkerPoolUpdateWorkerPoolOperationMetadata

The result of polling the operation.

PollOnceUpdateWorkerPoolAsync(string, CallSettings)

public virtual Task<Operation<WorkerPool, UpdateWorkerPoolOperationMetadata>> PollOnceUpdateWorkerPoolAsync(string operationName, CallSettings callSettings = null)

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

Parameters
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationWorkerPoolUpdateWorkerPoolOperationMetadata

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
Name Description
request ReceiveTriggerWebhookRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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 = "",
    Name = "",
};
// 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
Name Description
request ReceiveTriggerWebhookRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskReceiveTriggerWebhookResponse

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 = "",
    Name = "",
};
// 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
Name Description
request ReceiveTriggerWebhookRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskReceiveTriggerWebhookResponse

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 = "",
    Name = "",
};
// 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 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
Name Description
request RetryBuildRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationBuildBuildOperationMetadata

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 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
Name Description
projectId string

Required. ID of the project.

id string

Required. Build ID of the original build.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationBuildBuildOperationMetadata

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 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
Name Description
request RetryBuildRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

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 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
Name Description
request RetryBuildRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

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 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
Name Description
projectId string

Required. ID of the project.

id string

Required. Build ID of the original build.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

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 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
Name Description
projectId string

Required. ID of the project.

id string

Required. Build ID of the original build.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

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.

To run a regional or global trigger, use the POST request that includes the location endpoint in the path (ex. v1/projects/{projectId}/locations/{region}/triggers/{triggerId}:run). The POST request that does not include the location endpoint in the path can only be used when running global triggers.

Parameters
Name Description
request RunBuildTriggerRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationBuildBuildOperationMetadata

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
RunBuildTriggerRequest request = new RunBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
    Source = new RepoSource(),
    BuildTriggerName = BuildTriggerName.FromProjectTrigger("[PROJECT]", "[TRIGGER]"),
};
// 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.

To run a regional or global trigger, use the POST request that includes the location endpoint in the path (ex. v1/projects/{projectId}/locations/{region}/triggers/{triggerId}:run). The POST request that does not include the location endpoint in the path can only be used when running global triggers.

Parameters
Name Description
projectId string

Required. ID of the project.

triggerId string

Required. ID of the trigger.

source RepoSource

Source to build against this trigger. Branch and tag names cannot consist of regular expressions.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationBuildBuildOperationMetadata

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.

To run a regional or global trigger, use the POST request that includes the location endpoint in the path (ex. v1/projects/{projectId}/locations/{region}/triggers/{triggerId}:run). The POST request that does not include the location endpoint in the path can only be used when running global triggers.

Parameters
Name Description
request RunBuildTriggerRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

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(),
    BuildTriggerName = BuildTriggerName.FromProjectTrigger("[PROJECT]", "[TRIGGER]"),
};
// 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.

To run a regional or global trigger, use the POST request that includes the location endpoint in the path (ex. v1/projects/{projectId}/locations/{region}/triggers/{triggerId}:run). The POST request that does not include the location endpoint in the path can only be used when running global triggers.

Parameters
Name Description
request RunBuildTriggerRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

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(),
    BuildTriggerName = BuildTriggerName.FromProjectTrigger("[PROJECT]", "[TRIGGER]"),
};
// 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.

To run a regional or global trigger, use the POST request that includes the location endpoint in the path (ex. v1/projects/{projectId}/locations/{region}/triggers/{triggerId}:run). The POST request that does not include the location endpoint in the path can only be used when running global triggers.

Parameters
Name Description
projectId string

Required. ID of the project.

triggerId string

Required. ID of the trigger.

source RepoSource

Source to build against this trigger. Branch and tag names cannot consist of regular expressions.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

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.

To run a regional or global trigger, use the POST request that includes the location endpoint in the path (ex. v1/projects/{projectId}/locations/{region}/triggers/{triggerId}:run). The POST request that does not include the location endpoint in the path can only be used when running global triggers.

Parameters
Name Description
projectId string

Required. ID of the project.

triggerId string

Required. ID of the trigger.

source RepoSource

Source to build against this trigger. Branch and tag names cannot consist of regular expressions.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationBuildBuildOperationMetadata

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
Type Description
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
Name Description
request UpdateBuildTriggerRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BuildTrigger

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
UpdateBuildTriggerRequest request = new UpdateBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
    Trigger = new BuildTrigger(),
    UpdateMask = new FieldMask(),
};
// 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
Name Description
projectId string

Required. ID of the project that owns the trigger.

triggerId string

Required. ID of the BuildTrigger to update.

trigger BuildTrigger

Required. BuildTrigger to update.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
request UpdateBuildTriggerRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskBuildTrigger

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(),
    UpdateMask = new FieldMask(),
};
// 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
Name Description
request UpdateBuildTriggerRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskBuildTrigger

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(),
    UpdateMask = new FieldMask(),
};
// 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
Name Description
projectId string

Required. ID of the project that owns the trigger.

triggerId string

Required. ID of the BuildTrigger to update.

trigger BuildTrigger

Required. BuildTrigger to update.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskBuildTrigger

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
Name Description
projectId string

Required. ID of the project that owns the trigger.

triggerId string

Required. ID of the BuildTrigger to update.

trigger BuildTrigger

Required. BuildTrigger to update.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskBuildTrigger

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 Operation<WorkerPool, UpdateWorkerPoolOperationMetadata> UpdateWorkerPool(UpdateWorkerPoolRequest request, CallSettings callSettings = null)

Updates a WorkerPool.

Parameters
Name Description
request UpdateWorkerPoolRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationWorkerPoolUpdateWorkerPoolOperationMetadata

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
UpdateWorkerPoolRequest request = new UpdateWorkerPoolRequest
{
    WorkerPool = new WorkerPool(),
    UpdateMask = new FieldMask(),
    ValidateOnly = false,
};
// Make the request
Operation<WorkerPool, UpdateWorkerPoolOperationMetadata> response = cloudBuildClient.UpdateWorkerPool(request);

// Poll until the returned long-running operation is complete
Operation<WorkerPool, UpdateWorkerPoolOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
WorkerPool 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<WorkerPool, UpdateWorkerPoolOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceUpdateWorkerPool(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    WorkerPool retrievedResult = retrievedResponse.Result;
}

UpdateWorkerPool(WorkerPool, FieldMask, CallSettings)

public virtual Operation<WorkerPool, UpdateWorkerPoolOperationMetadata> UpdateWorkerPool(WorkerPool workerPool, FieldMask updateMask, CallSettings callSettings = null)

Updates a WorkerPool.

Parameters
Name Description
workerPool WorkerPool

Required. The WorkerPool to update.

The name field is used to identify the WorkerPool to update. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.

updateMask FieldMask

A mask specifying which fields in worker_pool to update.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationWorkerPoolUpdateWorkerPoolOperationMetadata

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
WorkerPool workerPool = new WorkerPool();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<WorkerPool, UpdateWorkerPoolOperationMetadata> response = cloudBuildClient.UpdateWorkerPool(workerPool, updateMask);

// Poll until the returned long-running operation is complete
Operation<WorkerPool, UpdateWorkerPoolOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
WorkerPool 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<WorkerPool, UpdateWorkerPoolOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceUpdateWorkerPool(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    WorkerPool retrievedResult = retrievedResponse.Result;
}

UpdateWorkerPoolAsync(UpdateWorkerPoolRequest, CallSettings)

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

Updates a WorkerPool.

Parameters
Name Description
request UpdateWorkerPoolRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationWorkerPoolUpdateWorkerPoolOperationMetadata

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
UpdateWorkerPoolRequest request = new UpdateWorkerPoolRequest
{
    WorkerPool = new WorkerPool(),
    UpdateMask = new FieldMask(),
    ValidateOnly = false,
};
// Make the request
Operation<WorkerPool, UpdateWorkerPoolOperationMetadata> response = await cloudBuildClient.UpdateWorkerPoolAsync(request);

// Poll until the returned long-running operation is complete
Operation<WorkerPool, UpdateWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
WorkerPool 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<WorkerPool, UpdateWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceUpdateWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    WorkerPool retrievedResult = retrievedResponse.Result;
}

UpdateWorkerPoolAsync(UpdateWorkerPoolRequest, CancellationToken)

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

Updates a WorkerPool.

Parameters
Name Description
request UpdateWorkerPoolRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationWorkerPoolUpdateWorkerPoolOperationMetadata

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
UpdateWorkerPoolRequest request = new UpdateWorkerPoolRequest
{
    WorkerPool = new WorkerPool(),
    UpdateMask = new FieldMask(),
    ValidateOnly = false,
};
// Make the request
Operation<WorkerPool, UpdateWorkerPoolOperationMetadata> response = await cloudBuildClient.UpdateWorkerPoolAsync(request);

// Poll until the returned long-running operation is complete
Operation<WorkerPool, UpdateWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
WorkerPool 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<WorkerPool, UpdateWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceUpdateWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    WorkerPool retrievedResult = retrievedResponse.Result;
}

UpdateWorkerPoolAsync(WorkerPool, FieldMask, CallSettings)

public virtual Task<Operation<WorkerPool, UpdateWorkerPoolOperationMetadata>> UpdateWorkerPoolAsync(WorkerPool workerPool, FieldMask updateMask, CallSettings callSettings = null)

Updates a WorkerPool.

Parameters
Name Description
workerPool WorkerPool

Required. The WorkerPool to update.

The name field is used to identify the WorkerPool to update. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.

updateMask FieldMask

A mask specifying which fields in worker_pool to update.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationWorkerPoolUpdateWorkerPoolOperationMetadata

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
WorkerPool workerPool = new WorkerPool();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<WorkerPool, UpdateWorkerPoolOperationMetadata> response = await cloudBuildClient.UpdateWorkerPoolAsync(workerPool, updateMask);

// Poll until the returned long-running operation is complete
Operation<WorkerPool, UpdateWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
WorkerPool 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<WorkerPool, UpdateWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceUpdateWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    WorkerPool retrievedResult = retrievedResponse.Result;
}

UpdateWorkerPoolAsync(WorkerPool, FieldMask, CancellationToken)

public virtual Task<Operation<WorkerPool, UpdateWorkerPoolOperationMetadata>> UpdateWorkerPoolAsync(WorkerPool workerPool, FieldMask updateMask, CancellationToken cancellationToken)

Updates a WorkerPool.

Parameters
Name Description
workerPool WorkerPool

Required. The WorkerPool to update.

The name field is used to identify the WorkerPool to update. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.

updateMask FieldMask

A mask specifying which fields in worker_pool to update.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationWorkerPoolUpdateWorkerPoolOperationMetadata

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
WorkerPool workerPool = new WorkerPool();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<WorkerPool, UpdateWorkerPoolOperationMetadata> response = await cloudBuildClient.UpdateWorkerPoolAsync(workerPool, updateMask);

// Poll until the returned long-running operation is complete
Operation<WorkerPool, UpdateWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
WorkerPool 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<WorkerPool, UpdateWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceUpdateWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    WorkerPool retrievedResult = retrievedResponse.Result;
}