Cloud Speech-to-Text V1p1beta1 API - Class Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client (v0.18.1)

Reference documentation and code samples for the Cloud Speech-to-Text V1p1beta1 API class Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.

REST 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.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all Adaptation clients
::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::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.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_custom_class

def create_custom_class(request, options = nil) -> ::Google::Cloud::Speech::V1p1beta1::CustomClass
def create_custom_class(parent: nil, custom_class_id: nil, custom_class: nil) -> ::Google::Cloud::Speech::V1p1beta1::CustomClass

Create a custom class.

Overloads
def create_custom_class(request, options = nil) -> ::Google::Cloud::Speech::V1p1beta1::CustomClass
Pass arguments to create_custom_class via a request object, either of type CreateCustomClassRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Speech::V1p1beta1::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::V1p1beta1::CustomClass
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
  • 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), and eu (Europe). If you are calling the speech.googleapis.com endpoint, use the global location. To specify a region, use a regional endpoint with matching us or eu 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::V1p1beta1::CustomClass, ::Hash) — Required. The custom class to create.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#create_phrase_set

def create_phrase_set(request, options = nil) -> ::Google::Cloud::Speech::V1p1beta1::PhraseSet
def create_phrase_set(parent: nil, phrase_set_id: nil, phrase_set: nil) -> ::Google::Cloud::Speech::V1p1beta1::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.

Overloads
def create_phrase_set(request, options = nil) -> ::Google::Cloud::Speech::V1p1beta1::PhraseSet
Pass arguments to create_phrase_set via a request object, either of type CreatePhraseSetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Speech::V1p1beta1::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::V1p1beta1::PhraseSet
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
  • 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), and eu (Europe). If you are calling the speech.googleapis.com endpoint, use the global location. To specify a region, use a regional endpoint with matching us or eu 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::V1p1beta1::PhraseSet, ::Hash) — Required. The phrase set to create.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#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.

Overloads
def delete_custom_class(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_custom_class via a request object, either of type DeleteCustomClassRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Speech::V1p1beta1::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
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).
Parameter
  • 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), and eu (Europe). If you are calling the speech.googleapis.com endpoint, use the global location. To specify a region, use a regional endpoint with matching us or eu location value.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#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.

Overloads
def delete_phrase_set(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_phrase_set via a request object, either of type DeletePhraseSetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Speech::V1p1beta1::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
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).
Parameter
  • name (::String) — Required. The name of the phrase set to delete. Format:

    projects/{project}/locations/{location}/phraseSets/{phrase_set}

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#get_custom_class

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

Get a custom class.

Overloads
def get_custom_class(request, options = nil) -> ::Google::Cloud::Speech::V1p1beta1::CustomClass
Pass arguments to get_custom_class via a request object, either of type GetCustomClassRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Speech::V1p1beta1::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::V1p1beta1::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 custom class to retrieve. Format:

    projects/{project}/locations/{location}/customClasses/{custom_class}

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#get_phrase_set

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

Get a phrase set.

Overloads
def get_phrase_set(request, options = nil) -> ::Google::Cloud::Speech::V1p1beta1::PhraseSet
Pass arguments to get_phrase_set via a request object, either of type GetPhraseSetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Speech::V1p1beta1::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::V1p1beta1::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 phrase set to retrieve. Format:

    projects/{project}/locations/{location}/phraseSets/{phrase_set}

    Speech-to-Text supports three locations: global, us (US North America), and eu (Europe). If you are calling the speech.googleapis.com endpoint, use the global location. To specify a region, use a regional endpoint with matching us or eu location value.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#initialize

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

Create a new Adaptation REST client object.

Yields
  • (config) — Configure the Adaptation client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::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::V1p1beta1::CustomClass>
def list_custom_classes(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V1p1beta1::CustomClass>

List custom classes.

Overloads
def list_custom_classes(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V1p1beta1::CustomClass>
Pass arguments to list_custom_classes via a request object, either of type ListCustomClassesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Speech::V1p1beta1::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::Rest::PagedEnumerable<::Google::Cloud::Speech::V1p1beta1::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 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), and eu (Europe). If you are calling the speech.googleapis.com endpoint, use the global location. To specify a region, use a regional endpoint with matching us or eu 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.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#list_phrase_set

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

List phrase sets.

Overloads
def list_phrase_set(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Speech::V1p1beta1::PhraseSet>
Pass arguments to list_phrase_set via a request object, either of type ListPhraseSetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Speech::V1p1beta1::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::Rest::PagedEnumerable<::Google::Cloud::Speech::V1p1beta1::PhraseSet>
Pass arguments to 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).
Parameters
  • 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), and eu (Europe). If you are calling the speech.googleapis.com endpoint, use the global location. To specify a region, use a regional endpoint with matching us or eu 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.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#update_custom_class

def update_custom_class(request, options = nil) -> ::Google::Cloud::Speech::V1p1beta1::CustomClass
def update_custom_class(custom_class: nil, update_mask: nil) -> ::Google::Cloud::Speech::V1p1beta1::CustomClass

Update a custom class.

Overloads
def update_custom_class(request, options = nil) -> ::Google::Cloud::Speech::V1p1beta1::CustomClass
Pass arguments to update_custom_class via a request object, either of type UpdateCustomClassRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Speech::V1p1beta1::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::V1p1beta1::CustomClass
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::V1p1beta1::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), and eu (Europe). If you are calling the speech.googleapis.com endpoint, use the global location. To specify a region, use a regional endpoint with matching us or eu location value.

  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — The list of fields to be updated.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#update_phrase_set

def update_phrase_set(request, options = nil) -> ::Google::Cloud::Speech::V1p1beta1::PhraseSet
def update_phrase_set(phrase_set: nil, update_mask: nil) -> ::Google::Cloud::Speech::V1p1beta1::PhraseSet

Update a phrase set.

Overloads
def update_phrase_set(request, options = nil) -> ::Google::Cloud::Speech::V1p1beta1::PhraseSet
Pass arguments to update_phrase_set via a request object, either of type UpdatePhraseSetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Speech::V1p1beta1::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::V1p1beta1::PhraseSet
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::V1p1beta1::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), and eu (Europe). If you are calling the speech.googleapis.com endpoint, use the global location. To specify a region, use a regional endpoint with matching us or eu location value.

  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — The list of fields to be updated.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.