Batch v1 API - Class BatchServiceClient (1.0.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
IReadOnlyList<String>
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
BatchService.BatchServiceClient

IAMPolicyClient

public virtual IAMPolicyClient IAMPolicyClient { get; }

The IAMPolicyClient associated with this client.

Property Value
TypeDescription
IAMPolicyClient

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(CancellationToken))

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

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. Only alphanumeric characters or '-' 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
BatchServiceClient batchServiceClient = BatchServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Job job = new Job();
string jobId = "";
// Make the request
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
BatchServiceClient batchServiceClient = BatchServiceClient.Create();
// Initialize request argument(s)
CreateJobRequest request = new CreateJobRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    JobId = "",
    Job = new Job(),
    RequestId = "",
};
// Make the request
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. Only alphanumeric characters or '-' 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
BatchServiceClient batchServiceClient = BatchServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Job job = new Job();
string jobId = "";
// Make the request
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. Only alphanumeric characters or '-' 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
Task<Job>

A Task containing the RPC response.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Job job = new Job();
string jobId = "";
// Make the request
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. Only alphanumeric characters or '-' 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
Task<Job>

A Task containing the RPC response.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Job job = new Job();
string jobId = "";
// Make the request
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
Task<Job>

A Task containing the RPC response.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
CreateJobRequest request = new CreateJobRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    JobId = "",
    Job = new Job(),
    RequestId = "",
};
// Make the request
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
Task<Job>

A Task containing the RPC response.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
CreateJobRequest request = new CreateJobRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    JobId = "",
    Job = new Job(),
    RequestId = "",
};
// Make the request
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. Only alphanumeric characters or '-' 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
Task<Job>

A Task containing the RPC response.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Job job = new Job();
string jobId = "";
// Make the request
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. Only alphanumeric characters or '-' 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
Task<Job>

A Task containing the RPC response.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Job job = new Job();
string jobId = "";
// Make the request
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
Operation<Empty, OperationMetadata>

The RPC response.

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

// Poll until the returned long-running operation is complete
Operation<Empty, 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, 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
Operation<Empty, OperationMetadata>

The RPC response.

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

// Poll until the returned long-running operation is complete
Operation<Empty, 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, 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
Task<Operation<Empty, OperationMetadata>>

A Task containing the RPC response.

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

// Poll until the returned long-running operation is complete
Operation<Empty, 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, 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
Task<Operation<Empty, OperationMetadata>>

A Task containing the RPC response.

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

// Poll until the returned long-running operation is complete
Operation<Empty, 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, 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
Task<Operation<Empty, OperationMetadata>>

A Task containing the RPC response.

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

// Poll until the returned long-running operation is complete
Operation<Empty, 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, 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
Task<Operation<Empty, OperationMetadata>>

A Task containing the RPC response.

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

// Poll until the returned long-running operation is complete
Operation<Empty, 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, 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
BatchServiceClient batchServiceClient = BatchServiceClient.Create();
// Initialize request argument(s)
GetJobRequest request = new GetJobRequest
{
    JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
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
BatchServiceClient batchServiceClient = BatchServiceClient.Create();
// Initialize request argument(s)
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
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
BatchServiceClient batchServiceClient = BatchServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
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
Task<Job>

A Task containing the RPC response.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
GetJobRequest request = new GetJobRequest
{
    JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
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
Task<Job>

A Task containing the RPC response.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
GetJobRequest request = new GetJobRequest
{
    JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
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
Task<Job>

A Task containing the RPC response.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
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
Task<Job>

A Task containing the RPC response.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
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
Task<Job>

A Task containing the RPC response.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
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
Task<Job>

A Task containing the RPC response.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
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
BatchServiceClient batchServiceClient = BatchServiceClient.Create();
// Initialize request argument(s)
GetTaskRequest request = new GetTaskRequest
{
    TaskName = 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
BatchServiceClient batchServiceClient = BatchServiceClient.Create();
// Initialize request argument(s)
TaskName name = 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
BatchServiceClient batchServiceClient = 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
Task<Task>

A Task containing the RPC response.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
GetTaskRequest request = new GetTaskRequest
{
    TaskName = 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
Task<Task>

A Task containing the RPC response.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
GetTaskRequest request = new GetTaskRequest
{
    TaskName = 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
Task<Task>

A Task containing the RPC response.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
TaskName name = 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
Task<Task>

A Task containing the RPC response.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
TaskName name = 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
Task<Task>

A Task containing the RPC response.

Example
// Create client
BatchServiceClient batchServiceClient = await 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
Task<Task>

A Task containing the RPC response.

Example
// Create client
BatchServiceClient batchServiceClient = await 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
PagedEnumerable<ListJobsResponse, Job>

A pageable sequence of Job resources.

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

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

pageSizeNullable<Int32>

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListJobsResponse, Job>

A pageable sequence of Job resources.

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

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

A pageable asynchronous sequence of Job resources.

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

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

pageSizeNullable<Int32>

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListJobsResponse, Job>

A pageable asynchronous sequence of Job resources.

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

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

A pageable sequence of Task resources.

Example
// Create client
BatchServiceClient batchServiceClient = BatchServiceClient.Create();
// Initialize request argument(s)
ListTasksRequest request = new ListTasksRequest
{
    ParentAsTaskGroupName = TaskGroupName.FromProjectLocationJobTaskGroup("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]"),
    Filter = "",
};
// Make the request
PagedEnumerable<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 (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, Nullable<Int32>, 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.

pageSizeNullable<Int32>

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListTasksResponse, Task>

A pageable sequence of Task resources.

Example
// Create client
BatchServiceClient batchServiceClient = BatchServiceClient.Create();
// Initialize request argument(s)
TaskGroupName parent = TaskGroupName.FromProjectLocationJobTaskGroup("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]");
// Make the request
PagedEnumerable<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 (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, Nullable<Int32>, 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.

pageSizeNullable<Int32>

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListTasksResponse, Task>

A pageable sequence of Task resources.

Example
// Create client
BatchServiceClient batchServiceClient = BatchServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]/taskGroups/[TASK_GROUP]";
// Make the request
PagedEnumerable<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 (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
PagedAsyncEnumerable<ListTasksResponse, Task>

A pageable asynchronous sequence of Task resources.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
ListTasksRequest request = new ListTasksRequest
{
    ParentAsTaskGroupName = TaskGroupName.FromProjectLocationJobTaskGroup("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<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((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, Nullable<Int32>, 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.

pageSizeNullable<Int32>

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListTasksResponse, Task>

A pageable asynchronous sequence of Task resources.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
TaskGroupName parent = TaskGroupName.FromProjectLocationJobTaskGroup("[PROJECT]", "[LOCATION]", "[JOB]", "[TASK_GROUP]");
// Make the request
PagedAsyncEnumerable<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((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, Nullable<Int32>, 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.

pageSizeNullable<Int32>

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListTasksResponse, Task>

A pageable asynchronous sequence of Task resources.

Example
// Create client
BatchServiceClient batchServiceClient = await BatchServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]/taskGroups/[TASK_GROUP]";
// Make the request
PagedAsyncEnumerable<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((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
Operation<Empty, OperationMetadata>

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
Task<Operation<Empty, OperationMetadata>>

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.