Cloud Run Admin v2 API - Class BuildsClient (2.10.0)

public abstract class BuildsClient

Reference documentation and code samples for the Cloud Run Admin v2 API class BuildsClient.

Builds client wrapper, for convenient use.

Inheritance

object > BuildsClient

Derived Types

Namespace

Google.Cloud.Run.V2

Assembly

Google.Cloud.Run.V2.dll

Remarks

Cloud Run Build Control Plane API

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default Builds scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default Builds scopes are:

GrpcClient

public virtual Builds.BuildsClient GrpcClient { get; }

The underlying gRPC Builds client

Property Value
Type Description
BuildsBuildsClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
Type Description
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static BuildsClient Create()

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

Returns
Type Description
BuildsClient

The created BuildsClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskBuildsClient

The task representing the created BuildsClient.

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.

SubmitBuild(SubmitBuildRequest, CallSettings)

public virtual SubmitBuildResponse SubmitBuild(SubmitBuildRequest request, CallSettings callSettings = null)

Submits a build in a given project.

Parameters
Name Description
request SubmitBuildRequest

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
SubmitBuildResponse

The RPC response.

Example
// Create client
gcrv::BuildsClient buildsClient = gcrv::BuildsClient.Create();
// Initialize request argument(s)
gcrv::SubmitBuildRequest request = new gcrv::SubmitBuildRequest
{
    Parent = "",
    StorageSource = new gcrv::StorageSource(),
    ImageUri = "",
    BuildpackBuild = new gcrv::SubmitBuildRequest.Types.BuildpacksBuild(),
    ServiceAccount = "",
    WorkerPoolAsWorkerPoolName = gcrv::WorkerPoolName.FromProjectLocationWorkerPool("[PROJECT]", "[LOCATION]", "[WORKER_POOL]"),
    Tags = { "", },
};
// Make the request
gcrv::SubmitBuildResponse response = buildsClient.SubmitBuild(request);

SubmitBuildAsync(SubmitBuildRequest, CallSettings)

public virtual Task<SubmitBuildResponse> SubmitBuildAsync(SubmitBuildRequest request, CallSettings callSettings = null)

Submits a build in a given project.

Parameters
Name Description
request SubmitBuildRequest

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
TaskSubmitBuildResponse

A Task containing the RPC response.

Example
// Create client
gcrv::BuildsClient buildsClient = await gcrv::BuildsClient.CreateAsync();
// Initialize request argument(s)
gcrv::SubmitBuildRequest request = new gcrv::SubmitBuildRequest
{
    Parent = "",
    StorageSource = new gcrv::StorageSource(),
    ImageUri = "",
    BuildpackBuild = new gcrv::SubmitBuildRequest.Types.BuildpacksBuild(),
    ServiceAccount = "",
    WorkerPoolAsWorkerPoolName = gcrv::WorkerPoolName.FromProjectLocationWorkerPool("[PROJECT]", "[LOCATION]", "[WORKER_POOL]"),
    Tags = { "", },
};
// Make the request
gcrv::SubmitBuildResponse response = await buildsClient.SubmitBuildAsync(request);

SubmitBuildAsync(SubmitBuildRequest, CancellationToken)

public virtual Task<SubmitBuildResponse> SubmitBuildAsync(SubmitBuildRequest request, CancellationToken cancellationToken)

Submits a build in a given project.

Parameters
Name Description
request SubmitBuildRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSubmitBuildResponse

A Task containing the RPC response.

Example
// Create client
gcrv::BuildsClient buildsClient = await gcrv::BuildsClient.CreateAsync();
// Initialize request argument(s)
gcrv::SubmitBuildRequest request = new gcrv::SubmitBuildRequest
{
    Parent = "",
    StorageSource = new gcrv::StorageSource(),
    ImageUri = "",
    BuildpackBuild = new gcrv::SubmitBuildRequest.Types.BuildpacksBuild(),
    ServiceAccount = "",
    WorkerPoolAsWorkerPoolName = gcrv::WorkerPoolName.FromProjectLocationWorkerPool("[PROJECT]", "[LOCATION]", "[WORKER_POOL]"),
    Tags = { "", },
};
// Make the request
gcrv::SubmitBuildResponse response = await buildsClient.SubmitBuildAsync(request);