Batch v1 API - Class BatchServiceClient (2.1.0)

public abstract class BatchServiceClient

Reference documentation and code samples for the Batch v1 API class BatchServiceClient.

BatchService client wrapper, for convenient use.

Inheritance

object > BatchServiceClient

Derived Types

Namespace

Google.Cloud.Batch.V1

Assembly

Google.Cloud.Batch.V1.dll

Remarks

Google Batch Service. The service manages user submitted batch jobs and allocates Google Compute Engine VM instances to run the jobs.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default BatchService scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

The default BatchService scopes are:

DeleteJobOperationsClient

public virtual OperationsClient DeleteJobOperationsClient { get; }

The long-running operations client for DeleteJob.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual BatchService.BatchServiceClient GrpcClient { get; }

The underlying gRPC BatchService client

Property Value
TypeDescription
BatchServiceBatchServiceClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
TypeDescription
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

Create()

public static BatchServiceClient Create()

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

Returns
TypeDescription
BatchServiceClient

The created BatchServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskBatchServiceClient

The task representing the created BatchServiceClient.

CreateJob(LocationName, Job, string, CallSettings)

public virtual Job CreateJob(LocationName parent, Job job, string jobId, CallSettings callSettings = null)

Create a Job.

Parameters
NameDescription
parentLocationName

Required. The parent resource name where the Job will be created. Pattern: "projects/{project}/locations/{location}"

jobJob

Required. The Job to create.

jobIdstring

ID used to uniquely identify the Job within its parent scope. This field should contain at most 63 characters and must start with lowercase characters. Only lowercase characters, numbers and '-' are accepted. The '-' character cannot be the first or the last one. A system generated ID will be used if the field is not set.

The job.name field in the request will be ignored and the created resource name of the Job will be "{parent}/jobs/{job_id}".

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Job

The RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = gcbv::BatchServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
gcbv::Job job = new gcbv::Job();
string jobId = "";
// Make the request
gcbv::Job response = batchServiceClient.CreateJob(parent, job, jobId);

CreateJob(CreateJobRequest, CallSettings)

public virtual Job CreateJob(CreateJobRequest request, CallSettings callSettings = null)

Create a Job.

Parameters
NameDescription
requestCreateJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Job

The RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = gcbv::BatchServiceClient.Create();
// Initialize request argument(s)
gcbv::CreateJobRequest request = new gcbv::CreateJobRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    JobId = "",
    Job = new gcbv::Job(),
    RequestId = "",
};
// Make the request
gcbv::Job response = batchServiceClient.CreateJob(request);

CreateJob(string, Job, string, CallSettings)

public virtual Job CreateJob(string parent, Job job, string jobId, CallSettings callSettings = null)

Create a Job.

Parameters
NameDescription
parentstring

Required. The parent resource name where the Job will be created. Pattern: "projects/{project}/locations/{location}"

jobJob

Required. The Job to create.

jobIdstring

ID used to uniquely identify the Job within its parent scope. This field should contain at most 63 characters and must start with lowercase characters. Only lowercase characters, numbers and '-' are accepted. The '-' character cannot be the first or the last one. A system generated ID will be used if the field is not set.

The job.name field in the request will be ignored and the created resource name of the Job will be "{parent}/jobs/{job_id}".

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Job

The RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = gcbv::BatchServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
gcbv::Job job = new gcbv::Job();
string jobId = "";
// Make the request
gcbv::Job response = batchServiceClient.CreateJob(parent, job, jobId);

CreateJobAsync(LocationName, Job, string, CallSettings)

public virtual Task<Job> CreateJobAsync(LocationName parent, Job job, string jobId, CallSettings callSettings = null)

Create a Job.

Parameters
NameDescription
parentLocationName

Required. The parent resource name where the Job will be created. Pattern: "projects/{project}/locations/{location}"

jobJob

Required. The Job to create.

jobIdstring

ID used to uniquely identify the Job within its parent scope. This field should contain at most 63 characters and must start with lowercase characters. Only lowercase characters, numbers and '-' are accepted. The '-' character cannot be the first or the last one. A system generated ID will be used if the field is not set.

The job.name field in the request will be ignored and the created resource name of the Job will be "{parent}/jobs/{job_id}".

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
gcbv::Job job = new gcbv::Job();
string jobId = "";
// Make the request
gcbv::Job response = await batchServiceClient.CreateJobAsync(parent, job, jobId);

