Cloud Speech-to-Text V2 API - Class Google::Cloud::Speech::V2::Speech::Client (v1.4.1)
Stay organized with collections
Save and categorize content based on your preferences.
Reference documentation and code samples for the Cloud Speech-to-Text V2 API class Google::Cloud::Speech::V2::Speech::Client.
Client for the Speech service.
Enables speech transcription and resource management.
Inherits
- Object
Methods
.configure
defself.configure(){|config|...}->Client::ConfigurationConfigure the Speech Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all Speech clients ::Google::Cloud::Speech::V2::Speech::Client.configuredo|config| config.timeout=10.0 end
#batch_recognize
defbatch_recognize(request,options=nil)->::Gapic::Operation
defbatch_recognize(recognizer:nil,config:nil,config_mask:nil,files:nil,recognition_output_config:nil,processing_strategy:nil)->::Gapic::OperationPerforms 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.
defbatch_recognize(request,options=nil)->::Gapic::Operationbatch_recognize via a request object, either of type
BatchRecognizeRequest or an equivalent Hash.
- request (::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.
defbatch_recognize(recognizer:nil,config:nil,config_mask:nil,files:nil,recognition_output_config:nil,processing_strategy:nil)->::Gapic::Operationbatch_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).
-
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, ::Hash) — Features and audio metadata to use for the Automatic Speech Recognition. This field in combination with the config_mask field can be used to override parts of the default_recognition_config of the Recognizer resource.
-
config_mask (::Google::Protobuf::FieldMask, ::Hash) — The list of fields in
config that override
the values in the
default_recognition_config
of the recognizer during this recognition request. If no mask is provided,
all given fields in
config 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 completely overrides and replaces the config in the recognizer for this recognition request. - files (::Array<::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, ::Hash) — Configuration options for where to output the transcripts of each file.
- processing_strategy (::Google::Cloud::Speech::V2::BatchRecognizeRequest::ProcessingStrategy) — Processing strategy to use for this request.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_recognizerequest # 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 ifresult.response? presult.response else puts"No response received." end
#configure
defconfigure(){|config|...}->Client::ConfigurationConfigure 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 .
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_custom_class
defcreate_custom_class(request,options=nil)->::Gapic::Operation
defcreate_custom_class(custom_class:nil,validate_only:nil,custom_class_id:nil,parent:nil)->::Gapic::OperationCreates a CustomClass .
defcreate_custom_class(request,options=nil)->::Gapic::Operationcreate_custom_class via a request object, either of type
CreateCustomClassRequest or an equivalent Hash.
- request (::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.
defcreate_custom_class(custom_class:nil,validate_only:nil,custom_class_id:nil,parent:nil)->::Gapic::Operationcreate_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).
- custom_class (::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}.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_classrequest # 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 ifresult.response? presult.response else puts"No response received." end
#create_phrase_set
defcreate_phrase_set(request,options=nil)->::Gapic::Operation
defcreate_phrase_set(phrase_set:nil,validate_only:nil,phrase_set_id:nil,parent:nil)->::Gapic::OperationCreates a PhraseSet .
defcreate_phrase_set(request,options=nil)->::Gapic::Operationcreate_phrase_set via a request object, either of type
CreatePhraseSetRequest or an equivalent Hash.
- request (::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.
defcreate_phrase_set(phrase_set:nil,validate_only:nil,phrase_set_id:nil,parent:nil)->::Gapic::Operationcreate_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).
- phrase_set (::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}.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_setrequest # 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 ifresult.response? presult.response else puts"No response received." end
#create_recognizer
defcreate_recognizer(request,options=nil)->::Gapic::Operation
defcreate_recognizer(recognizer:nil,validate_only:nil,recognizer_id:nil,parent:nil)->::Gapic::OperationCreates a Recognizer .
defcreate_recognizer(request,options=nil)->::Gapic::Operationcreate_recognizer via a request object, either of type
CreateRecognizerRequest or an equivalent Hash.
- request (::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.
defcreate_recognizer(recognizer:nil,validate_only:nil,recognizer_id:nil,parent:nil)->::Gapic::Operationcreate_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).
- recognizer (::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}.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_recognizerrequest # 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 ifresult.response? presult.response else puts"No response received." end
#delete_custom_class
defdelete_custom_class(request,options=nil)->::Gapic::Operation
defdelete_custom_class(name:nil,validate_only:nil,allow_missing:nil,etag:nil)->::Gapic::OperationDeletes the CustomClass .
defdelete_custom_class(request,options=nil)->::Gapic::Operationdelete_custom_class via a request object, either of type
DeleteCustomClassRequest or an equivalent Hash.
- request (::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.
defdelete_custom_class(name:nil,validate_only:nil,allow_missing:nil,etag:nil)->::Gapic::Operationdelete_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).
-
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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_classrequest # 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 ifresult.response? presult.response else puts"No response received." end
#delete_phrase_set
defdelete_phrase_set(request,options=nil)->::Gapic::Operation
defdelete_phrase_set(name:nil,validate_only:nil,allow_missing:nil,etag:nil)->::Gapic::OperationDeletes the PhraseSet .
defdelete_phrase_set(request,options=nil)->::Gapic::Operationdelete_phrase_set via a request object, either of type
DeletePhraseSetRequest or an equivalent Hash.
- request (::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.
defdelete_phrase_set(name:nil,validate_only:nil,allow_missing:nil,etag:nil)->::Gapic::Operationdelete_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).
-
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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_setrequest # 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 ifresult.response? presult.response else puts"No response received." end
#delete_recognizer
defdelete_recognizer(request,options=nil)->::Gapic::Operation
defdelete_recognizer(name:nil,validate_only:nil,allow_missing:nil,etag:nil)->::Gapic::OperationDeletes the Recognizer .
defdelete_recognizer(request,options=nil)->::Gapic::Operationdelete_recognizer via a request object, either of type
DeleteRecognizerRequest or an equivalent Hash.
- request (::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.
defdelete_recognizer(name:nil,validate_only:nil,allow_missing:nil,etag:nil)->::Gapic::Operationdelete_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).
-
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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_recognizerrequest # 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 ifresult.response? presult.response else puts"No response received." end
#get_config
defget_config(request,options=nil)->::Google::Cloud::Speech::V2::Config
defget_config(name:nil)->::Google::Cloud::Speech::V2::ConfigReturns the requested Config .
defget_config(request,options=nil)->::Google::Cloud::Speech::V2::Configget_config via a request object, either of type
GetConfigRequest or an equivalent Hash.
- request (::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.
defget_config(name:nil)->::Google::Cloud::Speech::V2::Configget_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).
-
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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Speech::V2::Config)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_configrequest # The returned object is of type Google::Cloud::Speech::V2::Config. presult
#get_custom_class
defget_custom_class(request,options=nil)->::Google::Cloud::Speech::V2::CustomClass
defget_custom_class(name:nil)->::Google::Cloud::Speech::V2::CustomClassReturns the requested CustomClass .
defget_custom_class(request,options=nil)->::Google::Cloud::Speech::V2::CustomClassget_custom_class via a request object, either of type
GetCustomClassRequest or an equivalent Hash.
- request (::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.
defget_custom_class(name:nil)->::Google::Cloud::Speech::V2::CustomClassget_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).
-
name (::String) — Required. The name of the CustomClass to retrieve. The expected format is
projects/{project}/locations/{location}/customClasses/{custom_class}.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Speech::V2::CustomClass)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_classrequest # The returned object is of type Google::Cloud::Speech::V2::CustomClass. presult
#get_phrase_set
defget_phrase_set(request,options=nil)->::Google::Cloud::Speech::V2::PhraseSet
defget_phrase_set(name:nil)->::Google::Cloud::Speech::V2::PhraseSetReturns the requested PhraseSet .
defget_phrase_set(request,options=nil)->::Google::Cloud::Speech::V2::PhraseSetget_phrase_set via a request object, either of type
GetPhraseSetRequest or an equivalent Hash.
- request (::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.
defget_phrase_set(name:nil)->::Google::Cloud::Speech::V2::PhraseSetget_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).
-
name (::String) — Required. The name of the PhraseSet to retrieve. The expected format is
projects/{project}/locations/{location}/phraseSets/{phrase_set}.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Speech::V2::PhraseSet)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_setrequest # The returned object is of type Google::Cloud::Speech::V2::PhraseSet. presult
#get_recognizer
defget_recognizer(request,options=nil)->::Google::Cloud::Speech::V2::Recognizer
defget_recognizer(name:nil)->::Google::Cloud::Speech::V2::RecognizerReturns the requested Recognizer . Fails with [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't exist.
defget_recognizer(request,options=nil)->::Google::Cloud::Speech::V2::Recognizerget_recognizer via a request object, either of type
GetRecognizerRequest or an equivalent Hash.
- request (::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.
defget_recognizer(name:nil)->::Google::Cloud::Speech::V2::Recognizerget_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).
-
name (::String) — Required. The name of the Recognizer to retrieve. The expected format is
projects/{project}/locations/{location}/recognizers/{recognizer}.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Speech::V2::Recognizer)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_recognizerrequest # The returned object is of type Google::Cloud::Speech::V2::Recognizer. presult
#initialize
definitialize(){|config|...}->ClientCreate a new Speech client object.
- (config) — Configure the Speech client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client=::Google::Cloud::Speech::V2::Speech::Client.new # Create a client using a custom configuration client=::Google::Cloud::Speech::V2::Speech::Client.newdo|config| config.timeout=10.0 end
#list_custom_classes
deflist_custom_classes(request,options=nil)->::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>
deflist_custom_classes(parent:nil,page_size:nil,page_token:nil,show_deleted:nil)->::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>Lists CustomClasses.
deflist_custom_classes(request,options=nil)->::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>list_custom_classes via a request object, either of type
ListCustomClassesRequest or an equivalent Hash.
- request (::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.
deflist_custom_classes(parent:nil,page_size:nil,page_token:nil,show_deleted:nil)->::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>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).
-
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 call.
Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to ListCustomClasses must match the call that provided the page token.
- show_deleted (::Boolean) — Whether, or not, to show resources that have been deleted.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::CustomClass>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_classesrequest # 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.eachdo|item| # Each element is of type ::Google::Cloud::Speech::V2::CustomClass. pitem end
#list_phrase_sets
deflist_phrase_sets(request,options=nil)->::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>
deflist_phrase_sets(parent:nil,page_size:nil,page_token:nil,show_deleted:nil)->::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>Lists PhraseSets.
deflist_phrase_sets(request,options=nil)->::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>list_phrase_sets via a request object, either of type
ListPhraseSetsRequest or an equivalent Hash.
- request (::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.
deflist_phrase_sets(parent:nil,page_size:nil,page_token:nil,show_deleted:nil)->::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>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).
-
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 call.
Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to ListPhraseSets must match the call that provided the page token.
- show_deleted (::Boolean) — Whether, or not, to show resources that have been deleted.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::PhraseSet>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_setsrequest # 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.eachdo|item| # Each element is of type ::Google::Cloud::Speech::V2::PhraseSet. pitem end
#list_recognizers
deflist_recognizers(request,options=nil)->::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>
deflist_recognizers(parent:nil,page_size:nil,page_token:nil,show_deleted:nil)->::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>Lists Recognizers.
deflist_recognizers(request,options=nil)->::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>list_recognizers via a request object, either of type
ListRecognizersRequest or an equivalent Hash.
- request (::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.
deflist_recognizers(parent:nil,page_size:nil,page_token:nil,show_deleted:nil)->::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>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).
-
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 call.
Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to ListRecognizers must match the call that provided the page token.
- show_deleted (::Boolean) — Whether, or not, to show resources that have been deleted.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Speech::V2::Recognizer>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_recognizersrequest # 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.eachdo|item| # Each element is of type ::Google::Cloud::Speech::V2::Recognizer. pitem end
#location_client
deflocation_client()->Google::Cloud::Location::Locations::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#logger
deflogger()->LoggerThe logger used for request/response debug logging.
- (Logger)
#operations_client
defoperations_client()->::Google::Cloud::Speech::V2::Speech::OperationsGet the associated client for long-running operations.
#recognize
defrecognize(request,options=nil)->::Google::Cloud::Speech::V2::RecognizeResponse
defrecognize(recognizer:nil,config:nil,config_mask:nil,content:nil,uri:nil)->::Google::Cloud::Speech::V2::RecognizeResponsePerforms synchronous Speech recognition: receive results after all audio has been sent and processed.
defrecognize(request,options=nil)->::Google::Cloud::Speech::V2::RecognizeResponserecognize via a request object, either of type
RecognizeRequest or an equivalent Hash.
- request (::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.
defrecognize(recognizer:nil,config:nil,config_mask:nil,content:nil,uri:nil)->::Google::Cloud::Speech::V2::RecognizeResponserecognize 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).
-
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, ::Hash) — Features and audio metadata to use for the Automatic Speech Recognition. This field in combination with the config_mask field can be used to override parts of the default_recognition_config of the Recognizer resource.
-
config_mask (::Google::Protobuf::FieldMask, ::Hash) — The list of fields in
config that override the
values in the
default_recognition_config
of the recognizer during this recognition request. If no mask is provided,
all non-default valued fields in
config 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 completely overrides and replaces the config in the recognizer for this recognition request. -
content (::String) — The audio data bytes encoded as specified in
RecognitionConfig . 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 . 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.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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Speech::V2::RecognizeResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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.recognizerequest # The returned object is of type Google::Cloud::Speech::V2::RecognizeResponse. presult
#streaming_recognize
defstreaming_recognize(request,options=nil){|response,operation|...}->::Enumerable<::Google::Cloud::Speech::V2::StreamingRecognizeResponse>Performs bidirectional streaming speech recognition: receive results while sending audio. This method is only available via the gRPC API (not REST).
- request (::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Speech::V2::StreamingRecognizeRequest, ::Hash>) — An enumerable of Google::Cloud::Speech::V2::StreamingRecognizeRequest instances.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
- (response, operation) — Access the result along with the RPC operation
- response (::Enumerable<::Google::Cloud::Speech::V2::StreamingRecognizeResponse>)
- operation (::GRPC::ActiveCall::Operation)
- (::Enumerable<::Google::Cloud::Speech::V2::StreamingRecognizeResponse>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::Client.new # Create an input stream. input=Gapic::StreamInput.new # Call the streaming_recognize method to start streaming. output=client.streaming_recognizeinput # Send requests on the stream. For each request object, set fields by # passing keyword arguments. Be sure to close the stream when done. input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new input.close # The returned object is a streamed enumerable yielding elements of type # ::Google::Cloud::Speech::V2::StreamingRecognizeResponse output.eachdo|current_response| pcurrent_response end
#undelete_custom_class
defundelete_custom_class(request,options=nil)->::Gapic::Operation
defundelete_custom_class(name:nil,validate_only:nil,etag:nil)->::Gapic::OperationUndeletes the CustomClass .
defundelete_custom_class(request,options=nil)->::Gapic::Operationundelete_custom_class via a request object, either of type
UndeleteCustomClassRequest or an equivalent Hash.
- request (::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.
defundelete_custom_class(name:nil,validate_only:nil,etag:nil)->::Gapic::Operationundelete_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).
-
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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_classrequest # 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 ifresult.response? presult.response else puts"No response received." end
#undelete_phrase_set
defundelete_phrase_set(request,options=nil)->::Gapic::Operation
defundelete_phrase_set(name:nil,validate_only:nil,etag:nil)->::Gapic::OperationUndeletes the PhraseSet .
defundelete_phrase_set(request,options=nil)->::Gapic::Operationundelete_phrase_set via a request object, either of type
UndeletePhraseSetRequest or an equivalent Hash.
- request (::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.
defundelete_phrase_set(name:nil,validate_only:nil,etag:nil)->::Gapic::Operationundelete_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).
-
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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_setrequest # 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 ifresult.response? presult.response else puts"No response received." end
#undelete_recognizer
defundelete_recognizer(request,options=nil)->::Gapic::Operation
defundelete_recognizer(name:nil,validate_only:nil,etag:nil)->::Gapic::OperationUndeletes the Recognizer .
defundelete_recognizer(request,options=nil)->::Gapic::Operationundelete_recognizer via a request object, either of type
UndeleteRecognizerRequest or an equivalent Hash.
- request (::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.
defundelete_recognizer(name:nil,validate_only:nil,etag:nil)->::Gapic::Operationundelete_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).
-
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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_recognizerrequest # 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 ifresult.response? presult.response else puts"No response received." end
#universe_domain
defuniverse_domain()->StringThe effective universe domain
- (String)
#update_config
defupdate_config(request,options=nil)->::Google::Cloud::Speech::V2::Config
defupdate_config(config:nil,update_mask:nil)->::Google::Cloud::Speech::V2::ConfigUpdates the Config .
defupdate_config(request,options=nil)->::Google::Cloud::Speech::V2::Configupdate_config via a request object, either of type
UpdateConfigRequest or an equivalent Hash.
- request (::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.
defupdate_config(config:nil,update_mask:nil)->::Google::Cloud::Speech::V2::Configupdate_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).
-
config (::Google::Cloud::Speech::V2::Config, ::Hash) — Required. The config to update.
The config's
namefield is used to identify the config to be updated. The expected format isprojects/{project}/locations/{location}/config. - update_mask (::Google::Protobuf::FieldMask, ::Hash) — The list of fields to be updated.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Speech::V2::Config)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_configrequest # The returned object is of type Google::Cloud::Speech::V2::Config. presult
#update_custom_class
defupdate_custom_class(request,options=nil)->::Gapic::Operation
defupdate_custom_class(custom_class:nil,update_mask:nil,validate_only:nil)->::Gapic::OperationUpdates the CustomClass .
defupdate_custom_class(request,options=nil)->::Gapic::Operationupdate_custom_class via a request object, either of type
UpdateCustomClassRequest or an equivalent Hash.
- request (::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.
defupdate_custom_class(custom_class:nil,update_mask:nil,validate_only:nil)->::Gapic::Operationupdate_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).
-
custom_class (::Google::Cloud::Speech::V2::CustomClass, ::Hash) — Required. The CustomClass to update.
The CustomClass's
namefield is used to identify the CustomClass to update. Format:projects/{project}/locations/{location}/customClasses/{custom_class}. - update_mask (::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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_classrequest # 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 ifresult.response? presult.response else puts"No response received." end
#update_phrase_set
defupdate_phrase_set(request,options=nil)->::Gapic::Operation
defupdate_phrase_set(phrase_set:nil,update_mask:nil,validate_only:nil)->::Gapic::OperationUpdates the PhraseSet .
defupdate_phrase_set(request,options=nil)->::Gapic::Operationupdate_phrase_set via a request object, either of type
UpdatePhraseSetRequest or an equivalent Hash.
- request (::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.
defupdate_phrase_set(phrase_set:nil,update_mask:nil,validate_only:nil)->::Gapic::Operationupdate_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).
-
phrase_set (::Google::Cloud::Speech::V2::PhraseSet, ::Hash) — Required. The PhraseSet to update.
The PhraseSet's
namefield is used to identify the PhraseSet to update. Format:projects/{project}/locations/{location}/phraseSets/{phrase_set}. -
update_mask (::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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_setrequest # 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 ifresult.response? presult.response else puts"No response received." end
#update_recognizer
defupdate_recognizer(request,options=nil)->::Gapic::Operation
defupdate_recognizer(recognizer:nil,update_mask:nil,validate_only:nil)->::Gapic::OperationUpdates the Recognizer .
defupdate_recognizer(request,options=nil)->::Gapic::Operationupdate_recognizer via a request object, either of type
UpdateRecognizerRequest or an equivalent Hash.
- request (::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.
defupdate_recognizer(recognizer:nil,update_mask:nil,validate_only:nil)->::Gapic::Operationupdate_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).
-
recognizer (::Google::Cloud::Speech::V2::Recognizer, ::Hash) — Required. The Recognizer to update.
The Recognizer's
namefield is used to identify the Recognizer to update. Format:projects/{project}/locations/{location}/recognizers/{recognizer}. -
update_mask (::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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/speech/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Speech::V2::Speech::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_recognizerrequest # 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 ifresult.response? presult.response else puts"No response received." end