# Cloud Scheduler V1beta1 API - Class Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client (v0.18.0)

0.18.0 (latest) 0.17.1 0.16.0 0.15.1 0.14.0 0.13.1 0.12.0 0.11.1 0.10.2 0.9.1 0.8.1 0.7.0 0.6.0 0.5.0 0.4.5 Reference documentation and code samples for the Cloud Scheduler V1beta1 API class Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.

Client for the CloudScheduler service.


<br />

The Cloud Scheduler API allows external entities to reliably
schedule asynchronous jobs.

## Inherits

- Object

## Includes

- [Google::Cloud::Scheduler::V1beta1::CloudScheduler::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-CloudScheduler-Paths)

## Methods

### .configure

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

Configure the CloudScheduler Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-CloudScheduler-Client-Configuration "Google::Cloud::Scheduler::V1beta1::CloudScheduler::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-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-CloudScheduler-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-CloudScheduler-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all CloudScheduler clients
::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

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

Configure the CloudScheduler 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-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-CloudScheduler-Client#Google__Cloud__Scheduler__V1beta1__CloudScheduler__Client_configure_class_ "Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-CloudScheduler-Client-Configuration "Google::Cloud::Scheduler::V1beta1::CloudScheduler::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-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-CloudScheduler-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-CloudScheduler-Client-Configuration))

### #create_job

    def create_job(request, options = nil) -> ::Google::Cloud::Scheduler::V1beta1::Job
    def create_job(parent: nil, job: nil) -> ::Google::Cloud::Scheduler::V1beta1::Job

Creates a job.
**Overloads**

    def create_job(request, options = nil) -> ::Google::Cloud::Scheduler::V1beta1::Job

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

