# Dataflow V1beta3 API - Class Google::Cloud::Dataflow::V1beta3::TemplatesService::Client (v0.17.0)

0.17.0 (latest) 0.16.0 0.15.0 0.14.1 0.13.1 0.12.1 0.11.0 0.10.0 0.9.1 0.8.2 0.7.0 0.6.0 0.5.0 0.4.0 0.3.0 0.2.0 0.1.4 Reference documentation and code samples for the Dataflow V1beta3 API class Google::Cloud::Dataflow::V1beta3::TemplatesService::Client.

Client for the TemplatesService service.


<br />

Provides a method to create Cloud Dataflow jobs from templates.

## Inherits

- Object

## Methods

### .configure

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

Configure the TemplatesService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-TemplatesService-Client-Configuration "Google::Cloud::Dataflow::V1beta3::TemplatesService::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-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-TemplatesService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-TemplatesService-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all TemplatesService clients
::Google::Cloud::Dataflow::V1beta3::TemplatesService::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

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

Configure the TemplatesService 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-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-TemplatesService-Client#Google__Cloud__Dataflow__V1beta3__TemplatesService__Client_configure_class_ "Google::Cloud::Dataflow::V1beta3::TemplatesService::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-TemplatesService-Client-Configuration "Google::Cloud::Dataflow::V1beta3::TemplatesService::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-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-TemplatesService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-TemplatesService-Client-Configuration))

### #create_job_from_template

    def create_job_from_template(request, options = nil) -> ::Google::Cloud::Dataflow::V1beta3::Job
    def create_job_from_template(project_id: nil, job_name: nil, gcs_path: nil, parameters: nil, environment: nil, location: nil) -> ::Google::Cloud::Dataflow::V1beta3::Job

Creates a Cloud Dataflow job from a template. Do not enter confidential
information when you supply string values using the API.


<br />

