# Cloud Speech-to-Text V2 API - Class Google::Cloud::Speech::V2::Speech::Rest::Client (v1.8.0)

1.8.0 (latest) 1.7.1 1.6.0 1.5.0 1.4.1 1.3.0 1.2.1 1.1.0 1.0.1 0.16.0 0.15.0 0.14.0 0.13.1 0.12.0 0.11.0 0.10.0 0.9.2 0.8.0 0.7.0 0.6.0 0.5.1 0.4.0 0.3.0 0.2.0 0.1.0 Reference documentation and code samples for the Cloud Speech-to-Text V2 API class Google::Cloud::Speech::V2::Speech::Rest::Client.

REST client for the Speech service.


<br />

Enables speech transcription and resource management.

## Inherits

- Object

## Includes

- [Google::Cloud::Speech::V2::Speech::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Speech-Paths)

## Methods

### .configure

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

Configure the Speech Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Speech-Rest-Client-Configuration "Google::Cloud::Speech::V2::Speech::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-speech-v2/latest/Google-Cloud-Speech-V2-Speech-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Speech-Rest-Client-Configuration))
**Example**

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

### #batch_recognize

    def batch_recognize(request, options = nil) -> ::Gapic::Operation
    def batch_recognize(recognizer: nil, config: nil, config_mask: nil, files: nil, recognition_output_config: nil, processing_strategy: nil) -> ::Gapic::Operation

Performs batch asynchronous speech recognition: send a request with N
audio files and receive a long running operation that can be polled to see
when the transcriptions are finished.
**Overloads**

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

