Documentation ¶
Overview ¶
Package speech is an auto-generated package for the Cloud Speech-to-Text API.
Converts audio to text by applying powerful neural network models.
NOTE: This package is in beta. It is not stable, and may be subject to changes.
General documentation ¶
For information about setting deadlines, reusing contexts, and more please visit https://pkg.go.dev/cloud.google.com/go.
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.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
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.
Index ¶
- func DefaultAuthScopes() []string
- type BatchRecognizeOperation
- func (op *BatchRecognizeOperation) Done() bool
- func (op *BatchRecognizeOperation) Metadata() (*speechpb.OperationMetadata, error)
- func (op *BatchRecognizeOperation) Name() string
- func (op *BatchRecognizeOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*speechpb.BatchRecognizeResponse, error)
- func (op *BatchRecognizeOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*speechpb.BatchRecognizeResponse, error)
- type CallOptions
- type Client
- func (c *Client) BatchRecognize(ctx context.Context, req *speechpb.BatchRecognizeRequest, ...) (*BatchRecognizeOperation, error)
- func (c *Client) BatchRecognizeOperation(name string) *BatchRecognizeOperation
- func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *Client) Close() error
- func (c *Client) Connection() *grpc.ClientConndeprecated
- func (c *Client) CreateCustomClass(ctx context.Context, req *speechpb.CreateCustomClassRequest, ...) (*CreateCustomClassOperation, error)
- func (c *Client) CreateCustomClassOperation(name string) *CreateCustomClassOperation
- func (c *Client) CreatePhraseSet(ctx context.Context, req *speechpb.CreatePhraseSetRequest, ...) (*CreatePhraseSetOperation, error)
- func (c *Client) CreatePhraseSetOperation(name string) *CreatePhraseSetOperation
- func (c *Client) CreateRecognizer(ctx context.Context, req *speechpb.CreateRecognizerRequest, ...) (*CreateRecognizerOperation, error)
- func (c *Client) CreateRecognizerOperation(name string) *CreateRecognizerOperation
- func (c *Client) DeleteCustomClass(ctx context.Context, req *speechpb.DeleteCustomClassRequest, ...) (*DeleteCustomClassOperation, error)
- func (c *Client) DeleteCustomClassOperation(name string) *DeleteCustomClassOperation
- func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *Client) DeletePhraseSet(ctx context.Context, req *speechpb.DeletePhraseSetRequest, ...) (*DeletePhraseSetOperation, error)
- func (c *Client) DeletePhraseSetOperation(name string) *DeletePhraseSetOperation
- func (c *Client) DeleteRecognizer(ctx context.Context, req *speechpb.DeleteRecognizerRequest, ...) (*DeleteRecognizerOperation, error)
- func (c *Client) DeleteRecognizerOperation(name string) *DeleteRecognizerOperation
- func (c *Client) GetConfig(ctx context.Context, req *speechpb.GetConfigRequest, opts ...gax.CallOption) (*speechpb.Config, error)
- func (c *Client) GetCustomClass(ctx context.Context, req *speechpb.GetCustomClassRequest, ...) (*speechpb.CustomClass, error)
- func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *Client) GetPhraseSet(ctx context.Context, req *speechpb.GetPhraseSetRequest, opts ...gax.CallOption) (*speechpb.PhraseSet, error)
- func (c *Client) GetRecognizer(ctx context.Context, req *speechpb.GetRecognizerRequest, ...) (*speechpb.Recognizer, error)
- func (c *Client) ListCustomClasses(ctx context.Context, req *speechpb.ListCustomClassesRequest, ...) *CustomClassIterator
- func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *Client) ListPhraseSets(ctx context.Context, req *speechpb.ListPhraseSetsRequest, ...) *PhraseSetIterator
- func (c *Client) ListRecognizers(ctx context.Context, req *speechpb.ListRecognizersRequest, ...) *RecognizerIterator
- func (c *Client) Recognize(ctx context.Context, req *speechpb.RecognizeRequest, opts ...gax.CallOption) (*speechpb.RecognizeResponse, error)
- func (c *Client) StreamingRecognize(ctx context.Context, opts ...gax.CallOption) (speechpb.Speech_StreamingRecognizeClient, error)
- func (c *Client) UndeleteCustomClass(ctx context.Context, req *speechpb.UndeleteCustomClassRequest, ...) (*UndeleteCustomClassOperation, error)
- func (c *Client) UndeleteCustomClassOperation(name string) *UndeleteCustomClassOperation
- func (c *Client) UndeletePhraseSet(ctx context.Context, req *speechpb.UndeletePhraseSetRequest, ...) (*UndeletePhraseSetOperation, error)
- func (c *Client) UndeletePhraseSetOperation(name string) *UndeletePhraseSetOperation
- func (c *Client) UndeleteRecognizer(ctx context.Context, req *speechpb.UndeleteRecognizerRequest, ...) (*UndeleteRecognizerOperation, error)
- func (c *Client) UndeleteRecognizerOperation(name string) *UndeleteRecognizerOperation
- func (c *Client) UpdateConfig(ctx context.Context, req *speechpb.UpdateConfigRequest, opts ...gax.CallOption) (*speechpb.Config, error)
- func (c *Client) UpdateCustomClass(ctx context.Context, req *speechpb.UpdateCustomClassRequest, ...) (*UpdateCustomClassOperation, error)
- func (c *Client) UpdateCustomClassOperation(name string) *UpdateCustomClassOperation
- func (c *Client) UpdatePhraseSet(ctx context.Context, req *speechpb.UpdatePhraseSetRequest, ...) (*UpdatePhraseSetOperation, error)
- func (c *Client) UpdatePhraseSetOperation(name string) *UpdatePhraseSetOperation
- func (c *Client) UpdateRecognizer(ctx context.Context, req *speechpb.UpdateRecognizerRequest, ...) (*UpdateRecognizerOperation, error)
- func (c *Client) UpdateRecognizerOperation(name string) *UpdateRecognizerOperation
- type CreateCustomClassOperation
- func (op *CreateCustomClassOperation) Done() bool
- func (op *CreateCustomClassOperation) Metadata() (*speechpb.OperationMetadata, error)
- func (op *CreateCustomClassOperation) Name() string
- func (op *CreateCustomClassOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*speechpb.CustomClass, error)
- func (op *CreateCustomClassOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*speechpb.CustomClass, error)
- type CreatePhraseSetOperation
- func (op *CreatePhraseSetOperation) Done() bool
- func (op *CreatePhraseSetOperation) Metadata() (*speechpb.OperationMetadata, error)
- func (op *CreatePhraseSetOperation) Name() string
- func (op *CreatePhraseSetOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*speechpb.PhraseSet, error)
- func (op *CreatePhraseSetOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*speechpb.PhraseSet, error)
- type CreateRecognizerOperation
- func (op *CreateRecognizerOperation) Done() bool
- func (op *CreateRecognizerOperation) Metadata() (*speechpb.OperationMetadata, error)
- func (op *CreateRecognizerOperation) Name() string
- func (op *CreateRecognizerOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*speechpb.Recognizer, error)
- func (op *CreateRecognizerOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*speechpb.Recognizer, error)
- type CustomClassIterator
- type DeleteCustomClassOperation
- func (op *DeleteCustomClassOperation) Done() bool
- func (op *DeleteCustomClassOperation) Metadata() (*speechpb.OperationMetadata, error)
- func (op *DeleteCustomClassOperation) Name() string
- func (op *DeleteCustomClassOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*speechpb.CustomClass, error)
- func (op *DeleteCustomClassOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*speechpb.CustomClass, error)
- type DeletePhraseSetOperation
- func (op *DeletePhraseSetOperation) Done() bool
- func (op *DeletePhraseSetOperation) Metadata() (*speechpb.OperationMetadata, error)
- func (op *DeletePhraseSetOperation) Name() string
- func (op *DeletePhraseSetOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*speechpb.PhraseSet, error)
- func (op *DeletePhraseSetOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*speechpb.PhraseSet, error)
- type DeleteRecognizerOperation
- func (op *DeleteRecognizerOperation) Done() bool
- func (op *DeleteRecognizerOperation) Metadata() (*speechpb.OperationMetadata, error)
- func (op *DeleteRecognizerOperation) Name() string
- func (op *DeleteRecognizerOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*speechpb.Recognizer, error)
- func (op *DeleteRecognizerOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*speechpb.Recognizer, error)
- type LocationIterator
- type OperationIterator
- type PhraseSetIterator
- type RecognizerIterator
- type UndeleteCustomClassOperation
- func (op *UndeleteCustomClassOperation) Done() bool
- func (op *UndeleteCustomClassOperation) Metadata() (*speechpb.OperationMetadata, error)
- func (op *UndeleteCustomClassOperation) Name() string
- func (op *UndeleteCustomClassOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*speechpb.CustomClass, error)
- func (op *UndeleteCustomClassOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*speechpb.CustomClass, error)
- type UndeletePhraseSetOperation
- func (op *UndeletePhraseSetOperation) Done() bool
- func (op *UndeletePhraseSetOperation) Metadata() (*speechpb.OperationMetadata, error)
- func (op *UndeletePhraseSetOperation) Name() string
- func (op *UndeletePhraseSetOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*speechpb.PhraseSet, error)
- func (op *UndeletePhraseSetOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*speechpb.PhraseSet, error)
- type UndeleteRecognizerOperation
- func (op *UndeleteRecognizerOperation) Done() bool
- func (op *UndeleteRecognizerOperation) Metadata() (*speechpb.OperationMetadata, error)
- func (op *UndeleteRecognizerOperation) Name() string
- func (op *UndeleteRecognizerOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*speechpb.Recognizer, error)
- func (op *UndeleteRecognizerOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*speechpb.Recognizer, error)
- type UpdateCustomClassOperation
- func (op *UpdateCustomClassOperation) Done() bool
- func (op *UpdateCustomClassOperation) Metadata() (*speechpb.OperationMetadata, error)
- func (op *UpdateCustomClassOperation) Name() string
- func (op *UpdateCustomClassOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*speechpb.CustomClass, error)
- func (op *UpdateCustomClassOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*speechpb.CustomClass, error)
- type UpdatePhraseSetOperation
- func (op *UpdatePhraseSetOperation) Done() bool
- func (op *UpdatePhraseSetOperation) Metadata() (*speechpb.OperationMetadata, error)
- func (op *UpdatePhraseSetOperation) Name() string
- func (op *UpdatePhraseSetOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*speechpb.PhraseSet, error)
- func (op *UpdatePhraseSetOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*speechpb.PhraseSet, error)
- type UpdateRecognizerOperation
- func (op *UpdateRecognizerOperation) Done() bool
- func (op *UpdateRecognizerOperation) Metadata() (*speechpb.OperationMetadata, error)
- func (op *UpdateRecognizerOperation) Name() string
- func (op *UpdateRecognizerOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*speechpb.Recognizer, error)
- func (op *UpdateRecognizerOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*speechpb.Recognizer, error)
Examples ¶
- Client.BatchRecognize
- Client.CancelOperation
- Client.CreateCustomClass
- Client.CreatePhraseSet
- Client.CreateRecognizer
- Client.DeleteCustomClass
- Client.DeleteOperation
- Client.DeletePhraseSet
- Client.DeleteRecognizer
- Client.GetConfig
- Client.GetCustomClass
- Client.GetLocation
- Client.GetOperation
- Client.GetPhraseSet
- Client.GetRecognizer
- Client.ListCustomClasses
- Client.ListLocations
- Client.ListOperations
- Client.ListPhraseSets
- Client.ListRecognizers
- Client.Recognize
- Client.StreamingRecognize
- Client.UndeleteCustomClass
- Client.UndeletePhraseSet
- Client.UndeleteRecognizer
- Client.UpdateConfig
- Client.UpdateCustomClass
- Client.UpdatePhraseSet
- Client.UpdateRecognizer
- NewClient
- NewRESTClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type 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.
type 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.
type 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 }
Output:
func NewRESTClient ¶ added in v1.11.0
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 }
Output:
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 }
Output:
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. } }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
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. } }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
func (*Client) GetLocation ¶ added in v1.15.0
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 }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
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 } }
Output:
func (*Client) ListLocations ¶ added in v1.15.0
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 } }
Output:
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 } }
Output:
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 } }
Output:
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 } }
Output:
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 }
Output:
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 } }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
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 }
Output:
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.
type 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.
type 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.
type 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.
type 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.
type 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.
type 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.
type 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.
type LocationIterator ¶ added in v1.15.0
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 ¶ added in v1.15.0
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 ¶ added in v1.15.0
func (it *LocationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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.
type 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.
type 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.
type 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.
type 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.
type 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.
type 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.
type 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.
type 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.