CreateJobAsync(LocationName, Job, string, CancellationToken)

public virtual Task<Job> CreateJobAsync(LocationName parent, Job job, string jobId, CancellationToken cancellationToken)

Create a Job.

Parameters
NameDescription
parentLocationName

Required. The parent resource name where the Job will be created. Pattern: "projects/{project}/locations/{location}"

jobJob

Required. The Job to create.

jobIdstring

ID used to uniquely identify the Job within its parent scope. This field should contain at most 63 characters and must start with lowercase characters. Only lowercase characters, numbers and '-' are accepted. The '-' character cannot be the first or the last one. A system generated ID will be used if the field is not set.

The job.name field in the request will be ignored and the created resource name of the Job will be "{parent}/jobs/{job_id}".

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
gcbv::Job job = new gcbv::Job();
string jobId = "";
// Make the request
gcbv::Job response = await batchServiceClient.CreateJobAsync(parent, job, jobId);

CreateJobAsync(CreateJobRequest, CallSettings)

public virtual Task<Job> CreateJobAsync(CreateJobRequest request, CallSettings callSettings = null)

Create a Job.

Parameters
NameDescription
requestCreateJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
gcbv::CreateJobRequest request = new gcbv::CreateJobRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    JobId = "",
    Job = new gcbv::Job(),
    RequestId = "",
};
// Make the request
gcbv::Job response = await batchServiceClient.CreateJobAsync(request);

CreateJobAsync(CreateJobRequest, CancellationToken)

public virtual Task<Job> CreateJobAsync(CreateJobRequest request, CancellationToken cancellationToken)

Create a Job.

Parameters
NameDescription
requestCreateJobRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
gcbv::CreateJobRequest request = new gcbv::CreateJobRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    JobId = "",
    Job = new gcbv::Job(),
    RequestId = "",
};
// Make the request
gcbv::Job response = await batchServiceClient.CreateJobAsync(request);

CreateJobAsync(string, Job, string, CallSettings)

public virtual Task<Job> CreateJobAsync(string parent, Job job, string jobId, CallSettings callSettings = null)

Create a Job.

Parameters
NameDescription
parentstring

Required. The parent resource name where the Job will be created. Pattern: "projects/{project}/locations/{location}"

jobJob

Required. The Job to create.

jobIdstring

ID used to uniquely identify the Job within its parent scope. This field should contain at most 63 characters and must start with lowercase characters. Only lowercase characters, numbers and '-' are accepted. The '-' character cannot be the first or the last one. A system generated ID will be used if the field is not set.

The job.name field in the request will be ignored and the created resource name of the Job will be "{parent}/jobs/{job_id}".

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
gcbv::Job job = new gcbv::Job();
string jobId = "";
// Make the request
gcbv::Job response = await batchServiceClient.CreateJobAsync(parent, job, jobId);

CreateJobAsync(string, Job, string, CancellationToken)

public virtual Task<Job> CreateJobAsync(string parent, Job job, string jobId, CancellationToken cancellationToken)

Create a Job.

Parameters
NameDescription
parentstring

Required. The parent resource name where the Job will be created. Pattern: "projects/{project}/locations/{location}"

jobJob

Required. The Job to create.

jobIdstring

ID used to uniquely identify the Job within its parent scope. This field should contain at most 63 characters and must start with lowercase characters. Only lowercase characters, numbers and '-' are accepted. The '-' character cannot be the first or the last one. A system generated ID will be used if the field is not set.

The job.name field in the request will be ignored and the created resource name of the Job will be "{parent}/jobs/{job_id}".

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
gcbv::Job job = new gcbv::Job();
string jobId = "";
// Make the request
gcbv::Job response = await batchServiceClient.CreateJobAsync(parent, job, jobId);

