Reference documentation and code samples for the Cloud Speech-to-Text V1 API class Google::Cloud::Speech::V1::Adaptation::Client.
Client for the Adaptation service.
Service that implements Google Cloud Speech Adaptation API.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the Adaptation Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all Adaptation clients ::Google::Cloud::Speech::V1::Adaptation::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the Adaptation 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
def create_custom_class(request, options = nil) -> ::Google::Cloud::Speech::V1::CustomClass
def create_custom_class(parent: nil, custom_class_id: nil, custom_class: nil) -> ::Google::Cloud::Speech::V1::CustomClass
Create a custom class.
def create_custom_class(request, options = nil) -> ::Google::Cloud::Speech::V1::CustomClass
create_custom_class
via a request object, either of type
CreateCustomClassRequest or an equivalent Hash.
- request (::Google::Cloud::Speech::V1::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(parent: nil, custom_class_id: nil, custom_class: nil) -> ::Google::Cloud::Speech::V1::CustomClass
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).
-
parent (::String) — Required. The parent resource where this custom class will be created.
Format:
projects/{project}/locations/{location}/customClasses
Speech-to-Text supports three locations:
global
,us
(US North America), andeu
(Europe). If you are calling thespeech.googleapis.com
endpoint, use theglobal
location. To specify a region, use a regional endpoint with matchingus
oreu
location value. -
custom_class_id (::String) — Required. The ID to use for the custom class, which will become the final
component of the custom class' resource name.
This value should restrict to letters, numbers, and hyphens, with the first character a letter, the last a letter or a number, and be 4-63 characters.
- custom_class (::Google::Cloud::Speech::V1::CustomClass, ::Hash) — Required. The custom class to create.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Speech::V1::CustomClass)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/speech/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Speech::V1::Adaptation::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Speech::V1::CreateCustomClassRequest.new # Call the create_custom_class method. result = client.create_custom_class request # The returned object is of type Google::Cloud::Speech::V1::CustomClass. p result
#create_phrase_set
def create_phrase_set(request, options = nil) -> ::Google::Cloud::Speech::V1::PhraseSet
def create_phrase_set(parent: nil, phrase_set_id: nil, phrase_set: nil) -> ::Google::Cloud::Speech::V1::PhraseSet
Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. The items in the PhraseSet are favored by the recognition model when you send a call that includes the PhraseSet.
def create_phrase_set(request, options = nil) -> ::Google::Cloud::Speech::V1::PhraseSet
create_phrase_set
via a request object, either of type
CreatePhraseSetRequest or an equivalent Hash.
- request (::Google::Cloud::Speech::V1::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(parent: nil, phrase_set_id: nil, phrase_set: nil) -> ::Google::Cloud::Speech::V1::PhraseSet
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).
-
parent (::String) — Required. The parent resource where this phrase set will be created.
Format:
projects/{project}/locations/{location}
Speech-to-Text supports three locations:
global
,us
(US North America), andeu
(Europe). If you are calling thespeech.googleapis.com
endpoint, use theglobal
location. To specify a region, use a regional endpoint with matchingus
oreu
location value. -
phrase_set_id (::String) — Required. The ID to use for the phrase set, which will become the final
component of the phrase set's resource name.
This value should restrict to letters, numbers, and hyphens, with the first character a letter, the last a letter or a number, and be 4-63 characters.
- phrase_set (::Google::Cloud::Speech::V1::PhraseSet, ::Hash) — Required. The phrase set to create.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Speech::V1::PhraseSet)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/speech/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Speech::V1::Adaptation::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Speech::V1::CreatePhraseSetRequest.new # Call the create_phrase_set method. result = client.create_phrase_set request # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. p result
#delete_custom_class
def delete_custom_class(request, options = nil) -> ::Google::Protobuf::Empty
def delete_custom_class(name: nil) -> ::Google::Protobuf::Empty
Delete a custom class.
def delete_custom_class(request, options = nil) -> ::Google::Protobuf::Empty
delete_custom_class
via a request object, either of type
DeleteCustomClassRequest or an equivalent Hash.
- request (::Google::Cloud::Speech::V1::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) -> ::Google::Protobuf::Empty
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).
-
name (::String) — Required. The name of the custom class to delete. Format:
projects/{project}/locations/{location}/customClasses/{custom_class}
Speech-to-Text supports three locations:
global
,us
(US North America), andeu
(Europe). If you are calling thespeech.googleapis.com
endpoint, use theglobal
location. To specify a region, use a regional endpoint with matchingus
oreu
location value.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Protobuf::Empty)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/speech/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Speech::V1::Adaptation::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Speech::V1::DeleteCustomClassRequest.new # Call the delete_custom_class method. result = client.delete_custom_class request # The returned object is of type Google::Protobuf::Empty. p result
#delete_phrase_set
def delete_phrase_set(request, options = nil) -> ::Google::Protobuf::Empty
def delete_phrase_set(name: nil) -> ::Google::Protobuf::Empty
Delete a phrase set.
def delete_phrase_set(request, options = nil) -> ::Google::Protobuf::Empty
delete_phrase_set
via a request object, either of type
DeletePhraseSetRequest or an equivalent Hash.
- request (::Google::Cloud::Speech::V1::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) -> ::Google::Protobuf::Empty
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).
-
name (::String) — Required. The name of the phrase set to delete. Format:
projects/{project}/locations/{location}/phraseSets/{phrase_set}
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Protobuf::Empty)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/speech/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Speech::V1::Adaptation::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Speech::V1::DeletePhraseSetRequest.new # Call the delete_phrase_set method. result = client.delete_phrase_set request # The returned object is of type Google::Protobuf::Empty. p result
#get_custom_class
def get_custom_class(request, options = nil) -> ::Google::Cloud::Speech::V1::CustomClass
def get_custom_class(name: nil) -> ::Google::Cloud::Speech::V1::CustomClass
Get a custom class.
def get_custom_class(request, options = nil) -> ::Google::Cloud::Speech::V1::CustomClass
get_custom_class
via a request object, either of type
GetCustomClassRequest or an equivalent Hash.
- request (::Google::Cloud::Speech::V1::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::V1::CustomClass
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).
-
name (::String) — Required. The name of the custom class to retrieve. Format:
projects/{project}/locations/{location}/customClasses/{custom_class}
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Speech::V1::CustomClass)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/speech/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Speech::V1::Adaptation::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Speech::V1::GetCustomClassRequest.new # Call the get_custom_class method. result = client.get_custom_class request # The returned object is of type Google::Cloud::Speech::V1::CustomClass. p result
#get_phrase_set
def get_phrase_set(request, options = nil) -> ::Google::Cloud::Speech::V1::PhraseSet
def get_phrase_set(name: nil) -> ::Google::Cloud::Speech::V1::PhraseSet
Get a phrase set.
def get_phrase_set(request, options = nil) -> ::Google::Cloud::Speech::V1::PhraseSet
get_phrase_set
via a request object, either of type
GetPhraseSetRequest or an equivalent Hash.
- request (::Google::Cloud::Speech::V1::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::V1::PhraseSet
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).
-
name (::String) — Required. The name of the phrase set to retrieve. Format:
projects/{project}/locations/{location}/phraseSets/{phrase_set}
Speech-to-Text supports three locations:
global
,us
(US North America), andeu
(Europe). If you are calling thespeech.googleapis.com
endpoint, use theglobal
location. To specify a region, use a regional endpoint with matchingus
oreu
location value.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Speech::V1::PhraseSet)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/speech/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Speech::V1::Adaptation::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Speech::V1::GetPhraseSetRequest.new # Call the get_phrase_set method. result = client.get_phrase_set request # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. p result
#initialize
def initialize() { |config| ... } -> Client
Create a new Adaptation client object.
- (config) — Configure the Adaptation client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Speech::V1::Adaptation::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| config.timeout = 10.0 end
#list_custom_classes
def list_custom_classes(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1::CustomClass>
def list_custom_classes(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1::CustomClass>
List custom classes.
def list_custom_classes(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1::CustomClass>
list_custom_classes
via a request object, either of type
ListCustomClassesRequest or an equivalent Hash.
- request (::Google::Cloud::Speech::V1::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) -> ::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1::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 parent, which owns this collection of custom classes. Format:
projects/{project}/locations/{location}/customClasses
Speech-to-Text supports three locations:
global
,us
(US North America), andeu
(Europe). If you are calling thespeech.googleapis.com
endpoint, use theglobal
location. To specify a region, use a regional endpoint with matchingus
oreu
location value. - page_size (::Integer) — The maximum number of custom classes to return. The service may return fewer than this value. If unspecified, at most 50 custom classes will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
-
page_token (::String) — A page token, received from a previous
ListCustomClass
call. Provide this to retrieve the subsequent page.When paginating, all other parameters provided to
ListCustomClass
must match the call that provided the page token.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1::CustomClass>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1::CustomClass>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/speech/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Speech::V1::Adaptation::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Speech::V1::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::V1::CustomClass. p item end
#list_phrase_set
def list_phrase_set(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1::PhraseSet>
def list_phrase_set(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1::PhraseSet>
List phrase sets.
def list_phrase_set(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1::PhraseSet>
list_phrase_set
via a request object, either of type
ListPhraseSetRequest or an equivalent Hash.
- request (::Google::Cloud::Speech::V1::ListPhraseSetRequest, ::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_set(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1::PhraseSet>
list_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).
-
parent (::String) — Required. The parent, which owns this collection of phrase set. Format:
projects/{project}/locations/{location}
Speech-to-Text supports three locations:
global
,us
(US North America), andeu
(Europe). If you are calling thespeech.googleapis.com
endpoint, use theglobal
location. To specify a region, use a regional endpoint with matchingus
oreu
location value. - page_size (::Integer) — The maximum number of phrase sets to return. The service may return fewer than this value. If unspecified, at most 50 phrase sets will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
-
page_token (::String) — A page token, received from a previous
ListPhraseSet
call. Provide this to retrieve the subsequent page.When paginating, all other parameters provided to
ListPhraseSet
must match the call that provided the page token.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1::PhraseSet>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Speech::V1::PhraseSet>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/speech/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Speech::V1::Adaptation::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Speech::V1::ListPhraseSetRequest.new # Call the list_phrase_set method. result = client.list_phrase_set 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::V1::PhraseSet. p item end
#logger
def logger() -> Logger
The logger used for request/response debug logging.
- (Logger)
#universe_domain
def universe_domain() -> String
The effective universe domain
- (String)
#update_custom_class
def update_custom_class(request, options = nil) -> ::Google::Cloud::Speech::V1::CustomClass
def update_custom_class(custom_class: nil, update_mask: nil) -> ::Google::Cloud::Speech::V1::CustomClass
Update a custom class.
def update_custom_class(request, options = nil) -> ::Google::Cloud::Speech::V1::CustomClass
update_custom_class
via a request object, either of type
UpdateCustomClassRequest or an equivalent Hash.
- request (::Google::Cloud::Speech::V1::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) -> ::Google::Cloud::Speech::V1::CustomClass
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).
-
custom_class (::Google::Cloud::Speech::V1::CustomClass, ::Hash) — Required. The custom class to update.
The custom class's
name
field is used to identify the custom class to be updated. Format:projects/{project}/locations/{location}/customClasses/{custom_class}
Speech-to-Text supports three locations:
global
,us
(US North America), andeu
(Europe). If you are calling thespeech.googleapis.com
endpoint, use theglobal
location. To specify a region, use a regional endpoint with matchingus
oreu
location value. - 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::V1::CustomClass)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/speech/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Speech::V1::Adaptation::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Speech::V1::UpdateCustomClassRequest.new # Call the update_custom_class method. result = client.update_custom_class request # The returned object is of type Google::Cloud::Speech::V1::CustomClass. p result
#update_phrase_set
def update_phrase_set(request, options = nil) -> ::Google::Cloud::Speech::V1::PhraseSet
def update_phrase_set(phrase_set: nil, update_mask: nil) -> ::Google::Cloud::Speech::V1::PhraseSet
Update a phrase set.
def update_phrase_set(request, options = nil) -> ::Google::Cloud::Speech::V1::PhraseSet
update_phrase_set
via a request object, either of type
UpdatePhraseSetRequest or an equivalent Hash.
- request (::Google::Cloud::Speech::V1::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) -> ::Google::Cloud::Speech::V1::PhraseSet
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).
-
phrase_set (::Google::Cloud::Speech::V1::PhraseSet, ::Hash) — Required. The phrase set to update.
The phrase set's
name
field is used to identify the set to be updated. Format:projects/{project}/locations/{location}/phraseSets/{phrase_set}
Speech-to-Text supports three locations:
global
,us
(US North America), andeu
(Europe). If you are calling thespeech.googleapis.com
endpoint, use theglobal
location. To specify a region, use a regional endpoint with matchingus
oreu
location value. - 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::V1::PhraseSet)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/speech/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Speech::V1::Adaptation::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Speech::V1::UpdatePhraseSetRequest.new # Call the update_phrase_set method. result = client.update_phrase_set request # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. p result