Cloud Build v1 API - Class CloudBuildClient (2.6.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
TypeDescription
OperationsClient

CreateBuildOperationsClient

public virtual OperationsClient CreateBuildOperationsClient { get; }

The long-running operations client for CreateBuild.

Property Value
TypeDescription
OperationsClient

CreateWorkerPoolOperationsClient

public virtual OperationsClient CreateWorkerPoolOperationsClient { get; }

The long-running operations client for CreateWorkerPool.

Property Value
TypeDescription
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default CloudBuild scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

The default CloudBuild scopes are:

DeleteWorkerPoolOperationsClient

public virtual OperationsClient DeleteWorkerPoolOperationsClient { get; }

The long-running operations client for DeleteWorkerPool.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual CloudBuild.CloudBuildClient GrpcClient { get; }

The underlying gRPC CloudBuild client

Property Value
TypeDescription
CloudBuildCloudBuildClient

RetryBuildOperationsClient

public virtual OperationsClient RetryBuildOperationsClient { get; }

The long-running operations client for RetryBuild.

Property Value
TypeDescription
OperationsClient

RunBuildTriggerOperationsClient

public virtual OperationsClient RunBuildTriggerOperationsClient { get; }

The long-running operations client for RunBuildTrigger.

Property Value
TypeDescription
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

UpdateWorkerPoolOperationsClient

public virtual OperationsClient UpdateWorkerPoolOperationsClient { get; }

The long-running operations client for UpdateWorkerPool.

Property Value
TypeDescription
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
NameDescription
requestApproveBuildRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationBuildBuildOperationMetadata

The RPC response.

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
NameDescription
namestring

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

approvalResultApprovalResult

Approval decision and metadata.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestApproveBuildRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationBuildBuildOperationMetadata

A Task containing the RPC response.

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
NameDescription
requestApproveBuildRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
namestring

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

approvalResultApprovalResult

Approval decision and metadata.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
namestring

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

approvalResultApprovalResult

Approval decision and metadata.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestCancelBuildRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Build

The RPC response.

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

CancelBuild(string, string, CallSettings)

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

Cancels a build in progress.

Parameters
NameDescription
projectIdstring

Required. ID of the project.

idstring

Required. ID of the build.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Build

The RPC response.

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

CancelBuildAsync(CancelBuildRequest, CallSettings)

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

Cancels a build in progress.

Parameters
NameDescription
requestCancelBuildRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCancelBuildRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
projectIdstring

Required. ID of the project.

idstring

Required. ID of the build.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
projectIdstring

Required. ID of the project.

idstring

Required. ID of the build.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
TypeDescription
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
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
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
NameDescription
requestCreateBuildRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationBuildBuildOperationMetadata

The RPC response.

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

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

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

CreateBuild(string, Build, CallSettings)

public virtual Operation<Build, BuildOperationMetadata> CreateBuild(string projectId, Build build, CallSettings callSettings = null)

Starts a build with the specified configuration.

This method returns a long-running Operation, which includes the build ID. Pass the build ID to GetBuild to determine the build status (such as SUCCESS or FAILURE).

Parameters
NameDescription
projectIdstring

Required. ID of the project.

buildBuild

Required. Build resource to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateBuildRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationBuildBuildOperationMetadata

A Task containing the RPC response.

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

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

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

CreateBuildAsync(CreateBuildRequest, CancellationToken)

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

Starts a build with the specified configuration.

This method returns a long-running Operation, which includes the build ID. Pass the build ID to GetBuild to determine the build status (such as SUCCESS or FAILURE).

Parameters
NameDescription
requestCreateBuildRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
projectIdstring

Required. ID of the project.

buildBuild

Required. Build resource to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
projectIdstring

Required. ID of the project.

buildBuild

Required. Build resource to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestCreateBuildTriggerRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BuildTrigger

The RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
CreateBuildTriggerRequest request = new CreateBuildTriggerRequest
{
    ProjectId = "",
    Trigger = new BuildTrigger(),
    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
NameDescription
projectIdstring

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

triggerBuildTrigger

Required. BuildTrigger to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BuildTrigger

The RPC response.

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

CreateBuildTriggerAsync(CreateBuildTriggerRequest, CallSettings)

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

Creates a new BuildTrigger.

This API is experimental.

Parameters
NameDescription
requestCreateBuildTriggerRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateBuildTriggerRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
projectIdstring

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

triggerBuildTrigger

Required. BuildTrigger to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
projectIdstring

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

triggerBuildTrigger

Required. BuildTrigger to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
parentLocationName

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

workerPoolWorkerPool

Required. WorkerPool resource to create.

workerPoolIdstring

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]-/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateWorkerPoolRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationWorkerPoolCreateWorkerPoolOperationMetadata

The RPC response.

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
NameDescription
parentstring

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

workerPoolWorkerPool

Required. WorkerPool resource to create.

workerPoolIdstring

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]-/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

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

workerPoolWorkerPool

Required. WorkerPool resource to create.

workerPoolIdstring

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]-/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

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

workerPoolWorkerPool

Required. WorkerPool resource to create.

workerPoolIdstring

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]-/.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestCreateWorkerPoolRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationWorkerPoolCreateWorkerPoolOperationMetadata

A Task containing the RPC response.

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
NameDescription
requestCreateWorkerPoolRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
parentstring

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

workerPoolWorkerPool

Required. WorkerPool resource to create.

workerPoolIdstring

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]-/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

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

workerPoolWorkerPool

Required. WorkerPool resource to create.

workerPoolIdstring

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]-/.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestDeleteBuildTriggerRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
DeleteBuildTriggerRequest request = new DeleteBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
    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
NameDescription
projectIdstring

Required. ID of the project that owns the trigger.

triggerIdstring

Required. ID of the BuildTrigger to delete.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

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

DeleteBuildTriggerAsync(DeleteBuildTriggerRequest, CallSettings)

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

Deletes a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Parameters
NameDescription
requestDeleteBuildTriggerRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
DeleteBuildTriggerRequest request = new DeleteBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
    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
NameDescription
requestDeleteBuildTriggerRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
DeleteBuildTriggerRequest request = new DeleteBuildTriggerRequest
{
    ProjectId = "",
    TriggerId = "",
    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
NameDescription
projectId