Class AdaptationClient (2.17.0)

Service that implements Google Cloud Speech Adaptation API.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

AdaptationClient(AdaptationClient const &)

Copy and move support

Parameter
Name Description
AdaptationClient const &

AdaptationClient(AdaptationClient &&)

Copy and move support

Parameter
Name Description
AdaptationClient &&

AdaptationClient(std::shared_ptr< AdaptationConnection >, Options)

Parameters
Name Description
connection std::shared_ptr< AdaptationConnection >
opts Options

Operators

operator=(AdaptationClient const &)

Copy and move support

Parameter
Name Description
AdaptationClient const &
Returns
Type Description
AdaptationClient &

operator=(AdaptationClient &&)

Copy and move support

Parameter
Name Description
AdaptationClient &&
Returns
Type Description
AdaptationClient &

Functions

CreatePhraseSet(std::string const &, google::cloud::speech::v1::PhraseSet const &, std::string const &, Options)

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.

Parameters
Name Description
parent std::string const &

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 google::cloud::speech::v1::PhraseSet const &

Required. The phrase set to create.

phrase_set_id std::string const &

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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::speech::v1::PhraseSet >

the result of the RPC. The response message type (google.cloud.speech.v1.PhraseSet) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreatePhraseSet(google::cloud::speech::v1::CreatePhraseSetRequest const &, Options)

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.

Parameters
Name Description
request google::cloud::speech::v1::CreatePhraseSetRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.speech.v1.CreatePhraseSetRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::speech::v1::PhraseSet >

the result of the RPC. The response message type (google.cloud.speech.v1.PhraseSet) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetPhraseSet(std::string const &, Options)

Get a phrase set.

Parameters
Name Description
name std::string const &

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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::speech::v1::PhraseSet >

the result of the RPC. The response message type (google.cloud.speech.v1.PhraseSet) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetPhraseSet(google::cloud::speech::v1::GetPhraseSetRequest const &, Options)

Get a phrase set.

Parameters
Name Description
request google::cloud::speech::v1::GetPhraseSetRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.speech.v1.GetPhraseSetRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::speech::v1::PhraseSet >

the result of the RPC. The response message type (google.cloud.speech.v1.PhraseSet) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListPhraseSet(std::string const &, Options)

List phrase sets.

Parameters
Name Description
parent std::string const &

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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::speech::v1::PhraseSet >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.speech.v1.PhraseSet, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListPhraseSet(google::cloud::speech::v1::ListPhraseSetRequest, Options)

List phrase sets.

Parameters
Name Description
request google::cloud::speech::v1::ListPhraseSetRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.speech.v1.ListPhraseSetRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::speech::v1::PhraseSet >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.speech.v1.PhraseSet, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

UpdatePhraseSet(google::cloud::speech::v1::PhraseSet const &, google::protobuf::FieldMask const &, Options)

Update a phrase set.

Parameters
Name Description
phrase_set google::cloud::speech::v1::PhraseSet const &

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 const &

The list of fields to be updated.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::speech::v1::PhraseSet >

the result of the RPC. The response message type (google.cloud.speech.v1.PhraseSet) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

UpdatePhraseSet(google::cloud::speech::v1::UpdatePhraseSetRequest const &, Options)

Update a phrase set.

Parameters
Name Description
request google::cloud::speech::v1::UpdatePhraseSetRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.speech.v1.UpdatePhraseSetRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::speech::v1::PhraseSet >

the result of the RPC. The response message type (google.cloud.speech.v1.PhraseSet) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

DeletePhraseSet(std::string const &, Options)

Delete a phrase set.

Parameters
Name Description
name std::string const &

Required. The name of the phrase set to delete. Format:
projects/{project}/locations/{location}/phraseSets/{phrase_set}

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

DeletePhraseSet(google::cloud::speech::v1::DeletePhraseSetRequest const &, Options)

Delete a phrase set.

Parameters
Name Description
request google::cloud::speech::v1::DeletePhraseSetRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.speech.v1.DeletePhraseSetRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

CreateCustomClass(std::string const &, google::cloud::speech::v1::CustomClass const &, std::string const &, Options)

Create a custom class.

Parameters
Name Description
parent std::string const &

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 google::cloud::speech::v1::CustomClass const &

Required. The custom class to create.

custom_class_id std::string const &

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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::speech::v1::CustomClass >

the result of the RPC. The response message type (google.cloud.speech.v1.CustomClass) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreateCustomClass(google::cloud::speech::v1::CreateCustomClassRequest const &, Options)

Create a custom class.

Parameters
Name Description
request google::cloud::speech::v1::CreateCustomClassRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.speech.v1.CreateCustomClassRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::speech::v1::CustomClass >

the result of the RPC. The response message type (google.cloud.speech.v1.CustomClass) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetCustomClass(std::string const &, Options)

Get a custom class.

Parameters
Name Description
name std::string const &

Required. The name of the custom class to retrieve. Format:
projects/{project}/locations/{location}/customClasses/{custom_class}

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::speech::v1::CustomClass >

the result of the RPC. The response message type (google.cloud.speech.v1.CustomClass) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetCustomClass(google::cloud::speech::v1::GetCustomClassRequest const &, Options)

Get a custom class.

Parameters
Name Description
request google::cloud::speech::v1::GetCustomClassRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.speech.v1.GetCustomClassRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::speech::v1::CustomClass >

the result of the RPC. The response message type (google.cloud.speech.v1.CustomClass) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListCustomClasses(std::string const &, Options)

List custom classes.

Parameters
Name Description
parent std::string const &

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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::speech::v1::CustomClass >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.speech.v1.CustomClass, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListCustomClasses(google::cloud::speech::v1::ListCustomClassesRequest, Options)

List custom classes.

Parameters
Name Description
request google::cloud::speech::v1::ListCustomClassesRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.speech.v1.ListCustomClassesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::speech::v1::CustomClass >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.speech.v1.CustomClass, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

UpdateCustomClass(google::cloud::speech::v1::CustomClass const &, google::protobuf::FieldMask const &, Options)

Update a custom class.

Parameters
Name Description
custom_class google::cloud::speech::v1::CustomClass const &

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 const &

The list of fields to be updated.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::speech::v1::CustomClass >

the result of the RPC. The response message type (google.cloud.speech.v1.CustomClass) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

UpdateCustomClass(google::cloud::speech::v1::UpdateCustomClassRequest const &, Options)

Update a custom class.

Parameters
Name Description
request google::cloud::speech::v1::UpdateCustomClassRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.speech.v1.UpdateCustomClassRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::speech::v1::CustomClass >

the result of the RPC. The response message type (google.cloud.speech.v1.CustomClass) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

DeleteCustomClass(std::string const &, Options)

Delete a custom class.

Parameters
Name Description
name std::string const &

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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

DeleteCustomClass(google::cloud::speech::v1::DeleteCustomClassRequest const &, Options)

Delete a custom class.

Parameters
Name Description
request google::cloud::speech::v1::DeleteCustomClassRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.speech.v1.DeleteCustomClassRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.