- 1.58.0 (latest)
- 1.57.1
- 1.56.0
- 1.55.0
- 1.54.3
- 1.53.0
- 1.52.0
- 1.51.0
- 1.50.0
- 1.49.0
- 1.48.2
- 1.47.0
- 1.46.0
- 1.45.0
- 1.44.3
- 1.42.0
- 1.41.0
- 1.40.1
- 1.39.0
- 1.38.0
- 1.37.0
- 1.36.0
- 1.35.0
- 1.34.0
- 1.33.0
- 1.32.1
- 1.31.0
- 1.30.0
- 1.29.0
- 1.28.0
- 1.27.0
- 1.26.0
- 1.23.0
- 1.22.0
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.0
- 1.16.1
- 1.15.0
- 1.14.0
- 1.13.0
- 1.12.1
- 1.11.0
- 1.10.0
- 1.9.0
- 1.8.1
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.0
- 0.1.0
Package dialogflow is an auto-generated package for the Dialogflow API.
Builds conversational interfaces (for example, chatbots, and voice-powered apps and devices).
Example usage
To get started with this package, create a client.
ctx := context.Background() c, err := dialogflow.NewAgentsClient(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() c, err := dialogflow.NewAgentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dialogflowpb.GetAgentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#GetAgentRequest. } resp, err := c.GetAgent(ctx, req) 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.
For information about setting deadlines, reusing contexts, and more please visit https://pkg.go.dev/cloud.google.com/go.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
AgentIterator
type AgentIterator 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 []*dialogflowpb.Agent, nextPageToken string, err error)
// contains filtered or unexported fields
}
AgentIterator manages a stream of *dialogflowpb.Agent.
func (*AgentIterator) Next
func (it *AgentIterator) Next() (*dialogflowpb.Agent, 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 (*AgentIterator) PageInfo
func (it *AgentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
AgentsCallOptions
type AgentsCallOptions struct {
GetAgent []gax.CallOption
SetAgent []gax.CallOption
DeleteAgent []gax.CallOption
SearchAgents []gax.CallOption
TrainAgent []gax.CallOption
ExportAgent []gax.CallOption
ImportAgent []gax.CallOption
RestoreAgent []gax.CallOption
GetValidationResult []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
AgentsCallOptions contains the retry settings for each method of AgentsClient.
AgentsClient
type AgentsClient struct {
// The call options for this service.
CallOptions *AgentsCallOptions
// 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
}
AgentsClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing Agents.
func NewAgentsClient
func NewAgentsClient(ctx context.Context, opts ...option.ClientOption) (*AgentsClient, error)
NewAgentsClient creates a new agents client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing Agents.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*AgentsClient) CancelOperation
func (c *AgentsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
longrunningpb "google.golang.org/genproto/googleapis/longrunning"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AgentsClient) Close
func (c *AgentsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AgentsClient) Connection
func (c *AgentsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*AgentsClient) DeleteAgent
func (c *AgentsClient) DeleteAgent(ctx context.Context, req *dialogflowpb.DeleteAgentRequest, opts ...gax.CallOption) error
DeleteAgent deletes the specified agent.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.DeleteAgentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#DeleteAgentRequest.
}
err = c.DeleteAgent(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AgentsClient) ExportAgent
func (c *AgentsClient) ExportAgent(ctx context.Context, req *dialogflowpb.ExportAgentRequest, opts ...gax.CallOption) (*ExportAgentOperation, error)
ExportAgent exports the specified agent to a ZIP file.
This method is a long-running operation (at https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned Operation type has the following method-specific fields:
metadata: An empty Struct message (at https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
response: ExportAgentResponse
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.ExportAgentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#ExportAgentRequest.
}
op, err := c.ExportAgent(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentsClient) ExportAgentOperation
func (c *AgentsClient) ExportAgentOperation(name string) *ExportAgentOperation
ExportAgentOperation returns a new ExportAgentOperation from a given name. The name must be that of a previously created ExportAgentOperation, possibly from a different process.
func (*AgentsClient) GetAgent
func (c *AgentsClient) GetAgent(ctx context.Context, req *dialogflowpb.GetAgentRequest, opts ...gax.CallOption) (*dialogflowpb.Agent, error)
GetAgent retrieves the specified agent.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.GetAgentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#GetAgentRequest.
}
resp, err := c.GetAgent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentsClient) GetLocation
func (c *AgentsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAgentsClient(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 (*AgentsClient) GetOperation
func (c *AgentsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
longrunningpb "google.golang.org/genproto/googleapis/longrunning"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentsClient) GetValidationResult
func (c *AgentsClient) GetValidationResult(ctx context.Context, req *dialogflowpb.GetValidationResultRequest, opts ...gax.CallOption) (*dialogflowpb.ValidationResult, error)
GetValidationResult gets agent validation result. Agent validation is performed during training time and is updated automatically when training is completed.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.GetValidationResultRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#GetValidationResultRequest.
}
resp, err := c.GetValidationResult(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentsClient) ImportAgent
func (c *AgentsClient) ImportAgent(ctx context.Context, req *dialogflowpb.ImportAgentRequest, opts ...gax.CallOption) (*ImportAgentOperation, error)
ImportAgent imports the specified agent from a ZIP file.
Uploads new intents and entity types without deleting the existing ones. Intents and entity types with the same name are replaced with the new versions from ImportAgentRequest. After the import, the imported draft agent will be trained automatically (unless disabled in agent settings). However, once the import is done, training may not be completed yet. Please call TrainAgent and wait for the operation it returns in order to train explicitly.
This method is a long-running operation (at https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned Operation type has the following method-specific fields:
metadata: An empty Struct message (at https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
response: An Empty message (at https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
The operation only tracks when importing is complete, not when it is done training.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.ImportAgentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#ImportAgentRequest.
}
op, err := c.ImportAgent(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*AgentsClient) ImportAgentOperation
func (c *AgentsClient) ImportAgentOperation(name string) *ImportAgentOperation
ImportAgentOperation returns a new ImportAgentOperation from a given name. The name must be that of a previously created ImportAgentOperation, possibly from a different process.
func (*AgentsClient) ListLocations
func (c *AgentsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAgentsClient(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
}
}
func (*AgentsClient) ListOperations
func (c *AgentsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
"google.golang.org/api/iterator"
longrunningpb "google.golang.org/genproto/googleapis/longrunning"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#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
}
}
func (*AgentsClient) RestoreAgent
func (c *AgentsClient) RestoreAgent(ctx context.Context, req *dialogflowpb.RestoreAgentRequest, opts ...gax.CallOption) (*RestoreAgentOperation, error)
RestoreAgent restores the specified agent from a ZIP file.
Replaces the current agent version with a new one. All the intents and entity types in the older version are deleted. After the restore, the restored draft agent will be trained automatically (unless disabled in agent settings). However, once the restore is done, training may not be completed yet. Please call TrainAgent and wait for the operation it returns in order to train explicitly.
This method is a long-running operation (at https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned Operation type has the following method-specific fields:
metadata: An empty Struct message (at https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
response: An Empty message (at https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
The operation only tracks when restoring is complete, not when it is done training.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.RestoreAgentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#RestoreAgentRequest.
}
op, err := c.RestoreAgent(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*AgentsClient) RestoreAgentOperation
func (c *AgentsClient) RestoreAgentOperation(name string) *RestoreAgentOperation
RestoreAgentOperation returns a new RestoreAgentOperation from a given name. The name must be that of a previously created RestoreAgentOperation, possibly from a different process.
func (*AgentsClient) SearchAgents
func (c *AgentsClient) SearchAgents(ctx context.Context, req *dialogflowpb.SearchAgentsRequest, opts ...gax.CallOption) *AgentIterator
SearchAgents returns the list of agents.
Since there is at most one conversational agent per project, this method is useful primarily for listing all agents across projects the caller has access to. One can achieve that with a wildcard project collection id “-”. Refer to List Sub-Collections (at https://cloud.google.com/apis/design/design_patterns#list_sub-collections).
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
"google.golang.org/api/iterator"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.SearchAgentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#SearchAgentsRequest.
}
it := c.SearchAgents(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AgentsClient) SetAgent
func (c *AgentsClient) SetAgent(ctx context.Context, req *dialogflowpb.SetAgentRequest, opts ...gax.CallOption) (*dialogflowpb.Agent, error)
SetAgent creates/updates the specified agent.
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.SetAgentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#SetAgentRequest.
}
resp, err := c.SetAgent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentsClient) TrainAgent
func (c *AgentsClient) TrainAgent(ctx context.Context, req *dialogflowpb.TrainAgentRequest, opts ...gax.CallOption) (*TrainAgentOperation, error)
TrainAgent trains the specified agent.
This method is a long-running operation (at https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned Operation type has the following method-specific fields:
metadata: An empty Struct message (at https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
response: An Empty message (at https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the training documentation (at https://cloud.google.com/dialogflow/es/docs/training).
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.TrainAgentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#TrainAgentRequest.
}
op, err := c.TrainAgent(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*AgentsClient) TrainAgentOperation
func (c *AgentsClient) TrainAgentOperation(name string) *TrainAgentOperation
TrainAgentOperation returns a new TrainAgentOperation from a given name. The name must be that of a previously created TrainAgentOperation, possibly from a different process.
AnswerRecordIterator
type AnswerRecordIterator 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 []*dialogflowpb.AnswerRecord, nextPageToken string, err error)
// contains filtered or unexported fields
}
AnswerRecordIterator manages a stream of *dialogflowpb.AnswerRecord.
func (*AnswerRecordIterator) Next
func (it *AnswerRecordIterator) Next() (*dialogflowpb.AnswerRecord, 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 (*AnswerRecordIterator) PageInfo
func (it *AnswerRecordIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
AnswerRecordsCallOptions
type AnswerRecordsCallOptions struct {
ListAnswerRecords []gax.CallOption
UpdateAnswerRecord []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
AnswerRecordsCallOptions contains the retry settings for each method of AnswerRecordsClient.
AnswerRecordsClient
type AnswerRecordsClient struct {
// The call options for this service.
CallOptions *AnswerRecordsCallOptions
// contains filtered or unexported fields
}
AnswerRecordsClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing AnswerRecords.
func NewAnswerRecordsClient
func NewAnswerRecordsClient(ctx context.Context, opts ...option.ClientOption) (*AnswerRecordsClient, error)
NewAnswerRecordsClient creates a new answer records client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing AnswerRecords.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAnswerRecordsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*AnswerRecordsClient) CancelOperation
func (c *AnswerRecordsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
longrunningpb "google.golang.org/genproto/googleapis/longrunning"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAnswerRecordsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AnswerRecordsClient) Close
func (c *AnswerRecordsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AnswerRecordsClient) Connection
func (c *AnswerRecordsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*AnswerRecordsClient) GetLocation
func (c *AnswerRecordsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAnswerRecordsClient(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 (*AnswerRecordsClient) GetOperation
func (c *AnswerRecordsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
longrunningpb "google.golang.org/genproto/googleapis/longrunning"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAnswerRecordsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AnswerRecordsClient) ListAnswerRecords
func (c *AnswerRecordsClient) ListAnswerRecords(ctx context.Context, req *dialogflowpb.ListAnswerRecordsRequest, opts ...gax.CallOption) *AnswerRecordIterator
ListAnswerRecords returns the list of all answer records in the specified project in reverse chronological order.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
"google.golang.org/api/iterator"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAnswerRecordsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.ListAnswerRecordsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#ListAnswerRecordsRequest.
}
it := c.ListAnswerRecords(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AnswerRecordsClient) ListLocations
func (c *AnswerRecordsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAnswerRecordsClient(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
}
}
func (*AnswerRecordsClient) ListOperations
func (c *AnswerRecordsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
"google.golang.org/api/iterator"
longrunningpb "google.golang.org/genproto/googleapis/longrunning"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAnswerRecordsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#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
}
}
func (*AnswerRecordsClient) UpdateAnswerRecord
func (c *AnswerRecordsClient) UpdateAnswerRecord(ctx context.Context, req *dialogflowpb.UpdateAnswerRecordRequest, opts ...gax.CallOption) (*dialogflowpb.AnswerRecord, error)
UpdateAnswerRecord updates the specified answer record.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewAnswerRecordsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.UpdateAnswerRecordRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#UpdateAnswerRecordRequest.
}
resp, err := c.UpdateAnswerRecord(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
BatchCreateEntitiesOperation
type BatchCreateEntitiesOperation struct {
// contains filtered or unexported fields
}
BatchCreateEntitiesOperation manages a long-running operation from BatchCreateEntities.
func (*BatchCreateEntitiesOperation) Done
func (op *BatchCreateEntitiesOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*BatchCreateEntitiesOperation) Metadata
func (op *BatchCreateEntitiesOperation) Metadata() (*structpb.Struct, 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 (*BatchCreateEntitiesOperation) Name
func (op *BatchCreateEntitiesOperation) 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 (*BatchCreateEntitiesOperation) Poll
func (op *BatchCreateEntitiesOperation) Poll(ctx context.Context, opts ...gax.CallOption) 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 (*BatchCreateEntitiesOperation) Wait
func (op *BatchCreateEntitiesOperation) Wait(ctx context.Context, opts ...gax.CallOption) 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.
BatchDeleteEntitiesOperation
type BatchDeleteEntitiesOperation struct {
// contains filtered or unexported fields
}
BatchDeleteEntitiesOperation manages a long-running operation from BatchDeleteEntities.
func (*BatchDeleteEntitiesOperation) Done
func (op *BatchDeleteEntitiesOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*BatchDeleteEntitiesOperation) Metadata
func (op *BatchDeleteEntitiesOperation) Metadata() (*structpb.Struct, 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 (*BatchDeleteEntitiesOperation) Name
func (op *BatchDeleteEntitiesOperation) 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 (*BatchDeleteEntitiesOperation) Poll
func (op *BatchDeleteEntitiesOperation) Poll(ctx context.Context, opts ...gax.CallOption) 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 (*BatchDeleteEntitiesOperation) Wait
func (op *BatchDeleteEntitiesOperation) Wait(ctx context.Context, opts ...gax.CallOption) 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.
BatchDeleteEntityTypesOperation
type BatchDeleteEntityTypesOperation struct {
// contains filtered or unexported fields
}
BatchDeleteEntityTypesOperation manages a long-running operation from BatchDeleteEntityTypes.
func (*BatchDeleteEntityTypesOperation) Done
func (op *BatchDeleteEntityTypesOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*BatchDeleteEntityTypesOperation) Metadata
func (op *BatchDeleteEntityTypesOperation) Metadata() (*structpb.Struct, 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 (*BatchDeleteEntityTypesOperation) Name
func (op *BatchDeleteEntityTypesOperation) 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 (*BatchDeleteEntityTypesOperation) Poll
func (op *BatchDeleteEntityTypesOperation) Poll(ctx context.Context, opts ...gax.CallOption) 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 (*BatchDeleteEntityTypesOperation) Wait
func (op *BatchDeleteEntityTypesOperation) Wait(ctx context.Context, opts ...gax.CallOption) 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.
BatchDeleteIntentsOperation
type BatchDeleteIntentsOperation struct {
// contains filtered or unexported fields
}
BatchDeleteIntentsOperation manages a long-running operation from BatchDeleteIntents.
func (*BatchDeleteIntentsOperation) Done
func (op *BatchDeleteIntentsOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*BatchDeleteIntentsOperation) Metadata
func (op *BatchDeleteIntentsOperation) Metadata() (*structpb.Struct, 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 (*BatchDeleteIntentsOperation) Name
func (op *BatchDeleteIntentsOperation) 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 (*BatchDeleteIntentsOperation) Poll
func (op *BatchDeleteIntentsOperation) Poll(ctx context.Context, opts ...gax.CallOption) 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 (*BatchDeleteIntentsOperation) Wait
func (op *BatchDeleteIntentsOperation) Wait(ctx context.Context, opts ...gax.CallOption) 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.
BatchUpdateEntitiesOperation
type BatchUpdateEntitiesOperation struct {
// contains filtered or unexported fields
}
BatchUpdateEntitiesOperation manages a long-running operation from BatchUpdateEntities.
func (*BatchUpdateEntitiesOperation) Done
func (op *BatchUpdateEntitiesOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*BatchUpdateEntitiesOperation) Metadata
func (op *BatchUpdateEntitiesOperation) Metadata() (*structpb.Struct, 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 (*BatchUpdateEntitiesOperation) Name
func (op *BatchUpdateEntitiesOperation) 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 (*BatchUpdateEntitiesOperation) Poll
func (op *BatchUpdateEntitiesOperation) Poll(ctx context.Context, opts ...gax.CallOption) 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 (*BatchUpdateEntitiesOperation) Wait
func (op *BatchUpdateEntitiesOperation) Wait(ctx context.Context, opts ...gax.CallOption) 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.
BatchUpdateEntityTypesOperation
type BatchUpdateEntityTypesOperation struct {
// contains filtered or unexported fields
}
BatchUpdateEntityTypesOperation manages a long-running operation from BatchUpdateEntityTypes.
func (*BatchUpdateEntityTypesOperation) Done
func (op *BatchUpdateEntityTypesOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*BatchUpdateEntityTypesOperation) Metadata
func (op *BatchUpdateEntityTypesOperation) Metadata() (*structpb.Struct, 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 (*BatchUpdateEntityTypesOperation) Name
func (op *BatchUpdateEntityTypesOperation) 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 (*BatchUpdateEntityTypesOperation) Poll
func (op *BatchUpdateEntityTypesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.BatchUpdateEntityTypesResponse, 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 (*BatchUpdateEntityTypesOperation) Wait
func (op *BatchUpdateEntityTypesOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.BatchUpdateEntityTypesResponse, 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.
BatchUpdateIntentsOperation
type BatchUpdateIntentsOperation struct {
// contains filtered or unexported fields
}
BatchUpdateIntentsOperation manages a long-running operation from BatchUpdateIntents.
func (*BatchUpdateIntentsOperation) Done
func (op *BatchUpdateIntentsOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*BatchUpdateIntentsOperation) Metadata
func (op *BatchUpdateIntentsOperation) Metadata() (*structpb.Struct, 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 (*BatchUpdateIntentsOperation) Name
func (op *BatchUpdateIntentsOperation) 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 (*BatchUpdateIntentsOperation) Poll
func (op *BatchUpdateIntentsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.BatchUpdateIntentsResponse, 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 (*BatchUpdateIntentsOperation) Wait
func (op *BatchUpdateIntentsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.BatchUpdateIntentsResponse, 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.
ClearSuggestionFeatureConfigOperation
type ClearSuggestionFeatureConfigOperation struct {
// contains filtered or unexported fields
}
ClearSuggestionFeatureConfigOperation manages a long-running operation from ClearSuggestionFeatureConfig.
func (*ClearSuggestionFeatureConfigOperation) Done
func (op *ClearSuggestionFeatureConfigOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ClearSuggestionFeatureConfigOperation) Metadata
func (op *ClearSuggestionFeatureConfigOperation) Metadata() (*dialogflowpb.ClearSuggestionFeatureConfigOperationMetadata, 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 (*ClearSuggestionFeatureConfigOperation) Name
func (op *ClearSuggestionFeatureConfigOperation) 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 (*ClearSuggestionFeatureConfigOperation) Poll
func (op *ClearSuggestionFeatureConfigOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.ConversationProfile, 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 (*ClearSuggestionFeatureConfigOperation) Wait
func (op *ClearSuggestionFeatureConfigOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dialogflowpb.ConversationProfile, 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.
ContextIterator
type ContextIterator 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 []*dialogflowpb.Context, nextPageToken string, err error)
// contains filtered or unexported fields
}
ContextIterator manages a stream of *dialogflowpb.Context.
func (*ContextIterator) Next
func (it *ContextIterator) Next() (*dialogflowpb.Context, 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 (*ContextIterator) PageInfo
func (it *ContextIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
ContextsCallOptions
type ContextsCallOptions struct {
ListContexts []gax.CallOption
GetContext []gax.CallOption
CreateContext []gax.CallOption
UpdateContext []gax.CallOption
DeleteContext []gax.CallOption
DeleteAllContexts []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
ContextsCallOptions contains the retry settings for each method of ContextsClient.
ContextsClient
type ContextsClient struct {
// The call options for this service.
CallOptions *ContextsCallOptions
// contains filtered or unexported fields
}
ContextsClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing Contexts.
func NewContextsClient
func NewContextsClient(ctx context.Context, opts ...option.ClientOption) (*ContextsClient, error)
NewContextsClient creates a new contexts client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing Contexts.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewContextsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ContextsClient) CancelOperation
func (c *ContextsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
longrunningpb "google.golang.org/genproto/googleapis/longrunning"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewContextsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ContextsClient) Close
func (c *ContextsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ContextsClient) Connection
func (c *ContextsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*ContextsClient) CreateContext
func (c *ContextsClient) CreateContext(ctx context.Context, req *dialogflowpb.CreateContextRequest, opts ...gax.CallOption) (*dialogflowpb.Context, error)
CreateContext creates a context.
If the specified context already exists, overrides the context.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewContextsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.CreateContextRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#CreateContextRequest.
}
resp, err := c.CreateContext(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ContextsClient) DeleteAllContexts
func (c *ContextsClient) DeleteAllContexts(ctx context.Context, req *dialogflowpb.DeleteAllContextsRequest, opts ...gax.CallOption) error
DeleteAllContexts deletes all active contexts in the specified session.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewContextsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.DeleteAllContextsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#DeleteAllContextsRequest.
}
err = c.DeleteAllContexts(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ContextsClient) DeleteContext
func (c *ContextsClient) DeleteContext(ctx context.Context, req *dialogflowpb.DeleteContextRequest, opts ...gax.CallOption) error
DeleteContext deletes the specified context.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewContextsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.DeleteContextRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#DeleteContextRequest.
}
err = c.DeleteContext(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ContextsClient) GetContext
func (c *ContextsClient) GetContext(ctx context.Context, req *dialogflowpb.GetContextRequest, opts ...gax.CallOption) (*dialogflowpb.Context, error)
GetContext retrieves the specified context.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewContextsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.GetContextRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#GetContextRequest.
}
resp, err := c.GetContext(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ContextsClient) GetLocation
func (c *ContextsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewContextsClient(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 (*ContextsClient) GetOperation
func (c *ContextsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
longrunningpb "google.golang.org/genproto/googleapis/longrunning"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewContextsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ContextsClient) ListContexts
func (c *ContextsClient) ListContexts(ctx context.Context, req *dialogflowpb.ListContextsRequest, opts ...gax.CallOption) *ContextIterator
ListContexts returns the list of all contexts in the specified session.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
"google.golang.org/api/iterator"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewContextsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.ListContextsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#ListContextsRequest.
}
it := c.ListContexts(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ContextsClient) ListLocations
func (c *ContextsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewContextsClient(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
}
}
func (*ContextsClient) ListOperations
func (c *ContextsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
"google.golang.org/api/iterator"
longrunningpb "google.golang.org/genproto/googleapis/longrunning"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewContextsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#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
}
}
func (*ContextsClient) UpdateContext
func (c *ContextsClient) UpdateContext(ctx context.Context, req *dialogflowpb.UpdateContextRequest, opts ...gax.CallOption) (*dialogflowpb.Context, error)
UpdateContext updates the specified context.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewContextsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.UpdateContextRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#UpdateContextRequest.
}
resp, err := c.UpdateContext(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
ConversationDatasetIterator
type ConversationDatasetIterator 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 []*dialogflowpb.ConversationDataset, nextPageToken string, err error)
// contains filtered or unexported fields
}
ConversationDatasetIterator manages a stream of *dialogflowpb.ConversationDataset.
func (*ConversationDatasetIterator) Next
func (it *ConversationDatasetIterator) Next() (*dialogflowpb.ConversationDataset, 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 (*ConversationDatasetIterator) PageInfo
func (it *ConversationDatasetIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
ConversationDatasetsCallOptions
type ConversationDatasetsCallOptions struct {
CreateConversationDataset []gax.CallOption
GetConversationDataset []gax.CallOption
ListConversationDatasets []gax.CallOption
DeleteConversationDataset []gax.CallOption
ImportConversationData []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
ConversationDatasetsCallOptions contains the retry settings for each method of ConversationDatasetsClient.
ConversationDatasetsClient
type ConversationDatasetsClient struct {
// The call options for this service.
CallOptions *ConversationDatasetsCallOptions
// 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
}
ConversationDatasetsClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Conversation datasets.
Conversation datasets contain raw conversation files and their customizable metadata that can be used for model training.
func NewConversationDatasetsClient
func NewConversationDatasetsClient(ctx context.Context, opts ...option.ClientOption) (*ConversationDatasetsClient, error)
NewConversationDatasetsClient creates a new conversation datasets client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Conversation datasets.
Conversation datasets contain raw conversation files and their customizable metadata that can be used for model training.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationDatasetsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ConversationDatasetsClient) CancelOperation
func (c *ConversationDatasetsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
longrunningpb "google.golang.org/genproto/googleapis/longrunning"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationDatasetsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ConversationDatasetsClient) Close
func (c *ConversationDatasetsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ConversationDatasetsClient) Connection
func (c *ConversationDatasetsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*ConversationDatasetsClient) CreateConversationDataset
func (c *ConversationDatasetsClient) CreateConversationDataset(ctx context.Context, req *dialogflowpb.CreateConversationDatasetRequest, opts ...gax.CallOption) (*CreateConversationDatasetOperation, error)
CreateConversationDataset creates a new conversation dataset.
This method is a long-running operation (at https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned Operation type has the following method-specific fields:
metadata: CreateConversationDatasetOperationMetadata
response: ConversationDataset
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationDatasetsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.CreateConversationDatasetRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#CreateConversationDatasetRequest.
}
op, err := c.CreateConversationDataset(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConversationDatasetsClient) CreateConversationDatasetOperation
func (c *ConversationDatasetsClient) CreateConversationDatasetOperation(name string) *CreateConversationDatasetOperation
CreateConversationDatasetOperation returns a new CreateConversationDatasetOperation from a given name. The name must be that of a previously created CreateConversationDatasetOperation, possibly from a different process.
func (*ConversationDatasetsClient) DeleteConversationDataset
func (c *ConversationDatasetsClient) DeleteConversationDataset(ctx context.Context, req *dialogflowpb.DeleteConversationDatasetRequest, opts ...gax.CallOption) (*DeleteConversationDatasetOperation, error)
DeleteConversationDataset deletes the specified conversation dataset.
This method is a long-running operation (at https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned Operation type has the following method-specific fields:
metadata: DeleteConversationDatasetOperationMetadata
response: An Empty message (at https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationDatasetsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.DeleteConversationDatasetRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#DeleteConversationDatasetRequest.
}
op, err := c.DeleteConversationDataset(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ConversationDatasetsClient) DeleteConversationDatasetOperation
func (c *ConversationDatasetsClient) DeleteConversationDatasetOperation(name string) *DeleteConversationDatasetOperation
DeleteConversationDatasetOperation returns a new DeleteConversationDatasetOperation from a given name. The name must be that of a previously created DeleteConversationDatasetOperation, possibly from a different process.
func (*ConversationDatasetsClient) GetConversationDataset
func (c *ConversationDatasetsClient) GetConversationDataset(ctx context.Context, req *dialogflowpb.GetConversationDatasetRequest, opts ...gax.CallOption) (*dialogflowpb.ConversationDataset, error)
GetConversationDataset retrieves the specified conversation dataset.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationDatasetsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.GetConversationDatasetRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#GetConversationDatasetRequest.
}
resp, err := c.GetConversationDataset(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConversationDatasetsClient) GetLocation
func (c *ConversationDatasetsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationDatasetsClient(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 (*ConversationDatasetsClient) GetOperation
func (c *ConversationDatasetsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
longrunningpb "google.golang.org/genproto/googleapis/longrunning"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationDatasetsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConversationDatasetsClient) ImportConversationData
func (c *ConversationDatasetsClient) ImportConversationData(ctx context.Context, req *dialogflowpb.ImportConversationDataRequest, opts ...gax.CallOption) (*ImportConversationDataOperation, error)
ImportConversationData import data into the specified conversation dataset. Note that it is not allowed to import data to a conversation dataset that already has data in it.
This method is a long-running operation (at https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned Operation type has the following method-specific fields:
metadata: ImportConversationDataOperationMetadata
response: ImportConversationDataOperationResponse
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationDatasetsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.ImportConversationDataRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#ImportConversationDataRequest.
}
op, err := c.ImportConversationData(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConversationDatasetsClient) ImportConversationDataOperation
func (c *ConversationDatasetsClient) ImportConversationDataOperation(name string) *ImportConversationDataOperation
ImportConversationDataOperation returns a new ImportConversationDataOperation from a given name. The name must be that of a previously created ImportConversationDataOperation, possibly from a different process.
func (*ConversationDatasetsClient) ListConversationDatasets
func (c *ConversationDatasetsClient) ListConversationDatasets(ctx context.Context, req *dialogflowpb.ListConversationDatasetsRequest, opts ...gax.CallOption) *ConversationDatasetIterator
ListConversationDatasets returns the list of all conversation datasets in the specified project and location.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
"google.golang.org/api/iterator"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationDatasetsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.ListConversationDatasetsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#ListConversationDatasetsRequest.
}
it := c.ListConversationDatasets(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ConversationDatasetsClient) ListLocations
func (c *ConversationDatasetsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationDatasetsClient(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
}
}
func (*ConversationDatasetsClient) ListOperations
func (c *ConversationDatasetsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
"google.golang.org/api/iterator"
longrunningpb "google.golang.org/genproto/googleapis/longrunning"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationDatasetsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#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
}
}
ConversationIterator
type ConversationIterator 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 []*dialogflowpb.Conversation, nextPageToken string, err error)
// contains filtered or unexported fields
}
ConversationIterator manages a stream of *dialogflowpb.Conversation.
func (*ConversationIterator) Next
func (it *ConversationIterator) Next() (*dialogflowpb.Conversation, 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 (*ConversationIterator) PageInfo
func (it *ConversationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
ConversationModelEvaluationIterator
type ConversationModelEvaluationIterator 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 []*dialogflowpb.ConversationModelEvaluation, nextPageToken string, err error)
// contains filtered or unexported fields
}
ConversationModelEvaluationIterator manages a stream of *dialogflowpb.ConversationModelEvaluation.
func (*ConversationModelEvaluationIterator) Next
func (it *ConversationModelEvaluationIterator) Next() (*dialogflowpb.ConversationModelEvaluation, 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 (*ConversationModelEvaluationIterator) PageInfo
func (it *ConversationModelEvaluationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
ConversationModelIterator
type ConversationModelIterator 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 []*dialogflowpb.ConversationModel, nextPageToken string, err error)
// contains filtered or unexported fields
}
ConversationModelIterator manages a stream of *dialogflowpb.ConversationModel.
func (*ConversationModelIterator) Next
func (it *ConversationModelIterator) Next() (*dialogflowpb.ConversationModel, 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 (*ConversationModelIterator) PageInfo
func (it *ConversationModelIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
ConversationModelsCallOptions
type ConversationModelsCallOptions struct {
CreateConversationModel []gax.CallOption
GetConversationModel []gax.CallOption
ListConversationModels []gax.CallOption
DeleteConversationModel []gax.CallOption
DeployConversationModel []gax.CallOption
UndeployConversationModel []gax.CallOption
GetConversationModelEvaluation []gax.CallOption
ListConversationModelEvaluations []gax.CallOption
CreateConversationModelEvaluation []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
ConversationModelsCallOptions contains the retry settings for each method of ConversationModelsClient.
ConversationModelsClient
type ConversationModelsClient struct {
// The call options for this service.
CallOptions *ConversationModelsCallOptions
// 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
}
ConversationModelsClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Manages a collection of models for human agent assistant.
func NewConversationModelsClient
func NewConversationModelsClient(ctx context.Context, opts ...option.ClientOption) (*ConversationModelsClient, error)
NewConversationModelsClient creates a new conversation models client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Manages a collection of models for human agent assistant.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationModelsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ConversationModelsClient) CancelOperation
func (c *ConversationModelsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
longrunningpb "google.golang.org/genproto/googleapis/longrunning"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationModelsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ConversationModelsClient) Close
func (c *ConversationModelsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ConversationModelsClient) Connection
func (c *ConversationModelsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*ConversationModelsClient) CreateConversationModel
func (c *ConversationModelsClient) CreateConversationModel(ctx context.Context, req *dialogflowpb.CreateConversationModelRequest, opts ...gax.CallOption) (*CreateConversationModelOperation, error)
CreateConversationModel creates a model.
This method is a long-running operation (at https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned Operation type has the following method-specific fields:
metadata: CreateConversationModelOperationMetadata
response: ConversationModel
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationModelsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.CreateConversationModelRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#CreateConversationModelRequest.
}
op, err := c.CreateConversationModel(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConversationModelsClient) CreateConversationModelEvaluation
func (c *ConversationModelsClient) CreateConversationModelEvaluation(ctx context.Context, req *dialogflowpb.CreateConversationModelEvaluationRequest, opts ...gax.CallOption) (*CreateConversationModelEvaluationOperation, error)
CreateConversationModelEvaluation creates evaluation of a conversation model.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationModelsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.CreateConversationModelEvaluationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#CreateConversationModelEvaluationRequest.
}
op, err := c.CreateConversationModelEvaluation(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConversationModelsClient) CreateConversationModelEvaluationOperation
func (c *ConversationModelsClient) CreateConversationModelEvaluationOperation(name string) *CreateConversationModelEvaluationOperation
CreateConversationModelEvaluationOperation returns a new CreateConversationModelEvaluationOperation from a given name. The name must be that of a previously created CreateConversationModelEvaluationOperation, possibly from a different process.
func (*ConversationModelsClient) CreateConversationModelOperation
func (c *ConversationModelsClient) CreateConversationModelOperation(name string) *CreateConversationModelOperation
CreateConversationModelOperation returns a new CreateConversationModelOperation from a given name. The name must be that of a previously created CreateConversationModelOperation, possibly from a different process.
func (*ConversationModelsClient) DeleteConversationModel
func (c *ConversationModelsClient) DeleteConversationModel(ctx context.Context, req *dialogflowpb.DeleteConversationModelRequest, opts ...gax.CallOption) (*DeleteConversationModelOperation, error)
DeleteConversationModel deletes a model.
This method is a long-running operation (at https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned Operation type has the following method-specific fields:
metadata: DeleteConversationModelOperationMetadata
response: An Empty message (at https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationModelsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.DeleteConversationModelRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#DeleteConversationModelRequest.
}
op, err := c.DeleteConversationModel(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ConversationModelsClient) DeleteConversationModelOperation
func (c *ConversationModelsClient) DeleteConversationModelOperation(name string) *DeleteConversationModelOperation
DeleteConversationModelOperation returns a new DeleteConversationModelOperation from a given name. The name must be that of a previously created DeleteConversationModelOperation, possibly from a different process.
func (*ConversationModelsClient) DeployConversationModel
func (c *ConversationModelsClient) DeployConversationModel(ctx context.Context, req *dialogflowpb.DeployConversationModelRequest, opts ...gax.CallOption) (*DeployConversationModelOperation, error)
DeployConversationModel deploys a model. If a model is already deployed, deploying it has no effect. A model can only serve prediction requests after it gets deployed. For article suggestion, custom model will not be used unless it is deployed.
This method is a long-running operation (at https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned Operation type has the following method-specific fields:
metadata: DeployConversationModelOperationMetadata
response: An Empty message (at https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationModelsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.DeployConversationModelRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#DeployConversationModelRequest.
}
op, err := c.DeployConversationModel(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ConversationModelsClient) DeployConversationModelOperation
func (c *ConversationModelsClient) DeployConversationModelOperation(name string) *DeployConversationModelOperation
DeployConversationModelOperation returns a new DeployConversationModelOperation from a given name. The name must be that of a previously created DeployConversationModelOperation, possibly from a different process.
func (*ConversationModelsClient) GetConversationModel
func (c *ConversationModelsClient) GetConversationModel(ctx context.Context, req *dialogflowpb.GetConversationModelRequest, opts ...gax.CallOption) (*dialogflowpb.ConversationModel, error)
GetConversationModel gets conversation model.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationModelsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.GetConversationModelRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#GetConversationModelRequest.
}
resp, err := c.GetConversationModel(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConversationModelsClient) GetConversationModelEvaluation
func (c *ConversationModelsClient) GetConversationModelEvaluation(ctx context.Context, req *dialogflowpb.GetConversationModelEvaluationRequest, opts ...gax.CallOption) (*dialogflowpb.ConversationModelEvaluation, error)
GetConversationModelEvaluation gets an evaluation of conversation model.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationModelsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.GetConversationModelEvaluationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#GetConversationModelEvaluationRequest.
}
resp, err := c.GetConversationModelEvaluation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConversationModelsClient) GetLocation
func (c *ConversationModelsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationModelsClient(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 (*ConversationModelsClient) GetOperation
func (c *ConversationModelsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
longrunningpb "google.golang.org/genproto/googleapis/longrunning"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationModelsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConversationModelsClient) ListConversationModelEvaluations
func (c *ConversationModelsClient) ListConversationModelEvaluations(ctx context.Context, req *dialogflowpb.ListConversationModelEvaluationsRequest, opts ...gax.CallOption) *ConversationModelEvaluationIterator
ListConversationModelEvaluations lists evaluations of a conversation model.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
"google.golang.org/api/iterator"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationModelsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.ListConversationModelEvaluationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#ListConversationModelEvaluationsRequest.
}
it := c.ListConversationModelEvaluations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ConversationModelsClient) ListConversationModels
func (c *ConversationModelsClient) ListConversationModels(ctx context.Context, req *dialogflowpb.ListConversationModelsRequest, opts ...gax.CallOption) *ConversationModelIterator
ListConversationModels lists conversation models.
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
"google.golang.org/api/iterator"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationModelsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.ListConversationModelsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#ListConversationModelsRequest.
}
it := c.ListConversationModels(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ConversationModelsClient) ListLocations
func (c *ConversationModelsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationModelsClient(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
}
}
func (*ConversationModelsClient) ListOperations
func (c *ConversationModelsClient) 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"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
"google.golang.org/api/iterator"
longrunningpb "google.golang.org/genproto/googleapis/longrunning"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationModelsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#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
}
}
func (*ConversationModelsClient) UndeployConversationModel
func (c *ConversationModelsClient) UndeployConversationModel(ctx context.Context, req *dialogflowpb.UndeployConversationModelRequest, opts ...gax.CallOption) (*UndeployConversationModelOperation, error)
UndeployConversationModel undeploys a model. If the model is not deployed this method has no effect. If the model is currently being used:
For article suggestion, article suggestion will fallback to the default model if model is undeployed.
This method is a long-running operation (at https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned Operation type has the following method-specific fields:
metadata: UndeployConversationModelOperationMetadata
response: An Empty message (at https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Example
package main
import (
"context"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
)
func main() {
ctx := context.Background()
c, err := dialogflow.NewConversationModelsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &dialogflowpb.UndeployConversationModelRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/dialogflow/v2#UndeployConversationModelRequest.
}
op, err := c.UndeployConversationModel(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*ConversationModelsClient) UndeployConversationModelOperation
func (c *ConversationModelsClient) UndeployConversationModelOperation(name string) *UndeployConversationModelOperation
UndeployConversationModelOperation returns a new UndeployConversationModelOperation from a given name. The name must be that of a previously created UndeployConversationModelOperation, possibly from a different process.
ConversationProfileIterator
type ConversationProfileIterator 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 []*dialogflowpb.ConversationProfile, nextPageToken string, err error)
// contains filtered or unexported fields
}
ConversationProfileIterator manages a stream of *dialogflowpb.ConversationProfile.
func (*ConversationProfileIterator) Next
func (it *ConversationProfileIterator) Next() (*dialogflowpb.ConversationProfile, 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 (*ConversationProfileIterator) PageInfo
func (it *ConversationProfileIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
ConversationProfilesCallOptions
type ConversationProfilesCallOptions struct {
ListConversationProfiles []gax.CallOption
GetConversationProfile []gax.CallOption
CreateConversationProfile []gax.CallOption
UpdateConversationProfile []gax.CallOption
DeleteConversationProfile []gax.CallOption
SetSuggestionFeatureConfig []gax.CallOption
ClearSuggestionFeatureConfig []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
ConversationProfilesCallOptions contains the retry settings for each method of ConversationProfilesClient.
ConversationProfilesClient
type ConversationProfilesClient struct {
// The call options for this service.
CallOptions *ConversationProfilesCallOptions
// 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
}
ConversationProfilesClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing ConversationProfiles.
func NewConversationProfilesClient
func NewConversationProfilesClient(ctx context.Context, opts ...option.ClientOption) (*ConversationProfilesClient, error)
NewConversationProfilesClient creates a new conversation profiles client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing ConversationProfiles.
Example
package