# Batch V1 API - Class Google::Cloud::Batch::V1::BatchService::Rest::Client (v1.7.0)

1.7.0 (latest) 1.6.0 1.5.0 1.4.1 1.3.0 1.2.0 1.1.1 1.0.0 0.21.0 0.20.1 0.19.2 0.18.3 0.17.4 0.16.2 0.15.1 0.14.0 0.13.1 0.12.0 0.11.1 0.10.5 0.9.0 0.8.0 0.7.0 0.6.0 0.5.0 0.4.3 0.3.0 0.2.0 0.1.0 Reference documentation and code samples for the Batch V1 API class Google::Cloud::Batch::V1::BatchService::Rest::Client.

REST client for the BatchService service.


<br />

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

## Inherits

- Object

## Includes

- [Google::Cloud::Batch::V1::BatchService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-BatchService-Paths)

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the BatchService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-BatchService-Rest-Client-Configuration "Google::Cloud::Batch::V1::BatchService::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-BatchService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-BatchService-Rest-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all BatchService clients
::Google::Cloud::Batch::V1::BatchService::Rest::Client.configure do |config|
  config.timeout = 10.0
end
```

### #cancel_job

    def cancel_job(request, options = nil) -> ::Gapic::Operation
    def cancel_job(name: nil, request_id: nil) -> ::Gapic::Operation

Cancel a Job.
**Overloads**

    def cancel_job(request, options = nil) -> ::Gapic::Operation

Pass arguments to `cancel_job` via a request object, either of type [CancelJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-CancelJobRequest "Google::Cloud::Batch::V1::CancelJobRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Batch::V1::CancelJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-CancelJobRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def cancel_job(name: nil, request_id: nil) -> ::Gapic::Operation

Pass arguments to `cancel_job` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. Job name.
- **request_id** (::String) --- Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.


  For example, consider a situation where you make an initial request and
  the request times out. If you make the request again with the same request
  ID, the server can check if original operation with the same request ID
  was received, and if so, will ignore the second request. This prevents
  clients from accidentally creating duplicate commitments.

  The request ID must be a valid UUID with the exception that zero UUID is
  not supported (00000000-0000-0000-0000-000000000000).
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/batch/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Batch::V1::CancelJobRequest.new

# Call the cancel_job method.
result = client.cancel_job request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the BatchService Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-BatchService-Rest-Client#Google__Cloud__Batch__V1__BatchService__Rest__Client_configure_class_ "Google::Cloud::Batch::V1::BatchService::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-BatchService-Rest-Client-Configuration "Google::Cloud::Batch::V1::BatchService::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-BatchService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-BatchService-Rest-Client-Configuration))

### #create_job

    def create_job(request, options = nil) -> ::Google::Cloud::Batch::V1::Job
    def create_job(parent: nil, job_id: nil, job: nil, request_id: nil) -> ::Google::Cloud::Batch::V1::Job

Create a Job.
**Overloads**

    def create_job(request, options = nil) -> ::Google::Cloud::Batch::V1::Job

Pass arguments to `create_job` via a request object, either of type [CreateJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-CreateJobRequest "Google::Cloud::Batch::V1::CreateJobRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Batch::V1::CreateJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-CreateJobRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def create_job(parent: nil, job_id: nil, job: nil, request_id: nil) -> ::Google::Cloud::Batch::V1::Job

Pass arguments to `create_job` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The parent resource name where the Job will be created. Pattern: "projects/{project}/locations/{location}"
- **job_id** (::String) --- 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}".
- **job** ([::Google::Cloud::Batch::V1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-Job), ::Hash) --- Required. The Job to create.
- **request_id** (::String) --- Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.


  For example, consider a situation where you make an initial request and
  the request times out. If you make the request again with the same request
  ID, the server can check if original operation with the same request ID
  was received, and if so, will ignore the second request. This prevents
  clients from accidentally creating duplicate commitments.

  The request ID must be a valid UUID with the exception that zero UUID is
  not supported (00000000-0000-0000-0000-000000000000).
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::Batch::V1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-Job))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Batch::V1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-Job))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/batch/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Batch::V1::CreateJobRequest.new

# Call the create_job method.
result = client.create_job request

# The returned object is of type Google::Cloud::Batch::V1::Job.
p result
```

### #delete_job

    def delete_job(request, options = nil) -> ::Gapic::Operation
    def delete_job(name: nil, reason: nil, request_id: nil) -> ::Gapic::Operation

Delete a Job.
**Overloads**

    def delete_job(request, options = nil) -> ::Gapic::Operation