DeleteJob(DeleteJobRequest, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeleteJob(DeleteJobRequest request, CallSettings callSettings = null)

Delete a Job.

Parameters
NameDescription
requestDeleteJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationEmptyOperationMetadata

The RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = gcbv::BatchServiceClient.Create();
// Initialize request argument(s)
gcbv::DeleteJobRequest request = new gcbv::DeleteJobRequest
{
    Name = "",
    Reason = "",
    RequestId = "",
};
// Make the request
Operation<Empty, gcbv::OperationMetadata> response = batchServiceClient.DeleteJob(request);

// Poll until the returned long-running operation is complete
Operation<Empty, gcbv::OperationMetadata> 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, gcbv::OperationMetadata> retrievedResponse = batchServiceClient.PollOnceDeleteJob(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;
}

DeleteJob(string, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeleteJob(string name, CallSettings callSettings = null)

Delete a Job.

Parameters
NameDescription
namestring

Job name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationEmptyOperationMetadata

The RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = gcbv::BatchServiceClient.Create();
// Initialize request argument(s)
string name = "";
// Make the request
Operation<Empty, gcbv::OperationMetadata> response = batchServiceClient.DeleteJob(name);

// Poll until the returned long-running operation is complete
Operation<Empty, gcbv::OperationMetadata> 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, gcbv::OperationMetadata> retrievedResponse = batchServiceClient.PollOnceDeleteJob(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;
}

DeleteJobAsync(DeleteJobRequest, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteJobAsync(DeleteJobRequest request, CallSettings callSettings = null)

Delete a Job.

Parameters
NameDescription
requestDeleteJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
gcbv::DeleteJobRequest request = new gcbv::DeleteJobRequest
{
    Name = "",
    Reason = "",
    RequestId = "",
};
// Make the request
Operation<Empty, gcbv::OperationMetadata> response = await batchServiceClient.DeleteJobAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, gcbv::OperationMetadata> 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, gcbv::OperationMetadata> retrievedResponse = await batchServiceClient.PollOnceDeleteJobAsync(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;
}

DeleteJobAsync(DeleteJobRequest, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteJobAsync(DeleteJobRequest request, CancellationToken cancellationToken)

Delete a Job.

Parameters
NameDescription
requestDeleteJobRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
gcbv::DeleteJobRequest request = new gcbv::DeleteJobRequest
{
    Name = "",
    Reason = "",
    RequestId = "",
};
// Make the request
Operation<Empty, gcbv::OperationMetadata> response = await batchServiceClient.DeleteJobAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, gcbv::OperationMetadata> 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, gcbv::OperationMetadata> retrievedResponse = await batchServiceClient.PollOnceDeleteJobAsync(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;
}

DeleteJobAsync(string, CallSettings)

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

Delete a Job.

Parameters
NameDescription
namestring

Job name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
Operation<Empty, gcbv::OperationMetadata> response = await batchServiceClient.DeleteJobAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, gcbv::OperationMetadata> 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, gcbv::OperationMetadata> retrievedResponse = await batchServiceClient.PollOnceDeleteJobAsync(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;
}

DeleteJobAsync(string, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteJobAsync(string name, CancellationToken cancellationToken)

Delete a Job.

Parameters
NameDescription
namestring

Job name.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
Operation<Empty, gcbv::OperationMetadata> response = await batchServiceClient.DeleteJobAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, gcbv::OperationMetadata> 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, gcbv::OperationMetadata> retrievedResponse = await batchServiceClient.PollOnceDeleteJobAsync(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;
}

GetJob(GetJobRequest, CallSettings)

public virtual Job GetJob(GetJobRequest request, CallSettings callSettings = null)

Get a Job specified by its resource name.

Parameters
NameDescription
requestGetJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Job

The RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = gcbv::BatchServiceClient.Create();
// Initialize request argument(s)
gcbv::GetJobRequest request = new gcbv::GetJobRequest
{
    JobName = gcbv::JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
gcbv::Job response = batchServiceClient.GetJob(request);

GetJob(JobName, CallSettings)

public virtual Job GetJob(JobName name, CallSettings callSettings = null)

Get a Job specified by its resource name.

Parameters
NameDescription
nameJobName

Required. Job name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Job

The RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = gcbv::BatchServiceClient.Create();
// Initialize request argument(s)
gcbv::JobName name = gcbv::JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
gcbv::Job response = batchServiceClient.GetJob(name);

GetJob(string, CallSettings)

public virtual Job GetJob(string name, CallSettings callSettings = null)

Get a Job specified by its resource name.

Parameters
NameDescription
namestring

Required. Job name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Job

The RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = gcbv::BatchServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
gcbv::Job response = batchServiceClient.GetJob(name);

GetJobAsync(GetJobRequest, CallSettings)

public virtual Task<Job> GetJobAsync(GetJobRequest request, CallSettings callSettings = null)

Get a Job specified by its resource name.

Parameters
NameDescription
requestGetJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
gcbv::GetJobRequest request = new gcbv::GetJobRequest
{
    JobName = gcbv::JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
gcbv::Job response = await batchServiceClient.GetJobAsync(request);

GetJobAsync(GetJobRequest, CancellationToken)

public virtual Task<Job> GetJobAsync(GetJobRequest request, CancellationToken cancellationToken)

Get a Job specified by its resource name.

Parameters
NameDescription
requestGetJobRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
gcbv::GetJobRequest request = new gcbv::GetJobRequest
{
    JobName = gcbv::JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
gcbv::Job response = await batchServiceClient.GetJobAsync(request);

GetJobAsync(JobName, CallSettings)

public virtual Task<Job> GetJobAsync(JobName name, CallSettings callSettings = null)

Get a Job specified by its resource name.

Parameters
NameDescription
nameJobName

Required. Job name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
gcbv::JobName name = gcbv::JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
gcbv::Job response = await batchServiceClient.GetJobAsync(name);

GetJobAsync(JobName, CancellationToken)

public virtual Task<Job> GetJobAsync(JobName name, CancellationToken cancellationToken)

Get a Job specified by its resource name.

Parameters
NameDescription
nameJobName

Required. Job name.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
gcbv::JobName name = gcbv::JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
gcbv::Job response = await batchServiceClient.GetJobAsync(name);

GetJobAsync(string, CallSettings)

public virtual Task<Job> GetJobAsync(string name, CallSettings callSettings = null)

Get a Job specified by its resource name.

Parameters
NameDescription
namestring

Required. Job name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
gcbv::Job response = await batchServiceClient.GetJobAsync(name);

GetJobAsync(string, CancellationToken)

public virtual Task<Job> GetJobAsync(string name, CancellationToken cancellationToken)

Get a Job specified by its resource name.

Parameters
NameDescription
namestring

Required. Job name.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
gcbv::Job response = await batchServiceClient.GetJobAsync(name);

GetTask(GetTaskRequest, CallSettings)

public virtual Task GetTask(GetTaskRequest request, CallSettings callSettings = null)

Return a single Task.

Parameters
NameDescription
requestGetTaskRequest

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

The RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = gcbv::BatchServiceClient.Create();
// Initialize request argument(s)
gcbv::GetTaskRequest request = new gcbv::GetTaskRequest
{
    TaskName = gcbv::TaskName.FromProjectLocationJobTaskGroupTask("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]", "[TASK]"),
};
// Make the request
gcbv::Task response = batchServiceClient.GetTask(request);

GetTask(TaskName, CallSettings)

public virtual Task GetTask(TaskName name, CallSettings callSettings = null)

Return a single Task.

Parameters
NameDescription
nameTaskName

Required. Task name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

The RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = gcbv::BatchServiceClient.Create();
// Initialize request argument(s)
gcbv::TaskName name = gcbv::TaskName.FromProjectLocationJobTaskGroupTask("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]", "[TASK]");
// Make the request
gcbv::Task response = batchServiceClient.GetTask(name);

GetTask(string, CallSettings)

public virtual Task GetTask(string name, CallSettings callSettings = null)

Return a single Task.

Parameters
NameDescription
namestring

Required. Task name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

The RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = gcbv::BatchServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]/taskGroups/[TASK_GROUP]/tasks/[TASK]";
// Make the request
gcbv::Task response = batchServiceClient.GetTask(name);

GetTaskAsync(GetTaskRequest, CallSettings)

public virtual Task<Task> GetTaskAsync(GetTaskRequest request, CallSettings callSettings = null)

Return a single Task.

Parameters
NameDescription
requestGetTaskRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
gcbv::GetTaskRequest request = new gcbv::GetTaskRequest
{
    TaskName = gcbv::TaskName.FromProjectLocationJobTaskGroupTask("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]", "[TASK]"),
};
// Make the request
gcbv::Task response = await batchServiceClient.GetTaskAsync(request);

GetTaskAsync(GetTaskRequest, CancellationToken)

public virtual Task<Task> GetTaskAsync(GetTaskRequest request, CancellationToken cancellationToken)

Return a single Task.

Parameters
NameDescription
requestGetTaskRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
gcbv::GetTaskRequest request = new gcbv::GetTaskRequest
{
    TaskName = gcbv::TaskName.FromProjectLocationJobTaskGroupTask("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]", "[TASK]"),
};
// Make the request
gcbv::Task response = await batchServiceClient.GetTaskAsync(request);

GetTaskAsync(TaskName, CallSettings)

public virtual Task<Task> GetTaskAsync(TaskName name, CallSettings callSettings = null)

Return a single Task.

Parameters
NameDescription
nameTaskName

Required. Task name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
gcbv::TaskName name = gcbv::TaskName.FromProjectLocationJobTaskGroupTask("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]", "[TASK]");
// Make the request
gcbv::Task response = await batchServiceClient.GetTaskAsync(name);

GetTaskAsync(TaskName, CancellationToken)

public virtual Task<Task> GetTaskAsync(TaskName name, CancellationToken cancellationToken)

Return a single Task.

Parameters
NameDescription
nameTaskName

Required. Task name.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
gcbv::TaskName name = gcbv::TaskName.FromProjectLocationJobTaskGroupTask("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]", "[TASK]");
// Make the request
gcbv::Task response = await batchServiceClient.GetTaskAsync(name);

GetTaskAsync(string, CallSettings)

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

Return a single Task.

Parameters
NameDescription
namestring

Required. Task name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]/taskGroups/[TASK_GROUP]/tasks/[TASK]";
// Make the request
gcbv::Task response = await batchServiceClient.GetTaskAsync(name);

GetTaskAsync(string, CancellationToken)

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

Return a single Task.

Parameters
NameDescription
namestring

Required. Task name.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTask

A Task containing the RPC response.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]/taskGroups/[TASK_GROUP]/tasks/[TASK]";
// Make the request
gcbv::Task response = await batchServiceClient.GetTaskAsync(name);

ListJobs(ListJobsRequest, CallSettings)

public virtual PagedEnumerable<ListJobsResponse, Job> ListJobs(ListJobsRequest request, CallSettings callSettings = null)

List all Jobs for a project within a region.

Parameters
NameDescription
requestListJobsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListJobsResponseJob

A pageable sequence of Job resources.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = gcbv::BatchServiceClient.Create();
// Initialize request argument(s)
gcbv::ListJobsRequest request = new gcbv::ListJobsRequest
{
    Parent = "",
    Filter = "",
};
// Make the request
PagedEnumerable<gcbv::ListJobsResponse, gcbv::Job> response = batchServiceClient.ListJobs(request);

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

ListJobs(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListJobsResponse, Job> ListJobs(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List all Jobs for a project within a region.

Parameters
NameDescription
parentstring

Parent path.

pageTokenstring

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

pageSizeint

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListJobsResponseJob

A pageable sequence of Job resources.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = gcbv::BatchServiceClient.Create();
// Initialize request argument(s)
string parent = "";
// Make the request
PagedEnumerable<gcbv::ListJobsResponse, gcbv::Job> response = batchServiceClient.ListJobs(parent);

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

ListJobsAsync(ListJobsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListJobsResponse, Job> ListJobsAsync(ListJobsRequest request, CallSettings callSettings = null)

List all Jobs for a project within a region.

Parameters
NameDescription
requestListJobsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListJobsResponseJob

A pageable asynchronous sequence of Job resources.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
gcbv::ListJobsRequest request = new gcbv::ListJobsRequest
{
    Parent = "",
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<gcbv::ListJobsResponse, gcbv::Job> response = batchServiceClient.ListJobsAsync(request);

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

ListJobsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListJobsResponse, Job> ListJobsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List all Jobs for a project within a region.

Parameters
NameDescription
parentstring

Parent path.

pageTokenstring

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

pageSizeint

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListJobsResponseJob

A pageable asynchronous sequence of Job resources.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "";
// Make the request
PagedAsyncEnumerable<gcbv::ListJobsResponse, gcbv::Job> response = batchServiceClient.ListJobsAsync(parent);

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

ListTasks(ListTasksRequest, CallSettings)

public virtual PagedEnumerable<ListTasksResponse, Task> ListTasks(ListTasksRequest request, CallSettings callSettings = null)

List Tasks associated with a job.

Parameters
NameDescription
requestListTasksRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListTasksResponseTask

A pageable sequence of Task resources.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = gcbv::BatchServiceClient.Create();
// Initialize request argument(s)
gcbv::ListTasksRequest request = new gcbv::ListTasksRequest
{
    ParentAsTaskGroupName = gcbv::TaskGroupName.FromProjectLocationJobTaskGroup("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]"),
    Filter = "",
};
// Make the request
PagedEnumerable<gcbv::ListTasksResponse, gcbv::Task> response = batchServiceClient.ListTasks(request);

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

ListTasks(TaskGroupName, string, int?, CallSettings)

public virtual PagedEnumerable<ListTasksResponse, Task> ListTasks(TaskGroupName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List Tasks associated with a job.

Parameters
NameDescription
parentTaskGroupName

Required. Name of a TaskGroup from which Tasks are being requested. Pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"

pageTokenstring

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

pageSizeint

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListTasksResponseTask

A pageable sequence of Task resources.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = gcbv::BatchServiceClient.Create();
// Initialize request argument(s)
gcbv::TaskGroupName parent = gcbv::TaskGroupName.FromProjectLocationJobTaskGroup("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]");
// Make the request
PagedEnumerable<gcbv::ListTasksResponse, gcbv::Task> response = batchServiceClient.ListTasks(parent);

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

ListTasks(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListTasksResponse, Task> ListTasks(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List Tasks associated with a job.

Parameters
NameDescription
parentstring

Required. Name of a TaskGroup from which Tasks are being requested. Pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"

pageTokenstring

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

pageSizeint

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListTasksResponseTask

A pageable sequence of Task resources.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = gcbv::BatchServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]/taskGroups/[TASK_GROUP]";
// Make the request
PagedEnumerable<gcbv::ListTasksResponse, gcbv::Task> response = batchServiceClient.ListTasks(parent);

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

ListTasksAsync(ListTasksRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListTasksResponse, Task> ListTasksAsync(ListTasksRequest request, CallSettings callSettings = null)

List Tasks associated with a job.

Parameters
NameDescription
requestListTasksRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListTasksResponseTask

A pageable asynchronous sequence of Task resources.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
gcbv::ListTasksRequest request = new gcbv::ListTasksRequest
{
    ParentAsTaskGroupName = gcbv::TaskGroupName.FromProjectLocationJobTaskGroup("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<gcbv::ListTasksResponse, gcbv::Task> response = batchServiceClient.ListTasksAsync(request);

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

ListTasksAsync(TaskGroupName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListTasksResponse, Task> ListTasksAsync(TaskGroupName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List Tasks associated with a job.

Parameters
NameDescription
parentTaskGroupName

Required. Name of a TaskGroup from which Tasks are being requested. Pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"

pageTokenstring

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

pageSizeint

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListTasksResponseTask

A pageable asynchronous sequence of Task resources.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
gcbv::TaskGroupName parent = gcbv::TaskGroupName.FromProjectLocationJobTaskGroup("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]");
// Make the request
PagedAsyncEnumerable<gcbv::ListTasksResponse, gcbv::Task> response = batchServiceClient.ListTasksAsync(parent);

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

ListTasksAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListTasksResponse, Task> ListTasksAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List Tasks associated with a job.

Parameters
NameDescription
parentstring

Required. Name of a TaskGroup from which Tasks are being requested. Pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"

pageTokenstring

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

pageSizeint

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListTasksResponseTask

A pageable asynchronous sequence of Task resources.

Example
// Create client
gcbv::BatchServiceClient batchServiceClient = await gcbv::BatchServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]/taskGroups/[TASK_GROUP]";
// Make the request
PagedAsyncEnumerable<gcbv::ListTasksResponse, gcbv::Task> response = batchServiceClient.ListTasksAsync(parent);

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

PollOnceDeleteJob(string, CallSettings)

public virtual Operation<Empty, OperationMetadata> PollOnceDeleteJob(string operationName, CallSettings callSettings = null)

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

Parameters
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationEmptyOperationMetadata

The result of polling the operation.

PollOnceDeleteJobAsync(string, CallSettings)

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

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

Parameters
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationEmptyOperationMetadata

A task representing the result of polling the operation.

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

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

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

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