Package speech is an auto-generated package for the Cloud Speech-to-Text API.
Converts audio to text by applying powerful neural network models.
General documentation
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview . Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
ctx := context . Background () // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c , err := speech . NewClient ( ctx ) if err != nil { // TODO: Handle error. } defer c . Close ()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client
The following is an example of making an API call with the newly created client.
ctx := context . Background () // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c , err := speech . NewClient ( ctx ) if err != nil { // TODO: Handle error. } defer c . Close () req := & speechpb . BatchRecognizeRequest { // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#BatchRecognizeRequest. } op , err := c . BatchRecognize ( ctx , req ) if err != nil { // TODO: Handle error. } resp , err := op . Wait ( ctx ) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context
The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Functions
func DefaultAuthScopes
func
DefaultAuthScopes
()
[]
string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
BatchRecognizeOperation
type
BatchRecognizeOperation
struct
{
// contains filtered or unexported fields
}
BatchRecognizeOperation manages a long-running operation from BatchRecognize.
func (*BatchRecognizeOperation) Done
func
(
op
*
BatchRecognizeOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*BatchRecognizeOperation) Metadata
func
(
op
*
BatchRecognizeOperation
)
Metadata
()
(
*
speechpb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*BatchRecognizeOperation) Name
func
(
op
*
BatchRecognizeOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*BatchRecognizeOperation) Poll
func
(
op
*
BatchRecognizeOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
BatchRecognizeResponse
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*BatchRecognizeOperation) Wait
func
(
op
*
BatchRecognizeOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
BatchRecognizeResponse
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
CallOptions
type
CallOptions
struct
{
CreateRecognizer
[]
gax
.
CallOption
ListRecognizers
[]
gax
.
CallOption
GetRecognizer
[]
gax
.
CallOption
UpdateRecognizer
[]
gax
.
CallOption
DeleteRecognizer
[]
gax
.
CallOption
UndeleteRecognizer
[]
gax
.
CallOption
Recognize
[]
gax
.
CallOption
StreamingRecognize
[]
gax
.
CallOption
BatchRecognize
[]
gax
.
CallOption
GetConfig
[]
gax
.
CallOption
UpdateConfig
[]
gax
.
CallOption
CreateCustomClass
[]
gax
.
CallOption
ListCustomClasses
[]
gax
.
CallOption
GetCustomClass
[]
gax
.
CallOption
UpdateCustomClass
[]
gax
.
CallOption
DeleteCustomClass
[]
gax
.
CallOption
UndeleteCustomClass
[]
gax
.
CallOption
CreatePhraseSet
[]
gax
.
CallOption
ListPhraseSets
[]
gax
.
CallOption
GetPhraseSet
[]
gax
.
CallOption
UpdatePhraseSet
[]
gax
.
CallOption
DeletePhraseSet
[]
gax
.
CallOption
UndeletePhraseSet
[]
gax
.
CallOption
GetLocation
[]
gax
.
CallOption
ListLocations
[]
gax
.
CallOption
CancelOperation
[]
gax
.
CallOption
DeleteOperation
[]
gax
.
CallOption
GetOperation
[]
gax
.
CallOption
ListOperations
[]
gax
.
CallOption
}
CallOptions contains the retry settings for each method of Client.
Client
type
Client
struct
{
// The call options for this service.
CallOptions
*
CallOptions
// LROClient is used internally to handle long-running operations.
// It is exposed so that its CallOptions can be modified if required.
// Users should not Close this client.
LROClient
*
lroauto
.
OperationsClient
// contains filtered or unexported fields
}
Client is a client for interacting with Cloud Speech-to-Text API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Enables speech transcription and resource management.
func NewClient
NewClient creates a new speech client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Enables speech transcription and resource management.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
// TODO: Use client.
_
=
c
}
func NewRESTClient
NewRESTClient creates a new speech rest client.
Enables speech transcription and resource management.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewRESTClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
// TODO: Use client.
_
=
c
}
func (*Client) BatchRecognize
func
(
c
*
Client
)
BatchRecognize
(
ctx
context
.
Context
,
req
*
speechpb
.
BatchRecognizeRequest
,
opts
...
gax
.
CallOption
)
(
*
BatchRecognizeOperation
,
error
)
BatchRecognize performs batch asynchronous speech recognition: send a request with N audio files and receive a long running operation that can be polled to see when the transcriptions are finished.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
BatchRecognizeRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#BatchRecognizeRequest.
}
op
,
err
:=
c
.
BatchRecognize
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) BatchRecognizeOperation
func
(
c
*
Client
)
BatchRecognizeOperation
(
name
string
)
*
BatchRecognizeOperation
BatchRecognizeOperation returns a new BatchRecognizeOperation from a given name. The name must be that of a previously created BatchRecognizeOperation, possibly from a different process.
func (*Client) CancelOperation
func
(
c
*
Client
)
CancelOperation
(
ctx
context
.
Context
,
req
*
longrunningpb
.
CancelOperationRequest
,
opts
...
gax
.
CallOption
)
error
CancelOperation is a utility method from google.longrunning.Operations.
Example
package
main
import
(
"context"
longrunningpb
"cloud.google.com/go/longrunning/autogen/longrunningpb"
speech
"cloud.google.com/go/speech/apiv2"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& longrunningpb
.
CancelOperationRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err
=
c
.
CancelOperation
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
}
func (*Client) Close
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) Connection (deprecated)
func
(
c
*
Client
)
Connection
()
*
grpc
.
ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*Client) CreateCustomClass
func
(
c
*
Client
)
CreateCustomClass
(
ctx
context
.
Context
,
req
*
speechpb
.
CreateCustomClassRequest
,
opts
...
gax
.
CallOption
)
(
*
CreateCustomClassOperation
,
error
)
CreateCustomClass creates a CustomClass.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
CreateCustomClassRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#CreateCustomClassRequest.
}
op
,
err
:=
c
.
CreateCustomClass
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) CreateCustomClassOperation
func
(
c
*
Client
)
CreateCustomClassOperation
(
name
string
)
*
CreateCustomClassOperation
CreateCustomClassOperation returns a new CreateCustomClassOperation from a given name. The name must be that of a previously created CreateCustomClassOperation, possibly from a different process.
func (*Client) CreatePhraseSet
func
(
c
*
Client
)
CreatePhraseSet
(
ctx
context
.
Context
,
req
*
speechpb
.
CreatePhraseSetRequest
,
opts
...
gax
.
CallOption
)
(
*
CreatePhraseSetOperation
,
error
)
CreatePhraseSet creates a PhraseSet.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
CreatePhraseSetRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#CreatePhraseSetRequest.
}
op
,
err
:=
c
.
CreatePhraseSet
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) CreatePhraseSetOperation
func
(
c
*
Client
)
CreatePhraseSetOperation
(
name
string
)
*
CreatePhraseSetOperation
CreatePhraseSetOperation returns a new CreatePhraseSetOperation from a given name. The name must be that of a previously created CreatePhraseSetOperation, possibly from a different process.
func (*Client) CreateRecognizer
func
(
c
*
Client
)
CreateRecognizer
(
ctx
context
.
Context
,
req
*
speechpb
.
CreateRecognizerRequest
,
opts
...
gax
.
CallOption
)
(
*
CreateRecognizerOperation
,
error
)
CreateRecognizer creates a Recognizer.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
CreateRecognizerRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#CreateRecognizerRequest.
}
op
,
err
:=
c
.
CreateRecognizer
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) CreateRecognizerOperation
func
(
c
*
Client
)
CreateRecognizerOperation
(
name
string
)
*
CreateRecognizerOperation
CreateRecognizerOperation returns a new CreateRecognizerOperation from a given name. The name must be that of a previously created CreateRecognizerOperation, possibly from a different process.
func (*Client) DeleteCustomClass
func
(
c
*
Client
)
DeleteCustomClass
(
ctx
context
.
Context
,
req
*
speechpb
.
DeleteCustomClassRequest
,
opts
...
gax
.
CallOption
)
(
*
DeleteCustomClassOperation
,
error
)
DeleteCustomClass deletes the CustomClass.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
DeleteCustomClassRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#DeleteCustomClassRequest.
}
op
,
err
:=
c
.
DeleteCustomClass
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) DeleteCustomClassOperation
func
(
c
*
Client
)
DeleteCustomClassOperation
(
name
string
)
*
DeleteCustomClassOperation
DeleteCustomClassOperation returns a new DeleteCustomClassOperation from a given name. The name must be that of a previously created DeleteCustomClassOperation, possibly from a different process.
func (*Client) DeleteOperation
func
(
c
*
Client
)
DeleteOperation
(
ctx
context
.
Context
,
req
*
longrunningpb
.
DeleteOperationRequest
,
opts
...
gax
.
CallOption
)
error
DeleteOperation is a utility method from google.longrunning.Operations.
Example
package
main
import
(
"context"
longrunningpb
"cloud.google.com/go/longrunning/autogen/longrunningpb"
speech
"cloud.google.com/go/speech/apiv2"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& longrunningpb
.
DeleteOperationRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err
=
c
.
DeleteOperation
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
}
func (*Client) DeletePhraseSet
func
(
c
*
Client
)
DeletePhraseSet
(
ctx
context
.
Context
,
req
*
speechpb
.
DeletePhraseSetRequest
,
opts
...
gax
.
CallOption
)
(
*
DeletePhraseSetOperation
,
error
)
DeletePhraseSet deletes the PhraseSet.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
DeletePhraseSetRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#DeletePhraseSetRequest.
}
op
,
err
:=
c
.
DeletePhraseSet
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) DeletePhraseSetOperation
func
(
c
*
Client
)
DeletePhraseSetOperation
(
name
string
)
*
DeletePhraseSetOperation
DeletePhraseSetOperation returns a new DeletePhraseSetOperation from a given name. The name must be that of a previously created DeletePhraseSetOperation, possibly from a different process.
func (*Client) DeleteRecognizer
func
(
c
*
Client
)
DeleteRecognizer
(
ctx
context
.
Context
,
req
*
speechpb
.
DeleteRecognizerRequest
,
opts
...
gax
.
CallOption
)
(
*
DeleteRecognizerOperation
,
error
)
DeleteRecognizer deletes the Recognizer.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
DeleteRecognizerRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#DeleteRecognizerRequest.
}
op
,
err
:=
c
.
DeleteRecognizer
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) DeleteRecognizerOperation
func
(
c
*
Client
)
DeleteRecognizerOperation
(
name
string
)
*
DeleteRecognizerOperation
DeleteRecognizerOperation returns a new DeleteRecognizerOperation from a given name. The name must be that of a previously created DeleteRecognizerOperation, possibly from a different process.
func (*Client) GetConfig
func
(
c
*
Client
)
GetConfig
(
ctx
context
.
Context
,
req
*
speechpb
.
GetConfigRequest
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
Config
,
error
)
GetConfig returns the requested Config.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
GetConfigRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#GetConfigRequest.
}
resp
,
err
:=
c
.
GetConfig
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) GetCustomClass
func
(
c
*
Client
)
GetCustomClass
(
ctx
context
.
Context
,
req
*
speechpb
.
GetCustomClassRequest
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
CustomClass
,
error
)
GetCustomClass returns the requested CustomClass.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
GetCustomClassRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#GetCustomClassRequest.
}
resp
,
err
:=
c
.
GetCustomClass
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) GetLocation
func
(
c
*
Client
)
GetLocation
(
ctx
context
.
Context
,
req
*
locationpb
.
GetLocationRequest
,
opts
...
gax
.
CallOption
)
(
*
locationpb
.
Location
,
error
)
GetLocation gets information about a location.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
locationpb
"google.golang.org/genproto/googleapis/cloud/location"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& locationpb
.
GetLocationRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
}
resp
,
err
:=
c
.
GetLocation
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) GetOperation
func
(
c
*
Client
)
GetOperation
(
ctx
context
.
Context
,
req
*
longrunningpb
.
GetOperationRequest
,
opts
...
gax
.
CallOption
)
(
*
longrunningpb
.
Operation
,
error
)
GetOperation is a utility method from google.longrunning.Operations.
Example
package
main
import
(
"context"
longrunningpb
"cloud.google.com/go/longrunning/autogen/longrunningpb"
speech
"cloud.google.com/go/speech/apiv2"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& longrunningpb
.
GetOperationRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp
,
err
:=
c
.
GetOperation
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) GetPhraseSet
func
(
c
*
Client
)
GetPhraseSet
(
ctx
context
.
Context
,
req
*
speechpb
.
GetPhraseSetRequest
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
PhraseSet
,
error
)
GetPhraseSet returns the requested PhraseSet.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
GetPhraseSetRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#GetPhraseSetRequest.
}
resp
,
err
:=
c
.
GetPhraseSet
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) GetRecognizer
func
(
c
*
Client
)
GetRecognizer
(
ctx
context
.
Context
,
req
*
speechpb
.
GetRecognizerRequest
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
Recognizer
,
error
)
GetRecognizer returns the requested Recognizer. Fails with NOT_FOUND if the requested Recognizer doesn’t exist.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
GetRecognizerRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#GetRecognizerRequest.
}
resp
,
err
:=
c
.
GetRecognizer
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) ListCustomClasses
func
(
c
*
Client
)
ListCustomClasses
(
ctx
context
.
Context
,
req
*
speechpb
.
ListCustomClassesRequest
,
opts
...
gax
.
CallOption
)
*
CustomClassIterator
ListCustomClasses lists CustomClasses.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
"google.golang.org/api/iterator"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
ListCustomClassesRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#ListCustomClassesRequest.
}
it
:=
c
.
ListCustomClasses
(
ctx
,
req
)
for
{
resp
,
err
:=
it
.
Next
()
if
err
==
iterator
.
Done
{
break
}
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_
=
it
.
Response
.(
*
speechpb
.
ListCustomClassesResponse
)
}
}
func (*Client) ListLocations
func
(
c
*
Client
)
ListLocations
(
ctx
context
.
Context
,
req
*
locationpb
.
ListLocationsRequest
,
opts
...
gax
.
CallOption
)
*
LocationIterator
ListLocations lists information about the supported locations for this service.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
"google.golang.org/api/iterator"
locationpb
"google.golang.org/genproto/googleapis/cloud/location"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& locationpb
.
ListLocationsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it
:=
c
.
ListLocations
(
ctx
,
req
)
for
{
resp
,
err
:=
it
.
Next
()
if
err
==
iterator
.
Done
{
break
}
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_
=
it
.
Response
.(
*
locationpb
.
ListLocationsResponse
)
}
}
func (*Client) ListOperations
func
(
c
*
Client
)
ListOperations
(
ctx
context
.
Context
,
req
*
longrunningpb
.
ListOperationsRequest
,
opts
...
gax
.
CallOption
)
*
OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example
package
main
import
(
"context"
longrunningpb
"cloud.google.com/go/longrunning/autogen/longrunningpb"
speech
"cloud.google.com/go/speech/apiv2"
"google.golang.org/api/iterator"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& longrunningpb
.
ListOperationsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it
:=
c
.
ListOperations
(
ctx
,
req
)
for
{
resp
,
err
:=
it
.
Next
()
if
err
==
iterator
.
Done
{
break
}
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_
=
it
.
Response
.(
*
longrunningpb
.
ListOperationsResponse
)
}
}
func (*Client) ListPhraseSets
func
(
c
*
Client
)
ListPhraseSets
(
ctx
context
.
Context
,
req
*
speechpb
.
ListPhraseSetsRequest
,
opts
...
gax
.
CallOption
)
*
PhraseSetIterator
ListPhraseSets lists PhraseSets.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
"google.golang.org/api/iterator"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
ListPhraseSetsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#ListPhraseSetsRequest.
}
it
:=
c
.
ListPhraseSets
(
ctx
,
req
)
for
{
resp
,
err
:=
it
.
Next
()
if
err
==
iterator
.
Done
{
break
}
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_
=
it
.
Response
.(
*
speechpb
.
ListPhraseSetsResponse
)
}
}
func (*Client) ListRecognizers
func
(
c
*
Client
)
ListRecognizers
(
ctx
context
.
Context
,
req
*
speechpb
.
ListRecognizersRequest
,
opts
...
gax
.
CallOption
)
*
RecognizerIterator
ListRecognizers lists Recognizers.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
"google.golang.org/api/iterator"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
ListRecognizersRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#ListRecognizersRequest.
}
it
:=
c
.
ListRecognizers
(
ctx
,
req
)
for
{
resp
,
err
:=
it
.
Next
()
if
err
==
iterator
.
Done
{
break
}
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_
=
it
.
Response
.(
*
speechpb
.
ListRecognizersResponse
)
}
}
func (*Client) Recognize
func
(
c
*
Client
)
Recognize
(
ctx
context
.
Context
,
req
*
speechpb
.
RecognizeRequest
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
RecognizeResponse
,
error
)
Recognize performs synchronous Speech recognition: receive results after all audio has been sent and processed.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
RecognizeRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#RecognizeRequest.
}
resp
,
err
:=
c
.
Recognize
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) StreamingRecognize
func
(
c
*
Client
)
StreamingRecognize
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
speechpb
.
Speech_StreamingRecognizeClient
,
error
)
StreamingRecognize performs bidirectional streaming speech recognition: receive results while sending audio. This method is only available via the gRPC API (not REST).
This method is not supported for the REST transport.
Example
package
main
import
(
"context"
"io"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
stream
,
err
:=
c
.
StreamingRecognize
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
go
func
()
{
reqs
:=
[]
*
speechpb
.
StreamingRecognizeRequest
{
// TODO: Create requests.
}
for
_
,
req
:=
range
reqs
{
if
err
:=
stream
.
Send
(
req
);
err
!=
nil
{
// TODO: Handle error.
}
}
stream
.
CloseSend
()
}()
for
{
resp
,
err
:=
stream
.
Recv
()
if
err
==
io
.
EOF
{
break
}
if
err
!=
nil
{
// TODO: handle error.
}
// TODO: Use resp.
_
=
resp
}
}
func (*Client) UndeleteCustomClass
func
(
c
*
Client
)
UndeleteCustomClass
(
ctx
context
.
Context
,
req
*
speechpb
.
UndeleteCustomClassRequest
,
opts
...
gax
.
CallOption
)
(
*
UndeleteCustomClassOperation
,
error
)
UndeleteCustomClass undeletes the CustomClass.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
UndeleteCustomClassRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#UndeleteCustomClassRequest.
}
op
,
err
:=
c
.
UndeleteCustomClass
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) UndeleteCustomClassOperation
func
(
c
*
Client
)
UndeleteCustomClassOperation
(
name
string
)
*
UndeleteCustomClassOperation
UndeleteCustomClassOperation returns a new UndeleteCustomClassOperation from a given name. The name must be that of a previously created UndeleteCustomClassOperation, possibly from a different process.
func (*Client) UndeletePhraseSet
func
(
c
*
Client
)
UndeletePhraseSet
(
ctx
context
.
Context
,
req
*
speechpb
.
UndeletePhraseSetRequest
,
opts
...
gax
.
CallOption
)
(
*
UndeletePhraseSetOperation
,
error
)
UndeletePhraseSet undeletes the PhraseSet.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
UndeletePhraseSetRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#UndeletePhraseSetRequest.
}
op
,
err
:=
c
.
UndeletePhraseSet
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) UndeletePhraseSetOperation
func
(
c
*
Client
)
UndeletePhraseSetOperation
(
name
string
)
*
UndeletePhraseSetOperation
UndeletePhraseSetOperation returns a new UndeletePhraseSetOperation from a given name. The name must be that of a previously created UndeletePhraseSetOperation, possibly from a different process.
func (*Client) UndeleteRecognizer
func
(
c
*
Client
)
UndeleteRecognizer
(
ctx
context
.
Context
,
req
*
speechpb
.
UndeleteRecognizerRequest
,
opts
...
gax
.
CallOption
)
(
*
UndeleteRecognizerOperation
,
error
)
UndeleteRecognizer undeletes the Recognizer.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
UndeleteRecognizerRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#UndeleteRecognizerRequest.
}
op
,
err
:=
c
.
UndeleteRecognizer
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) UndeleteRecognizerOperation
func
(
c
*
Client
)
UndeleteRecognizerOperation
(
name
string
)
*
UndeleteRecognizerOperation
UndeleteRecognizerOperation returns a new UndeleteRecognizerOperation from a given name. The name must be that of a previously created UndeleteRecognizerOperation, possibly from a different process.
func (*Client) UpdateConfig
func
(
c
*
Client
)
UpdateConfig
(
ctx
context
.
Context
,
req
*
speechpb
.
UpdateConfigRequest
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
Config
,
error
)
UpdateConfig updates the Config.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
UpdateConfigRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#UpdateConfigRequest.
}
resp
,
err
:=
c
.
UpdateConfig
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) UpdateCustomClass
func
(
c
*
Client
)
UpdateCustomClass
(
ctx
context
.
Context
,
req
*
speechpb
.
UpdateCustomClassRequest
,
opts
...
gax
.
CallOption
)
(
*
UpdateCustomClassOperation
,
error
)
UpdateCustomClass updates the CustomClass.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
UpdateCustomClassRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#UpdateCustomClassRequest.
}
op
,
err
:=
c
.
UpdateCustomClass
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) UpdateCustomClassOperation
func
(
c
*
Client
)
UpdateCustomClassOperation
(
name
string
)
*
UpdateCustomClassOperation
UpdateCustomClassOperation returns a new UpdateCustomClassOperation from a given name. The name must be that of a previously created UpdateCustomClassOperation, possibly from a different process.
func (*Client) UpdatePhraseSet
func
(
c
*
Client
)
UpdatePhraseSet
(
ctx
context
.
Context
,
req
*
speechpb
.
UpdatePhraseSetRequest
,
opts
...
gax
.
CallOption
)
(
*
UpdatePhraseSetOperation
,
error
)
UpdatePhraseSet updates the PhraseSet.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
UpdatePhraseSetRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#UpdatePhraseSetRequest.
}
op
,
err
:=
c
.
UpdatePhraseSet
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) UpdatePhraseSetOperation
func
(
c
*
Client
)
UpdatePhraseSetOperation
(
name
string
)
*
UpdatePhraseSetOperation
UpdatePhraseSetOperation returns a new UpdatePhraseSetOperation from a given name. The name must be that of a previously created UpdatePhraseSetOperation, possibly from a different process.
func (*Client) UpdateRecognizer
func
(
c
*
Client
)
UpdateRecognizer
(
ctx
context
.
Context
,
req
*
speechpb
.
UpdateRecognizerRequest
,
opts
...
gax
.
CallOption
)
(
*
UpdateRecognizerOperation
,
error
)
UpdateRecognizer updates the Recognizer.
Example
package
main
import
(
"context"
speech
"cloud.google.com/go/speech/apiv2"
speechpb
"cloud.google.com/go/speech/apiv2/speechpb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
speech
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& speechpb
.
UpdateRecognizerRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/speech/apiv2/speechpb#UpdateRecognizerRequest.
}
op
,
err
:=
c
.
UpdateRecognizer
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) UpdateRecognizerOperation
func
(
c
*
Client
)
UpdateRecognizerOperation
(
name
string
)
*
UpdateRecognizerOperation
UpdateRecognizerOperation returns a new UpdateRecognizerOperation from a given name. The name must be that of a previously created UpdateRecognizerOperation, possibly from a different process.
CreateCustomClassOperation
type
CreateCustomClassOperation
struct
{
// contains filtered or unexported fields
}
CreateCustomClassOperation manages a long-running operation from CreateCustomClass.
func (*CreateCustomClassOperation) Done
func
(
op
*
CreateCustomClassOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*CreateCustomClassOperation) Metadata
func
(
op
*
CreateCustomClassOperation
)
Metadata
()
(
*
speechpb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateCustomClassOperation) Name
func
(
op
*
CreateCustomClassOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateCustomClassOperation) Poll
func
(
op
*
CreateCustomClassOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
CustomClass
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateCustomClassOperation) Wait
func
(
op
*
CreateCustomClassOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
CustomClass
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
CreatePhraseSetOperation
type
CreatePhraseSetOperation
struct
{
// contains filtered or unexported fields
}
CreatePhraseSetOperation manages a long-running operation from CreatePhraseSet.
func (*CreatePhraseSetOperation) Done
func
(
op
*
CreatePhraseSetOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*CreatePhraseSetOperation) Metadata
func
(
op
*
CreatePhraseSetOperation
)
Metadata
()
(
*
speechpb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreatePhraseSetOperation) Name
func
(
op
*
CreatePhraseSetOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreatePhraseSetOperation) Poll
func
(
op
*
CreatePhraseSetOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
PhraseSet
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreatePhraseSetOperation) Wait
func
(
op
*
CreatePhraseSetOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
PhraseSet
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
CreateRecognizerOperation
type
CreateRecognizerOperation
struct
{
// contains filtered or unexported fields
}
CreateRecognizerOperation manages a long-running operation from CreateRecognizer.
func (*CreateRecognizerOperation) Done
func
(
op
*
CreateRecognizerOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*CreateRecognizerOperation) Metadata
func
(
op
*
CreateRecognizerOperation
)
Metadata
()
(
*
speechpb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateRecognizerOperation) Name
func
(
op
*
CreateRecognizerOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateRecognizerOperation) Poll
func
(
op
*
CreateRecognizerOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
Recognizer
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateRecognizerOperation) Wait
func
(
op
*
CreateRecognizerOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
Recognizer
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
CustomClassIterator
type
CustomClassIterator
struct
{
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response
interface
{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch
func
(
pageSize
int
,
pageToken
string
)
(
results
[]
*
speechpb
.
CustomClass
,
nextPageToken
string
,
err
error
)
// contains filtered or unexported fields
}
CustomClassIterator manages a stream of *speechpb.CustomClass.
func (*CustomClassIterator) Next
func
(
it
*
CustomClassIterator
)
Next
()
(
*
speechpb
.
CustomClass
,
error
)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*CustomClassIterator) PageInfo
func
(
it
*
CustomClassIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
DeleteCustomClassOperation
type
DeleteCustomClassOperation
struct
{
// contains filtered or unexported fields
}
DeleteCustomClassOperation manages a long-running operation from DeleteCustomClass.
func (*DeleteCustomClassOperation) Done
func
(
op
*
DeleteCustomClassOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*DeleteCustomClassOperation) Metadata
func
(
op
*
DeleteCustomClassOperation
)
Metadata
()
(
*
speechpb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteCustomClassOperation) Name
func
(
op
*
DeleteCustomClassOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteCustomClassOperation) Poll
func
(
op
*
DeleteCustomClassOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
CustomClass
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteCustomClassOperation) Wait
func
(
op
*
DeleteCustomClassOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
CustomClass
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeletePhraseSetOperation
type
DeletePhraseSetOperation
struct
{
// contains filtered or unexported fields
}
DeletePhraseSetOperation manages a long-running operation from DeletePhraseSet.
func (*DeletePhraseSetOperation) Done
func
(
op
*
DeletePhraseSetOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*DeletePhraseSetOperation) Metadata
func
(
op
*
DeletePhraseSetOperation
)
Metadata
()
(
*
speechpb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeletePhraseSetOperation) Name
func
(
op
*
DeletePhraseSetOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeletePhraseSetOperation) Poll
func
(
op
*
DeletePhraseSetOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
PhraseSet
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeletePhraseSetOperation) Wait
func
(
op
*
DeletePhraseSetOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
PhraseSet
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteRecognizerOperation
type
DeleteRecognizerOperation
struct
{
// contains filtered or unexported fields
}
DeleteRecognizerOperation manages a long-running operation from DeleteRecognizer.
func (*DeleteRecognizerOperation) Done
func
(
op
*
DeleteRecognizerOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*DeleteRecognizerOperation) Metadata
func
(
op
*
DeleteRecognizerOperation
)
Metadata
()
(
*
speechpb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteRecognizerOperation) Name
func
(
op
*
DeleteRecognizerOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteRecognizerOperation) Poll
func
(
op
*
DeleteRecognizerOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
Recognizer
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteRecognizerOperation) Wait
func
(
op
*
DeleteRecognizerOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
Recognizer
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
LocationIterator
type
LocationIterator
struct
{
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response
interface
{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch
func
(
pageSize
int
,
pageToken
string
)
(
results
[]
*
locationpb
.
Location
,
nextPageToken
string
,
err
error
)
// contains filtered or unexported fields
}
LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator) Next
func
(
it
*
LocationIterator
)
Next
()
(
*
locationpb
.
Location
,
error
)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*LocationIterator) PageInfo
func
(
it
*
LocationIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
OperationIterator
type
OperationIterator
struct
{
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response
interface
{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch
func
(
pageSize
int
,
pageToken
string
)
(
results
[]
*
longrunningpb
.
Operation
,
nextPageToken
string
,
err
error
)
// contains filtered or unexported fields
}
OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) Next
func
(
it
*
OperationIterator
)
Next
()
(
*
longrunningpb
.
Operation
,
error
)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo
func
(
it
*
OperationIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
PhraseSetIterator
type
PhraseSetIterator
struct
{
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response
interface
{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch
func
(
pageSize
int
,
pageToken
string
)
(
results
[]
*
speechpb
.
PhraseSet
,
nextPageToken
string
,
err
error
)
// contains filtered or unexported fields
}
PhraseSetIterator manages a stream of *speechpb.PhraseSet.
func (*PhraseSetIterator) Next
func
(
it
*
PhraseSetIterator
)
Next
()
(
*
speechpb
.
PhraseSet
,
error
)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*PhraseSetIterator) PageInfo
func
(
it
*
PhraseSetIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
RecognizerIterator
type
RecognizerIterator
struct
{
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response
interface
{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch
func
(
pageSize
int
,
pageToken
string
)
(
results
[]
*
speechpb
.
Recognizer
,
nextPageToken
string
,
err
error
)
// contains filtered or unexported fields
}
RecognizerIterator manages a stream of *speechpb.Recognizer.
func (*RecognizerIterator) Next
func
(
it
*
RecognizerIterator
)
Next
()
(
*
speechpb
.
Recognizer
,
error
)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*RecognizerIterator) PageInfo
func
(
it
*
RecognizerIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
UndeleteCustomClassOperation
type
UndeleteCustomClassOperation
struct
{
// contains filtered or unexported fields
}
UndeleteCustomClassOperation manages a long-running operation from UndeleteCustomClass.
func (*UndeleteCustomClassOperation) Done
func
(
op
*
UndeleteCustomClassOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*UndeleteCustomClassOperation) Metadata
func
(
op
*
UndeleteCustomClassOperation
)
Metadata
()
(
*
speechpb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UndeleteCustomClassOperation) Name
func
(
op
*
UndeleteCustomClassOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UndeleteCustomClassOperation) Poll
func
(
op
*
UndeleteCustomClassOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
CustomClass
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UndeleteCustomClassOperation) Wait
func
(
op
*
UndeleteCustomClassOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
CustomClass
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
UndeletePhraseSetOperation
type
UndeletePhraseSetOperation
struct
{
// contains filtered or unexported fields
}
UndeletePhraseSetOperation manages a long-running operation from UndeletePhraseSet.
func (*UndeletePhraseSetOperation) Done
func
(
op
*
UndeletePhraseSetOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*UndeletePhraseSetOperation) Metadata
func
(
op
*
UndeletePhraseSetOperation
)
Metadata
()
(
*
speechpb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UndeletePhraseSetOperation) Name
func
(
op
*
UndeletePhraseSetOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UndeletePhraseSetOperation) Poll
func
(
op
*
UndeletePhraseSetOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
PhraseSet
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UndeletePhraseSetOperation) Wait
func
(
op
*
UndeletePhraseSetOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
PhraseSet
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
UndeleteRecognizerOperation
type
UndeleteRecognizerOperation
struct
{
// contains filtered or unexported fields
}
UndeleteRecognizerOperation manages a long-running operation from UndeleteRecognizer.
func (*UndeleteRecognizerOperation) Done
func
(
op
*
UndeleteRecognizerOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*UndeleteRecognizerOperation) Metadata
func
(
op
*
UndeleteRecognizerOperation
)
Metadata
()
(
*
speechpb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UndeleteRecognizerOperation) Name
func
(
op
*
UndeleteRecognizerOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UndeleteRecognizerOperation) Poll
func
(
op
*
UndeleteRecognizerOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
Recognizer
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UndeleteRecognizerOperation) Wait
func
(
op
*
UndeleteRecognizerOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
Recognizer
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
UpdateCustomClassOperation
type
UpdateCustomClassOperation
struct
{
// contains filtered or unexported fields
}
UpdateCustomClassOperation manages a long-running operation from UpdateCustomClass.
func (*UpdateCustomClassOperation) Done
func
(
op
*
UpdateCustomClassOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*UpdateCustomClassOperation) Metadata
func
(
op
*
UpdateCustomClassOperation
)
Metadata
()
(
*
speechpb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateCustomClassOperation) Name
func
(
op
*
UpdateCustomClassOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateCustomClassOperation) Poll
func
(
op
*
UpdateCustomClassOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
CustomClass
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateCustomClassOperation) Wait
func
(
op
*
UpdateCustomClassOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
CustomClass
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
UpdatePhraseSetOperation
type
UpdatePhraseSetOperation
struct
{
// contains filtered or unexported fields
}
UpdatePhraseSetOperation manages a long-running operation from UpdatePhraseSet.
func (*UpdatePhraseSetOperation) Done
func
(
op
*
UpdatePhraseSetOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*UpdatePhraseSetOperation) Metadata
func
(
op
*
UpdatePhraseSetOperation
)
Metadata
()
(
*
speechpb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdatePhraseSetOperation) Name
func
(
op
*
UpdatePhraseSetOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdatePhraseSetOperation) Poll
func
(
op
*
UpdatePhraseSetOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
PhraseSet
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdatePhraseSetOperation) Wait
func
(
op
*
UpdatePhraseSetOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
PhraseSet
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
UpdateRecognizerOperation
type
UpdateRecognizerOperation
struct
{
// contains filtered or unexported fields
}
UpdateRecognizerOperation manages a long-running operation from UpdateRecognizer.
func (*UpdateRecognizerOperation) Done
func
(
op
*
UpdateRecognizerOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*UpdateRecognizerOperation) Metadata
func
(
op
*
UpdateRecognizerOperation
)
Metadata
()
(
*
speechpb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateRecognizerOperation) Name
func
(
op
*
UpdateRecognizerOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateRecognizerOperation) Poll
func
(
op
*
UpdateRecognizerOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
Recognizer
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateRecognizerOperation) Wait
func
(
op
*
UpdateRecognizerOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
speechpb
.
Recognizer
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.