- **request** ([::Google::Cloud::Scheduler::V1beta1::CreateJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-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: nil) -> ::Google::Cloud::Scheduler::V1beta1::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 location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`.
- **job** ([::Google::Cloud::Scheduler::V1beta1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job), ::Hash) --- Required. The job to add. The user can optionally specify a name for the job in [name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job#Google__Cloud__Scheduler__V1beta1__Job_name_instance_ "Google::Cloud::Scheduler::V1beta1::Job#name (method)"). [name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job#Google__Cloud__Scheduler__V1beta1__Job_name_instance_ "Google::Cloud::Scheduler::V1beta1::Job#name (method)") cannot be the same as an existing job. If a name is not specified then the system will generate a random unique name that will be returned ([name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job#Google__Cloud__Scheduler__V1beta1__Job_name_instance_ "Google::Cloud::Scheduler::V1beta1::Job#name (method)")) in the response.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Scheduler::V1beta1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Scheduler::V1beta1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job))
**Raises**

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

Basic example

```ruby
require "google/cloud/scheduler/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new

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

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

# The returned object is of type Google::Cloud::Scheduler::V1beta1::Job.
p result
```

### #delete_job

    def delete_job(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_job(name: nil, legacy_app_engine_cron: nil) -> ::Google::Protobuf::Empty

Deletes a job.
**Overloads**

    def delete_job(request, options = nil) -> ::Google::Protobuf::Empty

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

- **request** ([::Google::Cloud::Scheduler::V1beta1::DeleteJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-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, legacy_app_engine_cron: nil) -> ::Google::Protobuf::Empty

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) --- Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
- **legacy_app_engine_cron** (::Boolean) --- This field is used to manage the legacy App Engine Cron jobs using the Cloud Scheduler API. If the field is set to true, the job in the __cron queue with the corresponding name will be deleted instead.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Protobuf-Empty))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Protobuf-Empty))
**Raises**

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

Basic example

```ruby
require "google/cloud/scheduler/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new

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

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

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #get_job

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

Gets a job.
**Overloads**

    def get_job(request, options = nil) -> ::Google::Cloud::Scheduler::V1beta1::Job

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

- **request** ([::Google::Cloud::Scheduler::V1beta1::GetJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-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::Scheduler::V1beta1::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. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Scheduler::V1beta1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Scheduler::V1beta1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job))
**Raises**

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

Basic example

```ruby
require "google/cloud/scheduler/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new

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

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

# The returned object is of type Google::Cloud::Scheduler::V1beta1::Job.
p result
```

### #initialize

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

Create a new CloudScheduler client object.
**Yields**

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

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-CloudScheduler-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-CloudScheduler-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_jobs

    def list_jobs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Scheduler::V1beta1::Job>
    def list_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, legacy_app_engine_cron: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Scheduler::V1beta1::Job>

Lists jobs.
**Overloads**

    def list_jobs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Scheduler::V1beta1::Job>

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

- **request** ([::Google::Cloud::Scheduler::V1beta1::ListJobsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-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, page_size: nil, page_token: nil, legacy_app_engine_cron: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Scheduler::V1beta1::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) --- Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`.
- **filter** (::String) --- `filter` can be used to specify a subset of jobs.


  If `filter` equals `target_config="HttpConfig"`, then the http
  target jobs are retrieved. If `filter` equals
  `target_config="PubSubConfig"`, then the Pub/Sub target jobs are
  retrieved. If `filter` equals `labels.foo=value1
  labels.foo=value2` then only jobs which are labeled with
  foo=value1 AND foo=value2 will be returned.
- **page_size** (::Integer) --- Requested page size.


  The maximum page size is 500. If unspecified, the page size will
  be the maximum. Fewer jobs than requested might be returned,
  even if more jobs exist; use next_page_token to determine if more
  jobs exist.
- **page_token** (::String) --- A token identifying a page of results the server will return. To request the first page results, page_token must be empty. To request the next page of results, page_token must be the value of [next_page_token](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-ListJobsResponse#Google__Cloud__Scheduler__V1beta1__ListJobsResponse_next_page_token_instance_ "Google::Cloud::Scheduler::V1beta1::ListJobsResponse#next_page_token (method)") returned from the previous call to [ListJobs](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-CloudScheduler-Client#Google__Cloud__Scheduler__V1beta1__CloudScheduler__Client_list_jobs_instance_ "Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs (method)"). It is an error to switch the value of [filter](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-ListJobsRequest#Google__Cloud__Scheduler__V1beta1__ListJobsRequest_filter_instance_ "Google::Cloud::Scheduler::V1beta1::ListJobsRequest#filter (method)") or \[order_by\]\[google.cloud.scheduler.v1beta1.ListJobsRequest.order_by\] while iterating through pages.
- **legacy_app_engine_cron** (::Boolean) --- This field is used to manage the legacy App Engine Cron jobs using the Cloud Scheduler API. If the field is set to true, the jobs in the __cron queue will be listed instead.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Google::Cloud::Scheduler::V1beta1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Google::Cloud::Scheduler::V1beta1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job)\>)
**Raises**

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

Basic example

```ruby
require "google/cloud/scheduler/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Scheduler::V1beta1::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::Scheduler::V1beta1::Job.
  p item
end
```

### #location_client

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

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

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

### #logger

    def logger() -> Logger

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

- (Logger)

### #pause_job

    def pause_job(request, options = nil) -> ::Google::Cloud::Scheduler::V1beta1::Job
    def pause_job(name: nil) -> ::Google::Cloud::Scheduler::V1beta1::Job

Pauses a job.


<br />

If a job is paused then the system will stop executing the job
until it is re-enabled via
[ResumeJob](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-CloudScheduler-Client#Google__Cloud__Scheduler__V1beta1__CloudScheduler__Client_resume_job_instance_ "Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#resume_job (method)"). The
state of the job is stored in
[state](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job#Google__Cloud__Scheduler__V1beta1__Job_state_instance_ "Google::Cloud::Scheduler::V1beta1::Job#state (method)"); if paused it will be set
to [Job.State.PAUSED](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job-State#Google__Cloud__Scheduler__V1beta1__Job__State__PAUSED "Google::Cloud::Scheduler::V1beta1::Job::State::PAUSED (constant)"). A
job must be in
[Job.State.ENABLED](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job-State#Google__Cloud__Scheduler__V1beta1__Job__State__ENABLED "Google::Cloud::Scheduler::V1beta1::Job::State::ENABLED (constant)") to be
paused.
**Overloads**

    def pause_job(request, options = nil) -> ::Google::Cloud::Scheduler::V1beta1::Job

Pass arguments to `pause_job` via a request object, either of type [PauseJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-PauseJobRequest "Google::Cloud::Scheduler::V1beta1::PauseJobRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Scheduler::V1beta1::PauseJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-PauseJobRequest), ::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 pause_job(name: nil) -> ::Google::Cloud::Scheduler::V1beta1::Job

Pass arguments to `pause_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. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Scheduler::V1beta1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Scheduler::V1beta1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job))
**Raises**

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

Basic example

```ruby
require "google/cloud/scheduler/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Scheduler::V1beta1::PauseJobRequest.new

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

# The returned object is of type Google::Cloud::Scheduler::V1beta1::Job.
p result
```

### #resume_job

    def resume_job(request, options = nil) -> ::Google::Cloud::Scheduler::V1beta1::Job
    def resume_job(name: nil) -> ::Google::Cloud::Scheduler::V1beta1::Job

Resume a job.


<br />