Pass arguments to `batch_recognize` via a request object, either of type [BatchRecognizeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-BatchRecognizeRequest "Google::Cloud::Speech::V2::BatchRecognizeRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::BatchRecognizeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-BatchRecognizeRequest), ::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 batch_recognize(recognizer: nil, config: nil, config_mask: nil, files: nil, recognition_output_config: nil, processing_strategy: nil) -> ::Gapic::Operation

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

- **recognizer** (::String) --- Required. The name of the Recognizer to use during recognition. The expected format is `projects/{project}/locations/{location}/recognizers/{recognizer}`. The {recognizer} segment may be set to `_` to use an empty implicit Recognizer.
- **config** ([::Google::Cloud::Speech::V2::RecognitionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-RecognitionConfig), ::Hash) --- Features and audio metadata to use for the Automatic Speech Recognition. This field in combination with the [config_mask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-BatchRecognizeRequest#Google__Cloud__Speech__V2__BatchRecognizeRequest_config_mask_instance_ "Google::Cloud::Speech::V2::BatchRecognizeRequest#config_mask (method)") field can be used to override parts of the [default_recognition_config](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Recognizer#Google__Cloud__Speech__V2__Recognizer_default_recognition_config_instance_ "Google::Cloud::Speech::V2::Recognizer#default_recognition_config (method)") of the Recognizer resource.
- **config_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- The list of fields in [config](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-BatchRecognizeRequest#Google__Cloud__Speech__V2__BatchRecognizeRequest_config_instance_ "Google::Cloud::Speech::V2::BatchRecognizeRequest#config (method)") that override the values in the [default_recognition_config](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Recognizer#Google__Cloud__Speech__V2__Recognizer_default_recognition_config_instance_ "Google::Cloud::Speech::V2::Recognizer#default_recognition_config (method)") of the recognizer during this recognition request. If no mask is provided, all given fields in [config](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-BatchRecognizeRequest#Google__Cloud__Speech__V2__BatchRecognizeRequest_config_instance_ "Google::Cloud::Speech::V2::BatchRecognizeRequest#config (method)") override the values in the recognizer for this recognition request. If a mask is provided, only the fields listed in the mask override the config in the recognizer for this recognition request. If a wildcard (`*`) is provided, [config](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-BatchRecognizeRequest#Google__Cloud__Speech__V2__BatchRecognizeRequest_config_instance_ "Google::Cloud::Speech::V2::BatchRecognizeRequest#config (method)") completely overrides and replaces the config in the recognizer for this recognition request.
- **files** (::Array\<[::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-BatchRecognizeFileMetadata), ::Hash\>) --- Audio files with file metadata for ASR. The maximum number of files allowed to be specified is 15.
- **recognition_output_config** ([::Google::Cloud::Speech::V2::RecognitionOutputConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-RecognitionOutputConfig), ::Hash) --- Configuration options for where to output the transcripts of each file.
- **processing_strategy** ([::Google::Cloud::Speech::V2::BatchRecognizeRequest::ProcessingStrategy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-BatchRecognizeRequest-ProcessingStrategy)) --- Processing strategy to use for this request.
**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/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::BatchRecognizeRequest.new

# Call the batch_recognize method.
result = client.batch_recognize 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 Speech 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-speech-v2/latest/Google-Cloud-Speech-V2-Speech-Rest-Client#Google__Cloud__Speech__V2__Speech__Rest__Client_configure_class_ "Google::Cloud::Speech::V2::Speech::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Speech-Rest-Client-Configuration "Google::Cloud::Speech::V2::Speech::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-speech-v2/latest/Google-Cloud-Speech-V2-Speech-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Speech-Rest-Client-Configuration))

### #create_custom_class

    def create_custom_class(request, options = nil) -> ::Gapic::Operation
    def create_custom_class(custom_class: nil, validate_only: nil, custom_class_id: nil, parent: nil) -> ::Gapic::Operation

Creates a [CustomClass](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-CustomClass "Google::Cloud::Speech::V2::CustomClass (class)").
**Overloads**

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

Pass arguments to `create_custom_class` via a request object, either of type [CreateCustomClassRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-CreateCustomClassRequest "Google::Cloud::Speech::V2::CreateCustomClassRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::CreateCustomClassRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-CreateCustomClassRequest), ::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_custom_class(custom_class: nil, validate_only: nil, custom_class_id: nil, parent: nil) -> ::Gapic::Operation

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

- **custom_class** ([::Google::Cloud::Speech::V2::CustomClass](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-CustomClass), ::Hash) --- Required. The CustomClass to create.
- **validate_only** (::Boolean) --- If set, validate the request and preview the CustomClass, but do not actually create it.
- **custom_class_id** (::String) --- The ID to use for the CustomClass, which will become the final component of the CustomClass's resource name.


  This value should be 4-63 characters, and valid characters
  are /\[a-z\]\[0-9\]-/.
- **parent** (::String) --- Required. The project and location where this CustomClass will be created. The expected format is `projects/{project}/locations/{location}`.
**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/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::CreateCustomClassRequest.new

# Call the create_custom_class method.
result = client.create_custom_class 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
```

### #create_phrase_set

    def create_phrase_set(request, options = nil) -> ::Gapic::Operation
    def create_phrase_set(phrase_set: nil, validate_only: nil, phrase_set_id: nil, parent: nil) -> ::Gapic::Operation

Creates a [PhraseSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-PhraseSet "Google::Cloud::Speech::V2::PhraseSet (class)").
**Overloads**

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

Pass arguments to `create_phrase_set` via a request object, either of type [CreatePhraseSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-CreatePhraseSetRequest "Google::Cloud::Speech::V2::CreatePhraseSetRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::CreatePhraseSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-CreatePhraseSetRequest), ::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_phrase_set(phrase_set: nil, validate_only: nil, phrase_set_id: nil, parent: nil) -> ::Gapic::Operation

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

- **phrase_set** ([::Google::Cloud::Speech::V2::PhraseSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-PhraseSet), ::Hash) --- Required. The PhraseSet to create.
- **validate_only** (::Boolean) --- If set, validate the request and preview the PhraseSet, but do not actually create it.
- **phrase_set_id** (::String) --- The ID to use for the PhraseSet, which will become the final component of the PhraseSet's resource name.


  This value should be 4-63 characters, and valid characters
  are /\[a-z\]\[0-9\]-/.
- **parent** (::String) --- Required. The project and location where this PhraseSet will be created. The expected format is `projects/{project}/locations/{location}`.
**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/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::CreatePhraseSetRequest.new

# Call the create_phrase_set method.
result = client.create_phrase_set 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
```

### #create_recognizer

    def create_recognizer(request, options = nil) -> ::Gapic::Operation
    def create_recognizer(recognizer: nil, validate_only: nil, recognizer_id: nil, parent: nil) -> ::Gapic::Operation

Creates a [Recognizer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Recognizer "Google::Cloud::Speech::V2::Recognizer (class)").
**Overloads**

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

Pass arguments to `create_recognizer` via a request object, either of type [CreateRecognizerRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-CreateRecognizerRequest "Google::Cloud::Speech::V2::CreateRecognizerRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::CreateRecognizerRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-CreateRecognizerRequest), ::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_recognizer(recognizer: nil, validate_only: nil, recognizer_id: nil, parent: nil) -> ::Gapic::Operation

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

- **recognizer** ([::Google::Cloud::Speech::V2::Recognizer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Recognizer), ::Hash) --- Required. The Recognizer to create.
- **validate_only** (::Boolean) --- If set, validate the request and preview the Recognizer, but do not actually create it.
- **recognizer_id** (::String) --- The ID to use for the Recognizer, which will become the final component of the Recognizer's resource name.


  This value should be 4-63 characters, and valid characters
  are /\[a-z\]\[0-9\]-/.
- **parent** (::String) --- Required. The project and location where this Recognizer will be created. The expected format is `projects/{project}/locations/{location}`.
**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/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::CreateRecognizerRequest.new

# Call the create_recognizer method.
result = client.create_recognizer 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
```

### #delete_custom_class

    def delete_custom_class(request, options = nil) -> ::Gapic::Operation
    def delete_custom_class(name: nil, validate_only: nil, allow_missing: nil, etag: nil) -> ::Gapic::Operation

Deletes the [CustomClass](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-CustomClass "Google::Cloud::Speech::V2::CustomClass (class)").
**Overloads**

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

Pass arguments to `delete_custom_class` via a request object, either of type [DeleteCustomClassRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-DeleteCustomClassRequest "Google::Cloud::Speech::V2::DeleteCustomClassRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::DeleteCustomClassRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-DeleteCustomClassRequest), ::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_custom_class(name: nil, validate_only: nil, allow_missing: nil, etag: nil) -> ::Gapic::Operation

Pass arguments to `delete_custom_class` 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 name of the CustomClass to delete. Format: `projects/{project}/locations/{location}/customClasses/{custom_class}`
- **validate_only** (::Boolean) --- If set, validate the request and preview the deleted CustomClass, but do not actually delete it.
- **allow_missing** (::Boolean) --- If set to true, and the CustomClass is not found, the request will succeed and be a no-op (no Operation is recorded in this case).
- **etag** (::String) --- This checksum is computed by the server based on the value of other fields. This may be sent on update, undelete, and delete requests to ensure the client has an up-to-date value before proceeding.
**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/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::DeleteCustomClassRequest.new

# Call the delete_custom_class method.
result = client.delete_custom_class 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
```

### #delete_phrase_set

    def delete_phrase_set(request, options = nil) -> ::Gapic::Operation
    def delete_phrase_set(name: nil, validate_only: nil, allow_missing: nil, etag: nil) -> ::Gapic::Operation

Deletes the [PhraseSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-PhraseSet "Google::Cloud::Speech::V2::PhraseSet (class)").
**Overloads**

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

Pass arguments to `delete_phrase_set` via a request object, either of type [DeletePhraseSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-DeletePhraseSetRequest "Google::Cloud::Speech::V2::DeletePhraseSetRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::DeletePhraseSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-DeletePhraseSetRequest), ::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_phrase_set(name: nil, validate_only: nil, allow_missing: nil, etag: nil) -> ::Gapic::Operation

Pass arguments to `delete_phrase_set` 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 name of the PhraseSet to delete. Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
- **validate_only** (::Boolean) --- If set, validate the request and preview the deleted PhraseSet, but do not actually delete it.
- **allow_missing** (::Boolean) --- If set to true, and the PhraseSet is not found, the request will succeed and be a no-op (no Operation is recorded in this case).
- **etag** (::String) --- This checksum is computed by the server based on the value of other fields. This may be sent on update, undelete, and delete requests to ensure the client has an up-to-date value before proceeding.
**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/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::DeletePhraseSetRequest.new

# Call the delete_phrase_set method.
result = client.delete_phrase_set 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
```

### #delete_recognizer

    def delete_recognizer(request, options = nil) -> ::Gapic::Operation
    def delete_recognizer(name: nil, validate_only: nil, allow_missing: nil, etag: nil) -> ::Gapic::Operation

Deletes the [Recognizer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Recognizer "Google::Cloud::Speech::V2::Recognizer (class)").
**Overloads**

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

Pass arguments to `delete_recognizer` via a request object, either of type [DeleteRecognizerRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-DeleteRecognizerRequest "Google::Cloud::Speech::V2::DeleteRecognizerRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::DeleteRecognizerRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-DeleteRecognizerRequest), ::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_recognizer(name: nil, validate_only: nil, allow_missing: nil, etag: nil) -> ::Gapic::Operation

Pass arguments to `delete_recognizer` 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 name of the Recognizer to delete. Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`
- **validate_only** (::Boolean) --- If set, validate the request and preview the deleted Recognizer, but do not actually delete it.
- **allow_missing** (::Boolean) --- If set to true, and the Recognizer is not found, the request will succeed and be a no-op (no Operation is recorded in this case).
- **etag** (::String) --- This checksum is computed by the server based on the value of other fields. This may be sent on update, undelete, and delete requests to ensure the client has an up-to-date value before proceeding.
**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/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::DeleteRecognizerRequest.new

# Call the delete_recognizer method.
result = client.delete_recognizer 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_config

    def get_config(request, options = nil) -> ::Google::Cloud::Speech::V2::Config
    def get_config(name: nil) -> ::Google::Cloud::Speech::V2::Config

Returns the requested [Config](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Config "Google::Cloud::Speech::V2::Config (class)").
**Overloads**

    def get_config(request, options = nil) -> ::Google::Cloud::Speech::V2::Config

Pass arguments to `get_config` via a request object, either of type [GetConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-GetConfigRequest "Google::Cloud::Speech::V2::GetConfigRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::GetConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-GetConfigRequest), ::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_config(name: nil) -> ::Google::Cloud::Speech::V2::Config

Pass arguments to `get_config` 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 name of the config to retrieve. There is exactly one config resource per project per location. The expected format is `projects/{project}/locations/{location}/config`.
**Yields**

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

- **result** ([::Google::Cloud::Speech::V2::Config](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Config))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Speech::V2::Config](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Config))
**Raises**

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

Basic example

```ruby
require "google/cloud/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::GetConfigRequest.new

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

# The returned object is of type Google::Cloud::Speech::V2::Config.
p result
```

### #get_custom_class

    def get_custom_class(request, options = nil) -> ::Google::Cloud::Speech::V2::CustomClass
    def get_custom_class(name: nil) -> ::Google::Cloud::Speech::V2::CustomClass

Returns the requested
[CustomClass](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-CustomClass "Google::Cloud::Speech::V2::CustomClass (class)").
**Overloads**

    def get_custom_class(request, options = nil) -> ::Google::Cloud::Speech::V2::CustomClass

Pass arguments to `get_custom_class` via a request object, either of type [GetCustomClassRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-GetCustomClassRequest "Google::Cloud::Speech::V2::GetCustomClassRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::GetCustomClassRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-GetCustomClassRequest), ::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_custom_class(name: nil) -> ::Google::Cloud::Speech::V2::CustomClass

Pass arguments to `get_custom_class` 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 name of the CustomClass to retrieve. The expected format is `projects/{project}/locations/{location}/customClasses/{custom_class}`.
**Yields**

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

- **result** ([::Google::Cloud::Speech::V2::CustomClass](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-CustomClass))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Speech::V2::CustomClass](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-CustomClass))
**Raises**

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

Basic example

```ruby
require "google/cloud/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::GetCustomClassRequest.new

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

# The returned object is of type Google::Cloud::Speech::V2::CustomClass.
p result
```

### #get_phrase_set

    def get_phrase_set(request, options = nil) -> ::Google::Cloud::Speech::V2::PhraseSet
    def get_phrase_set(name: nil) -> ::Google::Cloud::Speech::V2::PhraseSet

Returns the requested
[PhraseSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-PhraseSet "Google::Cloud::Speech::V2::PhraseSet (class)").
**Overloads**

    def get_phrase_set(request, options = nil) -> ::Google::Cloud::Speech::V2::PhraseSet

Pass arguments to `get_phrase_set` via a request object, either of type [GetPhraseSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-GetPhraseSetRequest "Google::Cloud::Speech::V2::GetPhraseSetRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::GetPhraseSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-GetPhraseSetRequest), ::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_phrase_set(name: nil) -> ::Google::Cloud::Speech::V2::PhraseSet

Pass arguments to `get_phrase_set` 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 name of the PhraseSet to retrieve. The expected format is `projects/{project}/locations/{location}/phraseSets/{phrase_set}`.
**Yields**

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

- **result** ([::Google::Cloud::Speech::V2::PhraseSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-PhraseSet))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Speech::V2::PhraseSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-PhraseSet))
**Raises**

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

Basic example

```ruby
require "google/cloud/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::GetPhraseSetRequest.new

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

# The returned object is of type Google::Cloud::Speech::V2::PhraseSet.
p result
```

### #get_recognizer

    def get_recognizer(request, options = nil) -> ::Google::Cloud::Speech::V2::Recognizer
    def get_recognizer(name: nil) -> ::Google::Cloud::Speech::V2::Recognizer

Returns the requested
[Recognizer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Recognizer "Google::Cloud::Speech::V2::Recognizer (class)"). Fails with
\[NOT_FOUND\]\[google.rpc.Code.NOT_FOUND\] if the requested Recognizer doesn't
exist.
**Overloads**

    def get_recognizer(request, options = nil) -> ::Google::Cloud::Speech::V2::Recognizer

Pass arguments to `get_recognizer` via a request object, either of type [GetRecognizerRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-GetRecognizerRequest "Google::Cloud::Speech::V2::GetRecognizerRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::GetRecognizerRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-GetRecognizerRequest), ::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_recognizer(name: nil) -> ::Google::Cloud::Speech::V2::Recognizer

Pass arguments to `get_recognizer` 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 name of the Recognizer to retrieve. The expected format is `projects/{project}/locations/{location}/recognizers/{recognizer}`.
**Yields**

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

- **result** ([::Google::Cloud::Speech::V2::Recognizer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Recognizer))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Speech::V2::Recognizer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Recognizer))
**Raises**

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

Basic example

```ruby
require "google/cloud/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::GetRecognizerRequest.new

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

# The returned object is of type Google::Cloud::Speech::V2::Recognizer.
p result
```

### #initialize

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

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

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

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Speech-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Speech-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new

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

### #list_custom_classes

    def list_custom_classes(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>
    def list_custom_classes(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>

Lists CustomClasses.
**Overloads**

    def list_custom_classes(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>

Pass arguments to `list_custom_classes` via a request object, either of type [ListCustomClassesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-ListCustomClassesRequest "Google::Cloud::Speech::V2::ListCustomClassesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::ListCustomClassesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-ListCustomClassesRequest), ::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_custom_classes(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>

Pass arguments to `list_custom_classes` 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 project and location of CustomClass resources to list. The expected format is `projects/{project}/locations/{location}`.
- **page_size** (::Integer) --- Number of results per requests. A valid page_size ranges from 0 to 100 inclusive. If the page_size is zero or unspecified, a page size of 5 will be chosen. If the page size exceeds 100, it will be coerced down to 100. Note that a call might return fewer results than the requested page size.
- **page_token** (::String) --- A page token, received from a previous [ListCustomClasses](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Speech-Rest-Client#Google__Cloud__Speech__V2__Speech__Rest__Client_list_custom_classes_instance_ "Google::Cloud::Speech::V2::Speech::Rest::Client#list_custom_classes (method)") call. Provide this to retrieve the subsequent page.


  When paginating, all other parameters provided to
  [ListCustomClasses](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Speech-Rest-Client#Google__Cloud__Speech__V2__Speech__Rest__Client_list_custom_classes_instance_ "Google::Cloud::Speech::V2::Speech::Rest::Client#list_custom_classes (method)") must
  match the call that provided the page token.
- **show_deleted** (::Boolean) --- Whether, or not, to show resources that have been deleted.
**Yields**

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

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Speech::V2::CustomClass](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-CustomClass)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Speech::V2::CustomClass](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-CustomClass)\>)
**Raises**

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

Basic example

```ruby
require "google/cloud/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::ListCustomClassesRequest.new

# Call the list_custom_classes method.
result = client.list_custom_classes 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::Speech::V2::CustomClass.
  p item
end
```

### #list_phrase_sets

    def list_phrase_sets(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>
    def list_phrase_sets(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>

Lists PhraseSets.
**Overloads**

    def list_phrase_sets(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>

Pass arguments to `list_phrase_sets` via a request object, either of type [ListPhraseSetsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-ListPhraseSetsRequest "Google::Cloud::Speech::V2::ListPhraseSetsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::ListPhraseSetsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-ListPhraseSetsRequest), ::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_phrase_sets(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>

Pass arguments to `list_phrase_sets` 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 project and location of PhraseSet resources to list. The expected format is `projects/{project}/locations/{location}`.
- **page_size** (::Integer) --- The maximum number of PhraseSets to return. The service may return fewer than this value. If unspecified, at most 5 PhraseSets will be returned. The maximum value is 100; values above 100 will be coerced to 100.
- **page_token** (::String) --- A page token, received from a previous [ListPhraseSets](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Speech-Rest-Client#Google__Cloud__Speech__V2__Speech__Rest__Client_list_phrase_sets_instance_ "Google::Cloud::Speech::V2::Speech::Rest::Client#list_phrase_sets (method)") call. Provide this to retrieve the subsequent page.


  When paginating, all other parameters provided to
  [ListPhraseSets](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Speech-Rest-Client#Google__Cloud__Speech__V2__Speech__Rest__Client_list_phrase_sets_instance_ "Google::Cloud::Speech::V2::Speech::Rest::Client#list_phrase_sets (method)") must match
  the call that provided the page token.
- **show_deleted** (::Boolean) --- Whether, or not, to show resources that have been deleted.
**Yields**

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

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Speech::V2::PhraseSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-PhraseSet)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Speech::V2::PhraseSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-PhraseSet)\>)
**Raises**

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

Basic example

```ruby
require "google/cloud/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::ListPhraseSetsRequest.new

# Call the list_phrase_sets method.
result = client.list_phrase_sets 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::Speech::V2::PhraseSet.
  p item
end
```

### #list_recognizers

    def list_recognizers(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>
    def list_recognizers(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>

Lists Recognizers.
**Overloads**

    def list_recognizers(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>

Pass arguments to `list_recognizers` via a request object, either of type [ListRecognizersRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-ListRecognizersRequest "Google::Cloud::Speech::V2::ListRecognizersRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::ListRecognizersRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-ListRecognizersRequest), ::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_recognizers(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>

Pass arguments to `list_recognizers` 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 project and location of Recognizers to list. The expected format is `projects/{project}/locations/{location}`.
- **page_size** (::Integer) --- The maximum number of Recognizers to return. The service may return fewer than this value. If unspecified, at most 5 Recognizers will be returned. The maximum value is 100; values above 100 will be coerced to 100.
- **page_token** (::String) --- A page token, received from a previous [ListRecognizers](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Speech-Rest-Client#Google__Cloud__Speech__V2__Speech__Rest__Client_list_recognizers_instance_ "Google::Cloud::Speech::V2::Speech::Rest::Client#list_recognizers (method)") call. Provide this to retrieve the subsequent page.


  When paginating, all other parameters provided to
  [ListRecognizers](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Speech-Rest-Client#Google__Cloud__Speech__V2__Speech__Rest__Client_list_recognizers_instance_ "Google::Cloud::Speech::V2::Speech::Rest::Client#list_recognizers (method)") must match
  the call that provided the page token.
- **show_deleted** (::Boolean) --- Whether, or not, to show resources that have been deleted.
**Yields**

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

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Speech::V2::Recognizer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Recognizer)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::Speech::V2::Recognizer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Recognizer)\>)
**Raises**

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

Basic example

```ruby
require "google/cloud/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::ListRecognizersRequest.new

# Call the list_recognizers method.
result = client.list_recognizers 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::Speech::V2::Recognizer.
  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::Speech::V2::Speech::Rest::Operations

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

- ([::Google::Cloud::Speech::V2::Speech::Rest::Operations](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Speech-Rest-Operations))

### #recognize

    def recognize(request, options = nil) -> ::Google::Cloud::Speech::V2::RecognizeResponse
    def recognize(recognizer: nil, config: nil, config_mask: nil, content: nil, uri: nil) -> ::Google::Cloud::Speech::V2::RecognizeResponse

Performs synchronous Speech recognition: receive results after all audio
has been sent and processed.
**Overloads**

    def recognize(request, options = nil) -> ::Google::Cloud::Speech::V2::RecognizeResponse

Pass arguments to `recognize` via a request object, either of type [RecognizeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-RecognizeRequest "Google::Cloud::Speech::V2::RecognizeRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::RecognizeRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-RecognizeRequest), ::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 recognize(recognizer: nil, config: nil, config_mask: nil, content: nil, uri: nil) -> ::Google::Cloud::Speech::V2::RecognizeResponse

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

- **recognizer** (::String) --- Required. The name of the Recognizer to use during recognition. The expected format is `projects/{project}/locations/{location}/recognizers/{recognizer}`. The {recognizer} segment may be set to `_` to use an empty implicit Recognizer.
- **config** ([::Google::Cloud::Speech::V2::RecognitionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-RecognitionConfig), ::Hash) --- Features and audio metadata to use for the Automatic Speech Recognition. This field in combination with the [config_mask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-RecognizeRequest#Google__Cloud__Speech__V2__RecognizeRequest_config_mask_instance_ "Google::Cloud::Speech::V2::RecognizeRequest#config_mask (method)") field can be used to override parts of the [default_recognition_config](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Recognizer#Google__Cloud__Speech__V2__Recognizer_default_recognition_config_instance_ "Google::Cloud::Speech::V2::Recognizer#default_recognition_config (method)") of the Recognizer resource.
- **config_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- The list of fields in [config](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-RecognizeRequest#Google__Cloud__Speech__V2__RecognizeRequest_config_instance_ "Google::Cloud::Speech::V2::RecognizeRequest#config (method)") that override the values in the [default_recognition_config](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Recognizer#Google__Cloud__Speech__V2__Recognizer_default_recognition_config_instance_ "Google::Cloud::Speech::V2::Recognizer#default_recognition_config (method)") of the recognizer during this recognition request. If no mask is provided, all non-default valued fields in [config](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-RecognizeRequest#Google__Cloud__Speech__V2__RecognizeRequest_config_instance_ "Google::Cloud::Speech::V2::RecognizeRequest#config (method)") override the values in the recognizer for this recognition request. If a mask is provided, only the fields listed in the mask override the config in the recognizer for this recognition request. If a wildcard (`*`) is provided, [config](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-RecognizeRequest#Google__Cloud__Speech__V2__RecognizeRequest_config_instance_ "Google::Cloud::Speech::V2::RecognizeRequest#config (method)") completely overrides and replaces the config in the recognizer for this recognition request.
- **content** (::String) --- The audio data bytes encoded as specified in [RecognitionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-RecognitionConfig "Google::Cloud::Speech::V2::RecognitionConfig (class)"). As with all bytes fields, proto buffers use a pure binary representation, whereas JSON representations use base64.


  Note: The following parameters are mutually exclusive: `content`, `uri`. 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.
- **uri** (::String) --- URI that points to a file that contains audio data bytes as specified in [RecognitionConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-RecognitionConfig "Google::Cloud::Speech::V2::RecognitionConfig (class)"). The file must not be compressed (for example, gzip). Currently, only Google Cloud Storage URIs are supported, which must be specified in the following format: `gs://bucket_name/object_name` (other URI formats return \[INVALID_ARGUMENT\]\[google.rpc.Code.INVALID_ARGUMENT\]). For more information, see [Request
  URIs](https://cloud.google.com/storage/docs/reference-uris).


  Note: The following parameters are mutually exclusive: `uri`, `content`. 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.
**Yields**

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

- **result** ([::Google::Cloud::Speech::V2::RecognizeResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-RecognizeResponse))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Speech::V2::RecognizeResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-RecognizeResponse))
**Raises**

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

Basic example

```ruby
require "google/cloud/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::RecognizeRequest.new

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

# The returned object is of type Google::Cloud::Speech::V2::RecognizeResponse.
p result
```

### #undelete_custom_class

    def undelete_custom_class(request, options = nil) -> ::Gapic::Operation
    def undelete_custom_class(name: nil, validate_only: nil, etag: nil) -> ::Gapic::Operation

Undeletes the [CustomClass](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-CustomClass "Google::Cloud::Speech::V2::CustomClass (class)").
**Overloads**

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

Pass arguments to `undelete_custom_class` via a request object, either of type [UndeleteCustomClassRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-UndeleteCustomClassRequest "Google::Cloud::Speech::V2::UndeleteCustomClassRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::UndeleteCustomClassRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-UndeleteCustomClassRequest), ::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 undelete_custom_class(name: nil, validate_only: nil, etag: nil) -> ::Gapic::Operation

Pass arguments to `undelete_custom_class` 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 name of the CustomClass to undelete. Format: `projects/{project}/locations/{location}/customClasses/{custom_class}`
- **validate_only** (::Boolean) --- If set, validate the request and preview the undeleted CustomClass, but do not actually undelete it.
- **etag** (::String) --- This checksum is computed by the server based on the value of other fields. This may be sent on update, undelete, and delete requests to ensure the client has an up-to-date value before proceeding.
**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/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new

# Call the undelete_custom_class method.
result = client.undelete_custom_class 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
```

### #undelete_phrase_set

    def undelete_phrase_set(request, options = nil) -> ::Gapic::Operation
    def undelete_phrase_set(name: nil, validate_only: nil, etag: nil) -> ::Gapic::Operation

Undeletes the [PhraseSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-PhraseSet "Google::Cloud::Speech::V2::PhraseSet (class)").
**Overloads**

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

Pass arguments to `undelete_phrase_set` via a request object, either of type [UndeletePhraseSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-UndeletePhraseSetRequest "Google::Cloud::Speech::V2::UndeletePhraseSetRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::UndeletePhraseSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-UndeletePhraseSetRequest), ::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 undelete_phrase_set(name: nil, validate_only: nil, etag: nil) -> ::Gapic::Operation

Pass arguments to `undelete_phrase_set` 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 name of the PhraseSet to undelete. Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
- **validate_only** (::Boolean) --- If set, validate the request and preview the undeleted PhraseSet, but do not actually undelete it.
- **etag** (::String) --- This checksum is computed by the server based on the value of other fields. This may be sent on update, undelete, and delete requests to ensure the client has an up-to-date value before proceeding.
**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/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new

# Call the undelete_phrase_set method.
result = client.undelete_phrase_set 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
```

### #undelete_recognizer

    def undelete_recognizer(request, options = nil) -> ::Gapic::Operation
    def undelete_recognizer(name: nil, validate_only: nil, etag: nil) -> ::Gapic::Operation

Undeletes the [Recognizer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Recognizer "Google::Cloud::Speech::V2::Recognizer (class)").
**Overloads**

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

Pass arguments to `undelete_recognizer` via a request object, either of type [UndeleteRecognizerRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-UndeleteRecognizerRequest "Google::Cloud::Speech::V2::UndeleteRecognizerRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::UndeleteRecognizerRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-UndeleteRecognizerRequest), ::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 undelete_recognizer(name: nil, validate_only: nil, etag: nil) -> ::Gapic::Operation

Pass arguments to `undelete_recognizer` 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 name of the Recognizer to undelete. Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`
- **validate_only** (::Boolean) --- If set, validate the request and preview the undeleted Recognizer, but do not actually undelete it.
- **etag** (::String) --- This checksum is computed by the server based on the value of other fields. This may be sent on update, undelete, and delete requests to ensure the client has an up-to-date value before proceeding.
**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/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new

# Call the undelete_recognizer method.
result = client.undelete_recognizer 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
```

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_config

    def update_config(request, options = nil) -> ::Google::Cloud::Speech::V2::Config
    def update_config(config: nil, update_mask: nil) -> ::Google::Cloud::Speech::V2::Config

Updates the [Config](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Config "Google::Cloud::Speech::V2::Config (class)").
**Overloads**

    def update_config(request, options = nil) -> ::Google::Cloud::Speech::V2::Config

Pass arguments to `update_config` via a request object, either of type [UpdateConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-UpdateConfigRequest "Google::Cloud::Speech::V2::UpdateConfigRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::UpdateConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-UpdateConfigRequest), ::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_config(config: nil, update_mask: nil) -> ::Google::Cloud::Speech::V2::Config

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

- **config** ([::Google::Cloud::Speech::V2::Config](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Config), ::Hash) --- Required. The config to update.


  The config's `name` field is used to identify the config to be updated.
  The expected format is `projects/{project}/locations/{location}/config`.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- The list of fields to be updated.
**Yields**

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

- **result** ([::Google::Cloud::Speech::V2::Config](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Config))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::Speech::V2::Config](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Config))
**Raises**

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

Basic example

```ruby
require "google/cloud/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::UpdateConfigRequest.new

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

# The returned object is of type Google::Cloud::Speech::V2::Config.
p result
```

### #update_custom_class

    def update_custom_class(request, options = nil) -> ::Gapic::Operation
    def update_custom_class(custom_class: nil, update_mask: nil, validate_only: nil) -> ::Gapic::Operation

Updates the [CustomClass](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-CustomClass "Google::Cloud::Speech::V2::CustomClass (class)").
**Overloads**

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

Pass arguments to `update_custom_class` via a request object, either of type [UpdateCustomClassRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-UpdateCustomClassRequest "Google::Cloud::Speech::V2::UpdateCustomClassRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::UpdateCustomClassRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-UpdateCustomClassRequest), ::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_custom_class(custom_class: nil, update_mask: nil, validate_only: nil) -> ::Gapic::Operation

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

- **custom_class** ([::Google::Cloud::Speech::V2::CustomClass](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-CustomClass), ::Hash) --- Required. The CustomClass to update.


  The CustomClass's `name` field is used to identify the CustomClass to
  update. Format:
  `projects/{project}/locations/{location}/customClasses/{custom_class}`.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- The list of fields to be updated. If empty, all fields are considered for update.
- **validate_only** (::Boolean) --- If set, validate the request and preview the updated CustomClass, but do not actually update it.
**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/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::UpdateCustomClassRequest.new

# Call the update_custom_class method.
result = client.update_custom_class 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
```

### #update_phrase_set

    def update_phrase_set(request, options = nil) -> ::Gapic::Operation
    def update_phrase_set(phrase_set: nil, update_mask: nil, validate_only: nil) -> ::Gapic::Operation

Updates the [PhraseSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-PhraseSet "Google::Cloud::Speech::V2::PhraseSet (class)").
**Overloads**

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

Pass arguments to `update_phrase_set` via a request object, either of type [UpdatePhraseSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-UpdatePhraseSetRequest "Google::Cloud::Speech::V2::UpdatePhraseSetRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::UpdatePhraseSetRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-UpdatePhraseSetRequest), ::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_phrase_set(phrase_set: nil, update_mask: nil, validate_only: nil) -> ::Gapic::Operation

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

- **phrase_set** ([::Google::Cloud::Speech::V2::PhraseSet](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-PhraseSet), ::Hash) --- Required. The PhraseSet to update.


  The PhraseSet's `name` field is used to identify the PhraseSet to update.
  Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- The list of fields to update. If empty, all non-default valued fields are considered for update. Use `*` to update the entire PhraseSet resource.
- **validate_only** (::Boolean) --- If set, validate the request and preview the updated PhraseSet, but do not actually update it.
**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/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new

# Call the update_phrase_set method.
result = client.update_phrase_set 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
```

### #update_recognizer

    def update_recognizer(request, options = nil) -> ::Gapic::Operation
    def update_recognizer(recognizer: nil, update_mask: nil, validate_only: nil) -> ::Gapic::Operation

Updates the [Recognizer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Recognizer "Google::Cloud::Speech::V2::Recognizer (class)").
**Overloads**

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

Pass arguments to `update_recognizer` via a request object, either of type [UpdateRecognizerRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-UpdateRecognizerRequest "Google::Cloud::Speech::V2::UpdateRecognizerRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Speech::V2::UpdateRecognizerRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-UpdateRecognizerRequest), ::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_recognizer(recognizer: nil, update_mask: nil, validate_only: nil) -> ::Gapic::Operation

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

- **recognizer** ([::Google::Cloud::Speech::V2::Recognizer](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Cloud-Speech-V2-Recognizer), ::Hash) --- Required. The Recognizer to update.


  The Recognizer's `name` field is used to identify the Recognizer to update.
  Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-speech-v2/latest/Google-Protobuf-FieldMask), ::Hash) --- The list of fields to update. If empty, all non-default valued fields are considered for update. Use `*` to update the entire Recognizer resource.
- **validate_only** (::Boolean) --- If set, validate the request and preview the updated Recognizer, but do not actually update it.
**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/speech/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Speech::V2::UpdateRecognizerRequest.new

# Call the update_recognizer method.
result = client.update_recognizer 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
```