Pass arguments to `delete_job` via a request object, either of type [DeleteJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-DeleteJobRequest "Google::Cloud::Batch::V1::DeleteJobRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Batch::V1::DeleteJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-DeleteJobRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def delete_job(name: nil, reason: nil, request_id: nil) -> ::Gapic::Operation

Pass arguments to `delete_job` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Job name.
- **reason** (::String) --- Optional. Reason for this deletion.
- **request_id** (::String) --- Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.


  For example, consider a situation where you make an initial request and
  the request times out. If you make the request again with the same request
  ID, the server can check if original operation with the same request ID
  was received, and if so, will ignore the second request. This prevents
  clients from accidentally creating duplicate commitments.

  The request ID must be a valid UUID with the exception that zero UUID is
  not supported (00000000-0000-0000-0000-000000000000).
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/batch/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Batch::V1::DeleteJobRequest.new

# Call the delete_job method.
result = client.delete_job request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #get_job

    def get_job(request, options = nil) -> ::Google::Cloud::Batch::V1::Job
    def get_job(name: nil) -> ::Google::Cloud::Batch::V1::Job

Get a Job specified by its resource name.
**Overloads**

    def get_job(request, options = nil) -> ::Google::Cloud::Batch::V1::Job

Pass arguments to `get_job` via a request object, either of type [GetJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-GetJobRequest "Google::Cloud::Batch::V1::GetJobRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Batch::V1::GetJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-GetJobRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_job(name: nil) -> ::Google::Cloud::Batch::V1::Job

Pass arguments to `get_job` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. Job name.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::Batch::V1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-Job))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Batch::V1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-Job))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/batch/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Batch::V1::GetJobRequest.new

# Call the get_job method.
result = client.get_job request

# The returned object is of type Google::Cloud::Batch::V1::Job.
p result
```

### #get_task

    def get_task(request, options = nil) -> ::Google::Cloud::Batch::V1::Task
    def get_task(name: nil) -> ::Google::Cloud::Batch::V1::Task

Return a single Task.
**Overloads**

    def get_task(request, options = nil) -> ::Google::Cloud::Batch::V1::Task

Pass arguments to `get_task` via a request object, either of type [GetTaskRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-GetTaskRequest "Google::Cloud::Batch::V1::GetTaskRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Batch::V1::GetTaskRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-GetTaskRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_task(name: nil) -> ::Google::Cloud::Batch::V1::Task

Pass arguments to `get_task` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. Task name.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::Batch::V1::Task](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-Task))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Batch::V1::Task](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-Task))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/batch/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Batch::V1::GetTaskRequest.new

# Call the get_task method.
result = client.get_task request

# The returned object is of type Google::Cloud::Batch::V1::Task.
p result
```

### #initialize

    def initialize() { |config| ... } -> Client

Create a new BatchService REST client object.
**Yields**

- (config) --- Configure the BatchService client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-BatchService-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-BatchService-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_jobs

    def list_jobs(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Batch::V1::Job>
    def list_jobs(parent: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Batch::V1::Job>

List all Jobs for a project within a region.
**Overloads**

    def list_jobs(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Batch::V1::Job>

Pass arguments to `list_jobs` via a request object, either of type [ListJobsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-ListJobsRequest "Google::Cloud::Batch::V1::ListJobsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Batch::V1::ListJobsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-ListJobsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def list_jobs(parent: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Batch::V1::Job>

Pass arguments to `list_jobs` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Parent path.
- **filter** (::String) --- List filter.
- **order_by** (::String) --- Optional. Sort results. Supported are "name", "name desc", "create_time", and "create_time desc".
- **page_size** (::Integer) --- Page size.
- **page_token** (::String) --- Page token.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Batch::V1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-Job)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Batch::V1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-Job)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/batch/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Batch::V1::ListJobsRequest.new

# Call the list_jobs method.
result = client.list_jobs request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Batch::V1::Job.
  p item
end
```

### #list_tasks

    def list_tasks(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Batch::V1::Task>
    def list_tasks(parent: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Batch::V1::Task>

List Tasks associated with a job.
**Overloads**

    def list_tasks(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Batch::V1::Task>

Pass arguments to `list_tasks` via a request object, either of type [ListTasksRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-ListTasksRequest "Google::Cloud::Batch::V1::ListTasksRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Batch::V1::ListTasksRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-ListTasksRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def list_tasks(parent: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Batch::V1::Task>

Pass arguments to `list_tasks` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. Name of a TaskGroup from which Tasks are being requested. Pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}"
- **filter** (::String) --- Task filter, null filter matches all Tasks. Filter string should be of the format State=TaskStatus.State e.g. State=RUNNING
- **page_size** (::Integer) --- Page size.
- **page_token** (::String) --- Page token.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Batch::V1::Task](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-Task)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Batch::V1::Task](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-Task)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/batch/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Batch::V1::ListTasksRequest.new

# Call the list_tasks method.
result = client.list_tasks request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Batch::V1::Task.
  p item
end
```

### #location_client

    def location_client() -> Google::Cloud::Location::Locations::Rest::Client

Get the associated client for mix-in of the Locations.
**Returns**

- (Google::Cloud::Location::Locations::Rest::Client)

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #operations_client

    def operations_client() -> ::Google::Cloud::Batch::V1::BatchService::Rest::Operations

Get the associated client for long-running operations.
**Returns**

- ([::Google::Cloud::Batch::V1::BatchService::Rest::Operations](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-BatchService-Rest-Operations))

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)