This method reenables a job after it has been
[Job.State.PAUSED](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job-State#Google__Cloud__Scheduler__V1beta1__Job__State__PAUSED "Google::Cloud::Scheduler::V1beta1::Job::State::PAUSED (constant)"). The
state of a job is stored in
[Job.state](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job#Google__Cloud__Scheduler__V1beta1__Job_state_instance_ "Google::Cloud::Scheduler::V1beta1::Job#state (method)"); after calling this
method it will be set to
[Job.State.ENABLED](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job-State#Google__Cloud__Scheduler__V1beta1__Job__State__ENABLED "Google::Cloud::Scheduler::V1beta1::Job::State::ENABLED (constant)"). A
job must be in
[Job.State.PAUSED](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job-State#Google__Cloud__Scheduler__V1beta1__Job__State__PAUSED "Google::Cloud::Scheduler::V1beta1::Job::State::PAUSED (constant)") to be
resumed.
**Overloads**

    def resume_job(request, options = nil) -> ::Google::Cloud::Scheduler::V1beta1::Job

Pass arguments to `resume_job` via a request object, either of type [ResumeJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-ResumeJobRequest "Google::Cloud::Scheduler::V1beta1::ResumeJobRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Scheduler::V1beta1::ResumeJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-ResumeJobRequest), ::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 resume_job(name: nil) -> ::Google::Cloud::Scheduler::V1beta1::Job

Pass arguments to `resume_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. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Scheduler::V1beta1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Scheduler::V1beta1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job))
**Raises**

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

Basic example

```ruby
require "google/cloud/scheduler/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Scheduler::V1beta1::ResumeJobRequest.new

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

# The returned object is of type Google::Cloud::Scheduler::V1beta1::Job.
p result
```

### #run_job

    def run_job(request, options = nil) -> ::Google::Cloud::Scheduler::V1beta1::Job
    def run_job(name: nil, legacy_app_engine_cron: nil) -> ::Google::Cloud::Scheduler::V1beta1::Job

Forces a job to run now.


<br />

When this method is called, Cloud Scheduler will dispatch the job, even
if the job is already running.
**Overloads**

    def run_job(request, options = nil) -> ::Google::Cloud::Scheduler::V1beta1::Job

Pass arguments to `run_job` via a request object, either of type [RunJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-RunJobRequest "Google::Cloud::Scheduler::V1beta1::RunJobRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Scheduler::V1beta1::RunJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-RunJobRequest), ::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 run_job(name: nil, legacy_app_engine_cron: nil) -> ::Google::Cloud::Scheduler::V1beta1::Job

Pass arguments to `run_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. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
- **legacy_app_engine_cron** (::Boolean) --- This field is used to manage the legacy App Engine Cron jobs using the Cloud Scheduler API. If the field is set to true, the job in the __cron queue with the corresponding name will be forced to run instead.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Scheduler::V1beta1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Scheduler::V1beta1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job))
**Raises**

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

Basic example

```ruby
require "google/cloud/scheduler/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Scheduler::V1beta1::RunJobRequest.new

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

# The returned object is of type Google::Cloud::Scheduler::V1beta1::Job.
p result
```

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_job

    def update_job(request, options = nil) -> ::Google::Cloud::Scheduler::V1beta1::Job
    def update_job(job: nil, update_mask: nil) -> ::Google::Cloud::Scheduler::V1beta1::Job

Updates a job.


If successful, the updated [Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job "Google::Cloud::Scheduler::V1beta1::Job (class)") is
returned. If the job does not exist, `NOT_FOUND` is returned.

<br />

If UpdateJob does not successfully return, it is possible for the
job to be in an
[Job.State.UPDATE_FAILED](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job-State#Google__Cloud__Scheduler__V1beta1__Job__State__UPDATE_FAILED "Google::Cloud::Scheduler::V1beta1::Job::State::UPDATE_FAILED (constant)")
state. A job in this state may not be executed. If this happens, retry the
UpdateJob request until a successful response is received.
**Overloads**

    def update_job(request, options = nil) -> ::Google::Cloud::Scheduler::V1beta1::Job

Pass arguments to `update_job` via a request object, either of type [UpdateJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-UpdateJobRequest "Google::Cloud::Scheduler::V1beta1::UpdateJobRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Scheduler::V1beta1::UpdateJobRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-UpdateJobRequest), ::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 update_job(job: nil, update_mask: nil) -> ::Google::Cloud::Scheduler::V1beta1::Job

Pass arguments to `update_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**

- **job** ([::Google::Cloud::Scheduler::V1beta1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job), ::Hash) --- Required. The new job properties. [name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job#Google__Cloud__Scheduler__V1beta1__Job_name_instance_ "Google::Cloud::Scheduler::V1beta1::Job#name (method)") must be specified.


  Output only fields cannot be modified using UpdateJob.
  Any value specified for an output only field will be ignored.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Protobuf-FieldMask), ::Hash) --- A mask used to specify which fields of the job are being updated.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Scheduler::V1beta1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Scheduler::V1beta1::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest/Google-Cloud-Scheduler-V1beta1-Job))
**Raises**

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

Basic example

```ruby
require "google/cloud/scheduler/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Scheduler::V1beta1::UpdateJobRequest.new

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

# The returned object is of type Google::Cloud::Scheduler::V1beta1::Job.
p result
```