To create a job, we recommend using `projects.locations.templates.create`
with a [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
`projects.templates.create` is not recommended, because your job will
always start in `us-central1`.
**Overloads**

    def create_job_from_template(request, options = nil) -> ::Google::Cloud::Dataflow::V1beta3::Job

Pass arguments to `create_job_from_template` via a request object, either of type [CreateJobFromTemplateRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-CreateJobFromTemplateRequest "Google::Cloud::Dataflow::V1beta3::CreateJobFromTemplateRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Dataflow::V1beta3::CreateJobFromTemplateRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-CreateJobFromTemplateRequest), ::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_from_template(project_id: nil, job_name: nil, gcs_path: nil, parameters: nil, environment: nil, location: nil) -> ::Google::Cloud::Dataflow::V1beta3::Job

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

- **project_id** (::String) --- Required. The ID of the Cloud Platform project that the job belongs to.
- **job_name** (::String) --- Required. The job name to use for the created job.
- **gcs_path** (::String) --- Required. A Cloud Storage path to the template from which to create the job. Must be a valid Cloud Storage URL, beginning with `gs://`.
- **parameters** (::Hash{::String =\> ::String}) --- The runtime parameters to pass to the job.
- **environment** ([::Google::Cloud::Dataflow::V1beta3::RuntimeEnvironment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-RuntimeEnvironment), ::Hash) --- The runtime environment for the job.
- **location** (::String) --- The [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to which to direct the request.
**Yields**

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

- **response** ([::Google::Cloud::Dataflow::V1beta3::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-Job))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Dataflow::V1beta3::Job](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-Job))
**Raises**

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

Basic example

```ruby
require "google/cloud/dataflow/v1beta3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dataflow::V1beta3::TemplatesService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dataflow::V1beta3::CreateJobFromTemplateRequest.new

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

# The returned object is of type Google::Cloud::Dataflow::V1beta3::Job.
p result
```

### #get_template

    def get_template(request, options = nil) -> ::Google::Cloud::Dataflow::V1beta3::GetTemplateResponse
    def get_template(project_id: nil, gcs_path: nil, view: nil, location: nil) -> ::Google::Cloud::Dataflow::V1beta3::GetTemplateResponse

Get the template associated with a template.


<br />

To get the template, we recommend using `projects.locations.templates.get`
with a [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
`projects.templates.get` is not recommended, because only
templates that are running in `us-central1` are retrieved.
**Overloads**

    def get_template(request, options = nil) -> ::Google::Cloud::Dataflow::V1beta3::GetTemplateResponse

Pass arguments to `get_template` via a request object, either of type [GetTemplateRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-GetTemplateRequest "Google::Cloud::Dataflow::V1beta3::GetTemplateRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Dataflow::V1beta3::GetTemplateRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-GetTemplateRequest), ::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_template(project_id: nil, gcs_path: nil, view: nil, location: nil) -> ::Google::Cloud::Dataflow::V1beta3::GetTemplateResponse

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

- **project_id** (::String) --- Required. The ID of the Cloud Platform project that the job belongs to.
- **gcs_path** (::String) --- Required. A Cloud Storage path to the template from which to create the job. Must be valid Cloud Storage URL, beginning with 'gs://'.
- **view** ([::Google::Cloud::Dataflow::V1beta3::GetTemplateRequest::TemplateView](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-GetTemplateRequest-TemplateView)) --- The view to retrieve. Defaults to METADATA_ONLY.
- **location** (::String) --- The [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to which to direct the request.
**Yields**

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

- **response** ([::Google::Cloud::Dataflow::V1beta3::GetTemplateResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-GetTemplateResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Dataflow::V1beta3::GetTemplateResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-GetTemplateResponse))
**Raises**

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

Basic example

```ruby
require "google/cloud/dataflow/v1beta3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dataflow::V1beta3::TemplatesService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dataflow::V1beta3::GetTemplateRequest.new

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

# The returned object is of type Google::Cloud::Dataflow::V1beta3::GetTemplateResponse.
p result
```

### #initialize

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

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

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

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-TemplatesService-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-TemplatesService-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Dataflow::V1beta3::TemplatesService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Dataflow::V1beta3::TemplatesService::Client.new do |config|
  config.timeout = 10.0
end
```

### #launch_template

    def launch_template(request, options = nil) -> ::Google::Cloud::Dataflow::V1beta3::LaunchTemplateResponse
    def launch_template(project_id: nil, validate_only: nil, gcs_path: nil, dynamic_template: nil, launch_parameters: nil, location: nil) -> ::Google::Cloud::Dataflow::V1beta3::LaunchTemplateResponse

Launches a template.


<br />

To launch a template, we recommend using
`projects.locations.templates.launch` with a [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
`projects.templates.launch` is not recommended, because jobs launched
from the template will always start in `us-central1`.
**Overloads**

    def launch_template(request, options = nil) -> ::Google::Cloud::Dataflow::V1beta3::LaunchTemplateResponse

Pass arguments to `launch_template` via a request object, either of type [LaunchTemplateRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-LaunchTemplateRequest "Google::Cloud::Dataflow::V1beta3::LaunchTemplateRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Dataflow::V1beta3::LaunchTemplateRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-LaunchTemplateRequest), ::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 launch_template(project_id: nil, validate_only: nil, gcs_path: nil, dynamic_template: nil, launch_parameters: nil, location: nil) -> ::Google::Cloud::Dataflow::V1beta3::LaunchTemplateResponse

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

- **project_id** (::String) --- Required. The ID of the Cloud Platform project that the job belongs to.
- **validate_only** (::Boolean) --- If true, the request is validated but not actually executed. Defaults to false.
- **gcs_path** (::String) --- A Cloud Storage path to the template to use to create the job. Must be valid Cloud Storage URL, beginning with `gs://`.


  Note: The following parameters are mutually exclusive: `gcs_path`, `dynamic_template`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **dynamic_template** ([::Google::Cloud::Dataflow::V1beta3::DynamicTemplateLaunchParams](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-DynamicTemplateLaunchParams), ::Hash) --- Parameters for launching a dynamic template.


  Note: The following parameters are mutually exclusive: `dynamic_template`, `gcs_path`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **launch_parameters** ([::Google::Cloud::Dataflow::V1beta3::LaunchTemplateParameters](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-LaunchTemplateParameters), ::Hash) --- The parameters of the template to launch. Part of the body of the POST request.
- **location** (::String) --- The [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to which to direct the request.
**Yields**

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

- **response** ([::Google::Cloud::Dataflow::V1beta3::LaunchTemplateResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-LaunchTemplateResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Dataflow::V1beta3::LaunchTemplateResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dataflow-v1beta3/latest/Google-Cloud-Dataflow-V1beta3-LaunchTemplateResponse))
**Raises**

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

Basic example

```ruby
require "google/cloud/dataflow/v1beta3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dataflow::V1beta3::TemplatesService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dataflow::V1beta3::LaunchTemplateRequest.new

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

# The returned object is of type Google::Cloud::Dataflow::V1beta3::LaunchTemplateResponse.
p result
```

### #logger

    def logger() -> Logger

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

- (Logger)

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)