package cx
import "cloud.google.com/go/dialogflow/cx/apiv3beta1"
Package cx is an auto-generated package for the Dialogflow API.
Builds conversational interfaces (for example, chatbots, and voice-powered apps and devices).
NOTE: This package is in beta. It is not stable, and may be subject to changes.
General documentation
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
// go get cloud.google.com/go/dialogflow/cx/apiv3beta1@latest ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := cx.NewPagesClient(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, mentioned above.
req := &cxpb.CreatePageRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreatePageRequest. } resp, err := c.CreatePage(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context
The ctx passed to NewPagesClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Index ¶
- func DefaultAuthScopes() []string
- type AgentIterator
- func (it *AgentIterator) All() iter.Seq2[*cxpb.Agent, error]
- func (it *AgentIterator) Next() (*cxpb.Agent, error)
- func (it *AgentIterator) PageInfo() *iterator.PageInfo
- type AgentsCallOptions
- type AgentsClient
- func NewAgentsClient(ctx context.Context, opts ...option.ClientOption) (*AgentsClient, error)
- func NewAgentsRESTClient(ctx context.Context, opts ...option.ClientOption) (*AgentsClient, error)
- func (c *AgentsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *AgentsClient) Close() error
- func (c *AgentsClient) Connection() *grpc.ClientConn
- func (c *AgentsClient) CreateAgent(ctx context.Context, req *cxpb.CreateAgentRequest, opts ...gax.CallOption) (*cxpb.Agent, error)
- func (c *AgentsClient) DeleteAgent(ctx context.Context, req *cxpb.DeleteAgentRequest, opts ...gax.CallOption) error
- func (c *AgentsClient) ExportAgent(ctx context.Context, req *cxpb.ExportAgentRequest, opts ...gax.CallOption) (*ExportAgentOperation, error)
- func (c *AgentsClient) ExportAgentOperation(name string) *ExportAgentOperation
- func (c *AgentsClient) GetAgent(ctx context.Context, req *cxpb.GetAgentRequest, opts ...gax.CallOption) (*cxpb.Agent, error)
- func (c *AgentsClient) GetAgentValidationResult(ctx context.Context, req *cxpb.GetAgentValidationResultRequest, opts ...gax.CallOption) (*cxpb.AgentValidationResult, error)
- func (c *AgentsClient) GetGenerativeSettings(ctx context.Context, req *cxpb.GetGenerativeSettingsRequest, opts ...gax.CallOption) (*cxpb.GenerativeSettings, error)
- func (c *AgentsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *AgentsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *AgentsClient) ListAgents(ctx context.Context, req *cxpb.ListAgentsRequest, opts ...gax.CallOption) *AgentIterator
- func (c *AgentsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *AgentsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *AgentsClient) RestoreAgent(ctx context.Context, req *cxpb.RestoreAgentRequest, opts ...gax.CallOption) (*RestoreAgentOperation, error)
- func (c *AgentsClient) RestoreAgentOperation(name string) *RestoreAgentOperation
- func (c *AgentsClient) UpdateAgent(ctx context.Context, req *cxpb.UpdateAgentRequest, opts ...gax.CallOption) (*cxpb.Agent, error)
- func (c *AgentsClient) UpdateGenerativeSettings(ctx context.Context, req *cxpb.UpdateGenerativeSettingsRequest, opts ...gax.CallOption) (*cxpb.GenerativeSettings, error)
- func (c *AgentsClient) ValidateAgent(ctx context.Context, req *cxpb.ValidateAgentRequest, opts ...gax.CallOption) (*cxpb.AgentValidationResult, error)
- type BatchRunTestCasesOperation
- func (op *BatchRunTestCasesOperation) Done() bool
- func (op *BatchRunTestCasesOperation) Metadata() (*cxpb.BatchRunTestCasesMetadata, error)
- func (op *BatchRunTestCasesOperation) Name() string
- func (op *BatchRunTestCasesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.BatchRunTestCasesResponse, error)
- func (op *BatchRunTestCasesOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.BatchRunTestCasesResponse, error)
- type ChangelogIterator
- func (it *ChangelogIterator) All() iter.Seq2[*cxpb.Changelog, error]
- func (it *ChangelogIterator) Next() (*cxpb.Changelog, error)
- func (it *ChangelogIterator) PageInfo() *iterator.PageInfo
- type ChangelogsCallOptions
- type ChangelogsClient
- func NewChangelogsClient(ctx context.Context, opts ...option.ClientOption) (*ChangelogsClient, error)
- func NewChangelogsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ChangelogsClient, error)
- func (c *ChangelogsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *ChangelogsClient) Close() error
- func (c *ChangelogsClient) Connection() *grpc.ClientConn
- func (c *ChangelogsClient) GetChangelog(ctx context.Context, req *cxpb.GetChangelogRequest, opts ...gax.CallOption) (*cxpb.Changelog, error)
- func (c *ChangelogsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *ChangelogsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *ChangelogsClient) ListChangelogs(ctx context.Context, req *cxpb.ListChangelogsRequest, opts ...gax.CallOption) *ChangelogIterator
- func (c *ChangelogsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *ChangelogsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- type ContinuousTestResultIterator
- func (it *ContinuousTestResultIterator) All() iter.Seq2[*cxpb.ContinuousTestResult, error]
- func (it *ContinuousTestResultIterator) Next() (*cxpb.ContinuousTestResult, error)
- func (it *ContinuousTestResultIterator) PageInfo() *iterator.PageInfo
- type ConversationHistoryCallOptions
- type ConversationHistoryClient
- func NewConversationHistoryClient(ctx context.Context, opts ...option.ClientOption) (*ConversationHistoryClient, error)
- func NewConversationHistoryRESTClient(ctx context.Context, opts ...option.ClientOption) (*ConversationHistoryClient, error)
- func (c *ConversationHistoryClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *ConversationHistoryClient) Close() error
- func (c *ConversationHistoryClient) Connection() *grpc.ClientConn
- func (c *ConversationHistoryClient) DeleteConversation(ctx context.Context, req *cxpb.DeleteConversationRequest, opts ...gax.CallOption) error
- func (c *ConversationHistoryClient) GetConversation(ctx context.Context, req *cxpb.GetConversationRequest, opts ...gax.CallOption) (*cxpb.Conversation, error)
- func (c *ConversationHistoryClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *ConversationHistoryClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *ConversationHistoryClient) ListConversations(ctx context.Context, req *cxpb.ListConversationsRequest, opts ...gax.CallOption) *ConversationIterator
- func (c *ConversationHistoryClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *ConversationHistoryClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- type ConversationIterator
- func (it *ConversationIterator) All() iter.Seq2[*cxpb.Conversation, error]
- func (it *ConversationIterator) Next() (*cxpb.Conversation, error)
- func (it *ConversationIterator) PageInfo() *iterator.PageInfo
- type CreateEnvironmentOperation
- func (op *CreateEnvironmentOperation) Done() bool
- func (op *CreateEnvironmentOperation) Metadata() (*structpb.Struct, error)
- func (op *CreateEnvironmentOperation) Name() string
- func (op *CreateEnvironmentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.Environment, error)
- func (op *CreateEnvironmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.Environment, error)
- type CreateVersionOperation
- func (op *CreateVersionOperation) Done() bool
- func (op *CreateVersionOperation) Metadata() (*cxpb.CreateVersionOperationMetadata, error)
- func (op *CreateVersionOperation) Name() string
- func (op *CreateVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.Version, error)
- func (op *CreateVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.Version, error)
- type DeployFlowOperation
- func (op *DeployFlowOperation) Done() bool
- func (op *DeployFlowOperation) Metadata() (*cxpb.DeployFlowMetadata, error)
- func (op *DeployFlowOperation) Name() string
- func (op *DeployFlowOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.DeployFlowResponse, error)
- func (op *DeployFlowOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.DeployFlowResponse, error)
- type DeploymentIterator
- func (it *DeploymentIterator) All() iter.Seq2[*cxpb.Deployment, error]
- func (it *DeploymentIterator) Next() (*cxpb.Deployment, error)
- func (it *DeploymentIterator) PageInfo() *iterator.PageInfo
- type DeploymentsCallOptions
- type DeploymentsClient
- func NewDeploymentsClient(ctx context.Context, opts ...option.ClientOption) (*DeploymentsClient, error)
- func NewDeploymentsRESTClient(ctx context.Context, opts ...option.ClientOption) (*DeploymentsClient, error)
- func (c *DeploymentsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *DeploymentsClient) Close() error
- func (c *DeploymentsClient) Connection() *grpc.ClientConn
- func (c *DeploymentsClient) GetDeployment(ctx context.Context, req *cxpb.GetDeploymentRequest, opts ...gax.CallOption) (*cxpb.Deployment, error)
- func (c *DeploymentsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *DeploymentsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *DeploymentsClient) ListDeployments(ctx context.Context, req *cxpb.ListDeploymentsRequest, opts ...gax.CallOption) *DeploymentIterator
- func (c *DeploymentsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *DeploymentsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- type EntityTypeIterator
- func (it *EntityTypeIterator) All() iter.Seq2[*cxpb.EntityType, error]
- func (it *EntityTypeIterator) Next() (*cxpb.EntityType, error)
- func (it *EntityTypeIterator) PageInfo() *iterator.PageInfo
- type EntityTypesCallOptions
- type EntityTypesClient
- func NewEntityTypesClient(ctx context.Context, opts ...option.ClientOption) (*EntityTypesClient, error)
- func NewEntityTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*EntityTypesClient, error)
- func (c *EntityTypesClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *EntityTypesClient) Close() error
- func (c *EntityTypesClient) Connection() *grpc.ClientConn
- func (c *EntityTypesClient) CreateEntityType(ctx context.Context, req *cxpb.CreateEntityTypeRequest, opts ...gax.CallOption) (*cxpb.EntityType, error)
- func (c *EntityTypesClient) DeleteEntityType(ctx context.Context, req *cxpb.DeleteEntityTypeRequest, opts ...gax.CallOption) error
- func (c *EntityTypesClient) ExportEntityTypes(ctx context.Context, req *cxpb.ExportEntityTypesRequest, opts ...gax.CallOption) (*ExportEntityTypesOperation, error)
- func (c *EntityTypesClient) ExportEntityTypesOperation(name string) *ExportEntityTypesOperation
- func (c *EntityTypesClient) GetEntityType(ctx context.Context, req *cxpb.GetEntityTypeRequest, opts ...gax.CallOption) (*cxpb.EntityType, error)
- func (c *EntityTypesClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *EntityTypesClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *EntityTypesClient) ImportEntityTypes(ctx context.Context, req *cxpb.ImportEntityTypesRequest, opts ...gax.CallOption) (*ImportEntityTypesOperation, error)
- func (c *EntityTypesClient) ImportEntityTypesOperation(name string) *ImportEntityTypesOperation
- func (c *EntityTypesClient) ListEntityTypes(ctx context.Context, req *cxpb.ListEntityTypesRequest, opts ...gax.CallOption) *EntityTypeIterator
- func (c *EntityTypesClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *EntityTypesClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *EntityTypesClient) UpdateEntityType(ctx context.Context, req *cxpb.UpdateEntityTypeRequest, opts ...gax.CallOption) (*cxpb.EntityType, error)
- type EnvironmentIterator
- func (it *EnvironmentIterator) All() iter.Seq2[*cxpb.Environment, error]
- func (it *EnvironmentIterator) Next() (*cxpb.Environment, error)
- func (it *EnvironmentIterator) PageInfo() *iterator.PageInfo
- type EnvironmentsCallOptions
- type EnvironmentsClient
- func NewEnvironmentsClient(ctx context.Context, opts ...option.ClientOption) (*EnvironmentsClient, error)
- func NewEnvironmentsRESTClient(ctx context.Context, opts ...option.ClientOption) (*EnvironmentsClient, error)
- func (c *EnvironmentsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *EnvironmentsClient) Close() error
- func (c *EnvironmentsClient) Connection() *grpc.ClientConn
- func (c *EnvironmentsClient) CreateEnvironment(ctx context.Context, req *cxpb.CreateEnvironmentRequest, opts ...gax.CallOption) (*CreateEnvironmentOperation, error)
- func (c *EnvironmentsClient) CreateEnvironmentOperation(name string) *CreateEnvironmentOperation
- func (c *EnvironmentsClient) DeleteEnvironment(ctx context.Context, req *cxpb.DeleteEnvironmentRequest, opts ...gax.CallOption) error
- func (c *EnvironmentsClient) DeployFlow(ctx context.Context, req *cxpb.DeployFlowRequest, opts ...gax.CallOption) (*DeployFlowOperation, error)
- func (c *EnvironmentsClient) DeployFlowOperation(name string) *DeployFlowOperation
- func (c *EnvironmentsClient) GetEnvironment(ctx context.Context, req *cxpb.GetEnvironmentRequest, opts ...gax.CallOption) (*cxpb.Environment, error)
- func (c *EnvironmentsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *EnvironmentsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *EnvironmentsClient) ListContinuousTestResults(ctx context.Context, req *cxpb.ListContinuousTestResultsRequest, opts ...gax.CallOption) *ContinuousTestResultIterator
- func (c *EnvironmentsClient) ListEnvironments(ctx context.Context, req *cxpb.ListEnvironmentsRequest, opts ...gax.CallOption) *EnvironmentIterator
- func (c *EnvironmentsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *EnvironmentsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *EnvironmentsClient) LookupEnvironmentHistory(ctx context.Context, req *cxpb.LookupEnvironmentHistoryRequest, opts ...gax.CallOption) *EnvironmentIterator
- func (c *EnvironmentsClient) RunContinuousTest(ctx context.Context, req *cxpb.RunContinuousTestRequest, opts ...gax.CallOption) (*RunContinuousTestOperation, error)
- func (c *EnvironmentsClient) RunContinuousTestOperation(name string) *RunContinuousTestOperation
- func (c *EnvironmentsClient) UpdateEnvironment(ctx context.Context, req *cxpb.UpdateEnvironmentRequest, opts ...gax.CallOption) (*UpdateEnvironmentOperation, error)
- func (c *EnvironmentsClient) UpdateEnvironmentOperation(name string) *UpdateEnvironmentOperation
- type ExampleIterator
- func (it *ExampleIterator) All() iter.Seq2[*cxpb.Example, error]
- func (it *ExampleIterator) Next() (*cxpb.Example, error)
- func (it *ExampleIterator) PageInfo() *iterator.PageInfo
- type ExamplesCallOptions
- type ExamplesClient
- func NewExamplesClient(ctx context.Context, opts ...option.ClientOption) (*ExamplesClient, error)
- func NewExamplesRESTClient(ctx context.Context, opts ...option.ClientOption) (*ExamplesClient, error)
- func (c *ExamplesClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *ExamplesClient) Close() error
- func (c *ExamplesClient) Connection() *grpc.ClientConn
- func (c *ExamplesClient) CreateExample(ctx context.Context, req *cxpb.CreateExampleRequest, opts ...gax.CallOption) (*cxpb.Example, error)
- func (c *ExamplesClient) DeleteExample(ctx context.Context, req *cxpb.DeleteExampleRequest, opts ...gax.CallOption) error
- func (c *ExamplesClient) GetExample(ctx context.Context, req *cxpb.GetExampleRequest, opts ...gax.CallOption) (*cxpb.Example, error)
- func (c *ExamplesClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *ExamplesClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *ExamplesClient) ListExamples(ctx context.Context, req *cxpb.ListExamplesRequest, opts ...gax.CallOption) *ExampleIterator
- func (c *ExamplesClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *ExamplesClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *ExamplesClient) UpdateExample(ctx context.Context, req *cxpb.UpdateExampleRequest, opts ...gax.CallOption) (*cxpb.Example, error)
- type ExperimentIterator
- func (it *ExperimentIterator) All() iter.Seq2[*cxpb.Experiment, error]
- func (it *ExperimentIterator) Next() (*cxpb.Experiment, error)
- func (it *ExperimentIterator) PageInfo() *iterator.PageInfo
- type ExperimentsCallOptions
- type ExperimentsClient
- func NewExperimentsClient(ctx context.Context, opts ...option.ClientOption) (*ExperimentsClient, error)
- func NewExperimentsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ExperimentsClient, error)
- func (c *ExperimentsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *ExperimentsClient) Close() error
- func (c *ExperimentsClient) Connection() *grpc.ClientConn
- func (c *ExperimentsClient) CreateExperiment(ctx context.Context, req *cxpb.CreateExperimentRequest, opts ...gax.CallOption) (*cxpb.Experiment, error)
- func (c *ExperimentsClient) DeleteExperiment(ctx context.Context, req *cxpb.DeleteExperimentRequest, opts ...gax.CallOption) error
- func (c *ExperimentsClient) GetExperiment(ctx context.Context, req *cxpb.GetExperimentRequest, opts ...gax.CallOption) (*cxpb.Experiment, error)
- func (c *ExperimentsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *ExperimentsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *ExperimentsClient) ListExperiments(ctx context.Context, req *cxpb.ListExperimentsRequest, opts ...gax.CallOption) *ExperimentIterator
- func (c *ExperimentsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *ExperimentsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *ExperimentsClient) StartExperiment(ctx context.Context, req *cxpb.StartExperimentRequest, opts ...gax.CallOption) (*cxpb.Experiment, error)
- func (c *ExperimentsClient) StopExperiment(ctx context.Context, req *cxpb.StopExperimentRequest, opts ...gax.CallOption) (*cxpb.Experiment, error)
- func (c *ExperimentsClient) UpdateExperiment(ctx context.Context, req *cxpb.UpdateExperimentRequest, opts ...gax.CallOption) (*cxpb.Experiment, error)
- type ExportAgentOperation
- func (op *ExportAgentOperation) Done() bool
- func (op *ExportAgentOperation) Metadata() (*structpb.Struct, error)
- func (op *ExportAgentOperation) Name() string
- func (op *ExportAgentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportAgentResponse, error)
- func (op *ExportAgentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportAgentResponse, error)
- type ExportEntityTypesOperation
- func (op *ExportEntityTypesOperation) Done() bool
- func (op *ExportEntityTypesOperation) Metadata() (*cxpb.ExportEntityTypesMetadata, error)
- func (op *ExportEntityTypesOperation) Name() string
- func (op *ExportEntityTypesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportEntityTypesResponse, error)
- func (op *ExportEntityTypesOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportEntityTypesResponse, error)
- type ExportFlowOperation
- func (op *ExportFlowOperation) Done() bool
- func (op *ExportFlowOperation) Metadata() (*structpb.Struct, error)
- func (op *ExportFlowOperation) Name() string
- func (op *ExportFlowOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportFlowResponse, error)
- func (op *ExportFlowOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportFlowResponse, error)
- type ExportIntentsOperation
- func (op *ExportIntentsOperation) Done() bool
- func (op *ExportIntentsOperation) Metadata() (*cxpb.ExportIntentsMetadata, error)
- func (op *ExportIntentsOperation) Name() string
- func (op *ExportIntentsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportIntentsResponse, error)
- func (op *ExportIntentsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportIntentsResponse, error)
- type ExportTestCasesOperation
- func (op *ExportTestCasesOperation) Done() bool
- func (op *ExportTestCasesOperation) Metadata() (*cxpb.ExportTestCasesMetadata, error)
- func (op *ExportTestCasesOperation) Name() string
- func (op *ExportTestCasesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportTestCasesResponse, error)
- func (op *ExportTestCasesOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportTestCasesResponse, error)
- type ExportToolsOperation
- func (op *ExportToolsOperation) Done() bool
- func (op *ExportToolsOperation) Metadata() (*cxpb.ExportToolsMetadata, error)
- func (op *ExportToolsOperation) Name() string
- func (op *ExportToolsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportToolsResponse, error)
- func (op *ExportToolsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportToolsResponse, error)
- type FlowIterator
- func (it *FlowIterator) All() iter.Seq2[*cxpb.Flow, error]
- func (it *FlowIterator) Next() (*cxpb.Flow, error)
- func (it *FlowIterator) PageInfo() *iterator.PageInfo
- type FlowsCallOptions
- type FlowsClient
- func NewFlowsClient(ctx context.Context, opts ...option.ClientOption) (*FlowsClient, error)
- func NewFlowsRESTClient(ctx context.Context, opts ...option.ClientOption) (*FlowsClient, error)
- func (c *FlowsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *FlowsClient) Close() error
- func (c *FlowsClient) Connection() *grpc.ClientConn
- func (c *FlowsClient) CreateFlow(ctx context.Context, req *cxpb.CreateFlowRequest, opts ...gax.CallOption) (*cxpb.Flow, error)
- func (c *FlowsClient) DeleteFlow(ctx context.Context, req *cxpb.DeleteFlowRequest, opts ...gax.CallOption) error
- func (c *FlowsClient) ExportFlow(ctx context.Context, req *cxpb.ExportFlowRequest, opts ...gax.CallOption) (*ExportFlowOperation, error)
- func (c *FlowsClient) ExportFlowOperation(name string) *ExportFlowOperation
- func (c *FlowsClient) GetFlow(ctx context.Context, req *cxpb.GetFlowRequest, opts ...gax.CallOption) (*cxpb.Flow, error)
- func (c *FlowsClient) GetFlowValidationResult(ctx context.Context, req *cxpb.GetFlowValidationResultRequest, opts ...gax.CallOption) (*cxpb.FlowValidationResult, error)
- func (c *FlowsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *FlowsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *FlowsClient) ImportFlow(ctx context.Context, req *cxpb.ImportFlowRequest, opts ...gax.CallOption) (*ImportFlowOperation, error)
- func (c *FlowsClient) ImportFlowOperation(name string) *ImportFlowOperation
- func (c *FlowsClient) ListFlows(ctx context.Context, req *cxpb.ListFlowsRequest, opts ...gax.CallOption) *FlowIterator
- func (c *FlowsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *FlowsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *FlowsClient) TrainFlow(ctx context.Context, req *cxpb.TrainFlowRequest, opts ...gax.CallOption) (*TrainFlowOperation, error)
- func (c *FlowsClient) TrainFlowOperation(name string) *TrainFlowOperation
- func (c *FlowsClient) UpdateFlow(ctx context.Context, req *cxpb.UpdateFlowRequest, opts ...gax.CallOption) (*cxpb.Flow, error)
- func (c *FlowsClient) ValidateFlow(ctx context.Context, req *cxpb.ValidateFlowRequest, opts ...gax.CallOption) (*cxpb.FlowValidationResult, error)
- type GeneratorIterator
- func (it *GeneratorIterator) All() iter.Seq2[*cxpb.Generator, error]
- func (it *GeneratorIterator) Next() (*cxpb.Generator, error)
- func (it *GeneratorIterator) PageInfo() *iterator.PageInfo
- type GeneratorsCallOptions
- type GeneratorsClient
- func NewGeneratorsClient(ctx context.Context, opts ...option.ClientOption) (*GeneratorsClient, error)
- func NewGeneratorsRESTClient(ctx context.Context, opts ...option.ClientOption) (*GeneratorsClient, error)
- func (c *GeneratorsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *GeneratorsClient) Close() error
- func (c *GeneratorsClient) Connection() *grpc.ClientConn
- func (c *GeneratorsClient) CreateGenerator(ctx context.Context, req *cxpb.CreateGeneratorRequest, opts ...gax.CallOption) (*cxpb.Generator, error)
- func (c *GeneratorsClient) DeleteGenerator(ctx context.Context, req *cxpb.DeleteGeneratorRequest, opts ...gax.CallOption) error
- func (c *GeneratorsClient) GetGenerator(ctx context.Context, req *cxpb.GetGeneratorRequest, opts ...gax.CallOption) (*cxpb.Generator, error)
- func (c *GeneratorsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *GeneratorsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *GeneratorsClient) ListGenerators(ctx context.Context, req *cxpb.ListGeneratorsRequest, opts ...gax.CallOption) *GeneratorIterator
- func (c *GeneratorsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *GeneratorsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *GeneratorsClient) UpdateGenerator(ctx context.Context, req *cxpb.UpdateGeneratorRequest, opts ...gax.CallOption) (*cxpb.Generator, error)
- type ImportEntityTypesOperation
- func (op *ImportEntityTypesOperation) Done() bool
- func (op *ImportEntityTypesOperation) Metadata() (*cxpb.ImportEntityTypesMetadata, error)
- func (op *ImportEntityTypesOperation) Name() string
- func (op *ImportEntityTypesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ImportEntityTypesResponse, error)
- func (op *ImportEntityTypesOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ImportEntityTypesResponse, error)
- type ImportFlowOperation
- func (op *ImportFlowOperation) Done() bool
- func (op *ImportFlowOperation) Metadata() (*structpb.Struct, error)
- func (op *ImportFlowOperation) Name() string
- func (op *ImportFlowOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ImportFlowResponse, error)
- func (op *ImportFlowOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ImportFlowResponse, error)
- type ImportIntentsOperation
- func (op *ImportIntentsOperation) Done() bool
- func (op *ImportIntentsOperation) Metadata() (*cxpb.ImportIntentsMetadata, error)
- func (op *ImportIntentsOperation) Name() string
- func (op *ImportIntentsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ImportIntentsResponse, error)
- func (op *ImportIntentsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ImportIntentsResponse, error)
- type ImportTestCasesOperation
- func (op *ImportTestCasesOperation) Done() bool
- func (op *ImportTestCasesOperation) Metadata() (*cxpb.ImportTestCasesMetadata, error)
- func (op *ImportTestCasesOperation) Name() string
- func (op *ImportTestCasesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ImportTestCasesResponse, error)
- func (op *ImportTestCasesOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ImportTestCasesResponse, error)
- type IntentIterator
- func (it *IntentIterator) All() iter.Seq2[*cxpb.Intent, error]
- func (it *IntentIterator) Next() (*cxpb.Intent, error)
- func (it *IntentIterator) PageInfo() *iterator.PageInfo
- type IntentsCallOptions
- type IntentsClient
- func NewIntentsClient(ctx context.Context, opts ...option.ClientOption) (*IntentsClient, error)
- func NewIntentsRESTClient(ctx context.Context, opts ...option.ClientOption) (*IntentsClient, error)
- func (c *IntentsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *IntentsClient) Close() error
- func (c *IntentsClient) Connection() *grpc.ClientConn
- func (c *IntentsClient) CreateIntent(ctx context.Context, req *cxpb.CreateIntentRequest, opts ...gax.CallOption) (*cxpb.Intent, error)
- func (c *IntentsClient) DeleteIntent(ctx context.Context, req *cxpb.DeleteIntentRequest, opts ...gax.CallOption) error
- func (c *IntentsClient) ExportIntents(ctx context.Context, req *cxpb.ExportIntentsRequest, opts ...gax.CallOption) (*ExportIntentsOperation, error)
- func (c *IntentsClient) ExportIntentsOperation(name string) *ExportIntentsOperation
- func (c *IntentsClient) GetIntent(ctx context.Context, req *cxpb.GetIntentRequest, opts ...gax.CallOption) (*cxpb.Intent, error)
- func (c *IntentsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *IntentsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *IntentsClient) ImportIntents(ctx context.Context, req *cxpb.ImportIntentsRequest, opts ...gax.CallOption) (*ImportIntentsOperation, error)
- func (c *IntentsClient) ImportIntentsOperation(name string) *ImportIntentsOperation
- func (c *IntentsClient) ListIntents(ctx context.Context, req *cxpb.ListIntentsRequest, opts ...gax.CallOption) *IntentIterator
- func (c *IntentsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *IntentsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *IntentsClient) UpdateIntent(ctx context.Context, req *cxpb.UpdateIntentRequest, opts ...gax.CallOption) (*cxpb.Intent, error)
- type LoadVersionOperation
- func (op *LoadVersionOperation) Done() bool
- func (op *LoadVersionOperation) Metadata() (*structpb.Struct, error)
- func (op *LoadVersionOperation) Name() string
- func (op *LoadVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *LoadVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type LocationIterator
- func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]
- func (it *LocationIterator) Next() (*locationpb.Location, error)
- func (it *LocationIterator) PageInfo() *iterator.PageInfo
- type OperationIterator
- func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]
- func (it *OperationIterator) Next() (*longrunningpb.Operation, error)
- func (it *OperationIterator) PageInfo() *iterator.PageInfo
- type PageIterator
- func (it *PageIterator) All() iter.Seq2[*cxpb.Page, error]
- func (it *PageIterator) Next() (*cxpb.Page, error)
- func (it *PageIterator) PageInfo() *iterator.PageInfo
- type PagesCallOptions
- type PagesClient
- func NewPagesClient(ctx context.Context, opts ...option.ClientOption) (*PagesClient, error)
- func NewPagesRESTClient(ctx context.Context, opts ...option.ClientOption) (*PagesClient, error)
- func (c *PagesClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *PagesClient) Close() error
- func (c *PagesClient) Connection() *grpc.ClientConn
- func (c *PagesClient) CreatePage(ctx context.Context, req *cxpb.CreatePageRequest, opts ...gax.CallOption) (*cxpb.Page, error)
- func (c *PagesClient) DeletePage(ctx context.Context, req *cxpb.DeletePageRequest, opts ...gax.CallOption) error
- func (c *PagesClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *PagesClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *PagesClient) GetPage(ctx context.Context, req *cxpb.GetPageRequest, opts ...gax.CallOption) (*cxpb.Page, error)
- func (c *PagesClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *PagesClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *PagesClient) ListPages(ctx context.Context, req *cxpb.ListPagesRequest, opts ...gax.CallOption) *PageIterator
- func (c *PagesClient) UpdatePage(ctx context.Context, req *cxpb.UpdatePageRequest, opts ...gax.CallOption) (*cxpb.Page, error)
- type PlaybookIterator
- func (it *PlaybookIterator) All() iter.Seq2[*cxpb.Playbook, error]
- func (it *PlaybookIterator) Next() (*cxpb.Playbook, error)
- func (it *PlaybookIterator) PageInfo() *iterator.PageInfo
- type PlaybookVersionIterator
- func (it *PlaybookVersionIterator) All() iter.Seq2[*cxpb.PlaybookVersion, error]
- func (it *PlaybookVersionIterator) Next() (*cxpb.PlaybookVersion, error)
- func (it *PlaybookVersionIterator) PageInfo() *iterator.PageInfo
- type PlaybooksCallOptions
- type PlaybooksClient
- func NewPlaybooksClient(ctx context.Context, opts ...option.ClientOption) (*PlaybooksClient, error)
- func NewPlaybooksRESTClient(ctx context.Context, opts ...option.ClientOption) (*PlaybooksClient, error)
- func (c *PlaybooksClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *PlaybooksClient) Close() error
- func (c *PlaybooksClient) Connection() *grpc.ClientConn
- func (c *PlaybooksClient) CreatePlaybook(ctx context.Context, req *cxpb.CreatePlaybookRequest, opts ...gax.CallOption) (*cxpb.Playbook, error)
- func (c *PlaybooksClient) CreatePlaybookVersion(ctx context.Context, req *cxpb.CreatePlaybookVersionRequest, opts ...gax.CallOption) (*cxpb.PlaybookVersion, error)
- func (c *PlaybooksClient) DeletePlaybook(ctx context.Context, req *cxpb.DeletePlaybookRequest, opts ...gax.CallOption) error
- func (c *PlaybooksClient) DeletePlaybookVersion(ctx context.Context, req *cxpb.DeletePlaybookVersionRequest, opts ...gax.CallOption) error
- func (c *PlaybooksClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *PlaybooksClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *PlaybooksClient) GetPlaybook(ctx context.Context, req *cxpb.GetPlaybookRequest, opts ...gax.CallOption) (*cxpb.Playbook, error)
- func (c *PlaybooksClient) GetPlaybookVersion(ctx context.Context, req *cxpb.GetPlaybookVersionRequest, opts ...gax.CallOption) (*cxpb.PlaybookVersion, error)
- func (c *PlaybooksClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *PlaybooksClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *PlaybooksClient) ListPlaybookVersions(ctx context.Context, req *cxpb.ListPlaybookVersionsRequest, opts ...gax.CallOption) *PlaybookVersionIterator
- func (c *PlaybooksClient) ListPlaybooks(ctx context.Context, req *cxpb.ListPlaybooksRequest, opts ...gax.CallOption) *PlaybookIterator
- func (c *PlaybooksClient) UpdatePlaybook(ctx context.Context, req *cxpb.UpdatePlaybookRequest, opts ...gax.CallOption) (*cxpb.Playbook, error)
- type RestoreAgentOperation
- func (op *RestoreAgentOperation) Done() bool
- func (op *RestoreAgentOperation) Metadata() (*structpb.Struct, error)
- func (op *RestoreAgentOperation) Name() string
- func (op *RestoreAgentOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *RestoreAgentOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type RunContinuousTestOperation
- func (op *RunContinuousTestOperation) Done() bool
- func (op *RunContinuousTestOperation) Metadata() (*cxpb.RunContinuousTestMetadata, error)
- func (op *RunContinuousTestOperation) Name() string
- func (op *RunContinuousTestOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.RunContinuousTestResponse, error)
- func (op *RunContinuousTestOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.RunContinuousTestResponse, error)
- type RunTestCaseOperation
- func (op *RunTestCaseOperation) Done() bool
- func (op *RunTestCaseOperation) Metadata() (*cxpb.RunTestCaseMetadata, error)
- func (op *RunTestCaseOperation) Name() string
- func (op *RunTestCaseOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.RunTestCaseResponse, error)
- func (op *RunTestCaseOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.RunTestCaseResponse, error)
- type SecuritySettingsCallOptions
- type SecuritySettingsClient
- func NewSecuritySettingsClient(ctx context.Context, opts ...option.ClientOption) (*SecuritySettingsClient, error)
- func NewSecuritySettingsRESTClient(ctx context.Context, opts ...option.ClientOption) (*SecuritySettingsClient, error)
- func (c *SecuritySettingsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *SecuritySettingsClient) Close() error
- func (c *SecuritySettingsClient) Connection() *grpc.ClientConn
- func (c *SecuritySettingsClient) CreateSecuritySettings(ctx context.Context, req *cxpb.CreateSecuritySettingsRequest, opts ...gax.CallOption) (*cxpb.SecuritySettings, error)
- func (c *SecuritySettingsClient) DeleteSecuritySettings(ctx context.Context, req *cxpb.DeleteSecuritySettingsRequest, opts ...gax.CallOption) error
- func (c *SecuritySettingsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *SecuritySettingsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *SecuritySettingsClient) GetSecuritySettings(ctx context.Context, req *cxpb.GetSecuritySettingsRequest, opts ...gax.CallOption) (*cxpb.SecuritySettings, error)
- func (c *SecuritySettingsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *SecuritySettingsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *SecuritySettingsClient) ListSecuritySettings(ctx context.Context, req *cxpb.ListSecuritySettingsRequest, opts ...gax.CallOption) *SecuritySettingsIterator
- func (c *SecuritySettingsClient) UpdateSecuritySettings(ctx context.Context, req *cxpb.UpdateSecuritySettingsRequest, opts ...gax.CallOption) (*cxpb.SecuritySettings, error)
- type SecuritySettingsIterator
- func (it *SecuritySettingsIterator) All() iter.Seq2[*cxpb.SecuritySettings, error]
- func (it *SecuritySettingsIterator) Next() (*cxpb.SecuritySettings, error)
- func (it *SecuritySettingsIterator) PageInfo() *iterator.PageInfo
- type SessionEntityTypeIterator
- func (it *SessionEntityTypeIterator) All() iter.Seq2[*cxpb.SessionEntityType, error]
- func (it *SessionEntityTypeIterator) Next() (*cxpb.SessionEntityType, error)
- func (it *SessionEntityTypeIterator) PageInfo() *iterator.PageInfo
- type SessionEntityTypesCallOptions
- type SessionEntityTypesClient
- func NewSessionEntityTypesClient(ctx context.Context, opts ...option.ClientOption) (*SessionEntityTypesClient, error)
- func NewSessionEntityTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*SessionEntityTypesClient, error)
- func (c *SessionEntityTypesClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *SessionEntityTypesClient) Close() error
- func (c *SessionEntityTypesClient) Connection() *grpc.ClientConn
- func (c *SessionEntityTypesClient) CreateSessionEntityType(ctx context.Context, req *cxpb.CreateSessionEntityTypeRequest, opts ...gax.CallOption) (*cxpb.SessionEntityType, error)
- func (c *SessionEntityTypesClient) DeleteSessionEntityType(ctx context.Context, req *cxpb.DeleteSessionEntityTypeRequest, opts ...gax.CallOption) error
- func (c *SessionEntityTypesClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *SessionEntityTypesClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *SessionEntityTypesClient) GetSessionEntityType(ctx context.Context, req *cxpb.GetSessionEntityTypeRequest, opts ...gax.CallOption) (*cxpb.SessionEntityType, error)
- func (c *SessionEntityTypesClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *SessionEntityTypesClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *SessionEntityTypesClient) ListSessionEntityTypes(ctx context.Context, req *cxpb.ListSessionEntityTypesRequest, opts ...gax.CallOption) *SessionEntityTypeIterator
- func (c *SessionEntityTypesClient) UpdateSessionEntityType(ctx context.Context, req *cxpb.UpdateSessionEntityTypeRequest, opts ...gax.CallOption) (*cxpb.SessionEntityType, error)
- type SessionsCallOptions
- type SessionsClient
- func NewSessionsClient(ctx context.Context, opts ...option.ClientOption) (*SessionsClient, error)
- func NewSessionsRESTClient(ctx context.Context, opts ...option.ClientOption) (*SessionsClient, error)
- func (c *SessionsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *SessionsClient) Close() error
- func (c *SessionsClient) Connection() *grpc.ClientConn
- func (c *SessionsClient) DetectIntent(ctx context.Context, req *cxpb.DetectIntentRequest, opts ...gax.CallOption) (*cxpb.DetectIntentResponse, error)
- func (c *SessionsClient) FulfillIntent(ctx context.Context, req *cxpb.FulfillIntentRequest, opts ...gax.CallOption) (*cxpb.FulfillIntentResponse, error)
- func (c *SessionsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *SessionsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *SessionsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *SessionsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *SessionsClient) MatchIntent(ctx context.Context, req *cxpb.MatchIntentRequest, opts ...gax.CallOption) (*cxpb.MatchIntentResponse, error)
- func (c *SessionsClient) ServerStreamingDetectIntent(ctx context.Context, req *cxpb.DetectIntentRequest, opts ...gax.CallOption) (cxpb.Sessions_ServerStreamingDetectIntentClient, error)
- func (c *SessionsClient) StreamingDetectIntent(ctx context.Context, opts ...gax.CallOption) (cxpb.Sessions_StreamingDetectIntentClient, error)
- func (c *SessionsClient) SubmitAnswerFeedback(ctx context.Context, req *cxpb.SubmitAnswerFeedbackRequest, opts ...gax.CallOption) (*cxpb.AnswerFeedback, error)
- type TestCaseIterator
- func (it *TestCaseIterator) All() iter.Seq2[*cxpb.TestCase, error]
- func (it *TestCaseIterator) Next() (*cxpb.TestCase, error)
- func (it *TestCaseIterator) PageInfo() *iterator.PageInfo
- type TestCaseResultIterator
- func (it *TestCaseResultIterator) All() iter.Seq2[*cxpb.TestCaseResult, error]
- func (it *TestCaseResultIterator) Next() (*cxpb.TestCaseResult, error)
- func (it *TestCaseResultIterator) PageInfo() *iterator.PageInfo
- type TestCasesCallOptions
- type TestCasesClient
- func NewTestCasesClient(ctx context.Context, opts ...option.ClientOption) (*TestCasesClient, error)
- func NewTestCasesRESTClient(ctx context.Context, opts ...option.ClientOption) (*TestCasesClient, error)
- func (c *TestCasesClient) BatchDeleteTestCases(ctx context.Context, req *cxpb.BatchDeleteTestCasesRequest, opts ...gax.CallOption) error
- func (c *TestCasesClient) BatchRunTestCases(ctx context.Context, req *cxpb.BatchRunTestCasesRequest, opts ...gax.CallOption) (*BatchRunTestCasesOperation, error)
- func (c *TestCasesClient) BatchRunTestCasesOperation(name string) *BatchRunTestCasesOperation
- func (c *TestCasesClient) CalculateCoverage(ctx context.Context, req *cxpb.CalculateCoverageRequest, opts ...gax.CallOption) (*cxpb.CalculateCoverageResponse, error)
- func (c *TestCasesClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *TestCasesClient) Close() error
- func (c *TestCasesClient) Connection() *grpc.ClientConn
- func (c *TestCasesClient) CreateTestCase(ctx context.Context, req *cxpb.CreateTestCaseRequest, opts ...gax.CallOption) (*cxpb.TestCase, error)
- func (c *TestCasesClient) ExportTestCases(ctx context.Context, req *cxpb.ExportTestCasesRequest, opts ...gax.CallOption) (*ExportTestCasesOperation, error)
- func (c *TestCasesClient) ExportTestCasesOperation(name string) *ExportTestCasesOperation
- func (c *TestCasesClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *TestCasesClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *TestCasesClient) GetTestCase(ctx context.Context, req *cxpb.GetTestCaseRequest, opts ...gax.CallOption) (*cxpb.TestCase, error)
- func (c *TestCasesClient) GetTestCaseResult(ctx context.Context, req *cxpb.GetTestCaseResultRequest, opts ...gax.CallOption) (*cxpb.TestCaseResult, error)
- func (c *TestCasesClient) ImportTestCases(ctx context.Context, req *cxpb.ImportTestCasesRequest, opts ...gax.CallOption) (*ImportTestCasesOperation, error)
- func (c *TestCasesClient) ImportTestCasesOperation(name string) *ImportTestCasesOperation
- func (c *TestCasesClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *TestCasesClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *TestCasesClient) ListTestCaseResults(ctx context.Context, req *cxpb.ListTestCaseResultsRequest, opts ...gax.CallOption) *TestCaseResultIterator
- func (c *TestCasesClient) ListTestCases(ctx context.Context, req *cxpb.ListTestCasesRequest, opts ...gax.CallOption) *TestCaseIterator
- func (c *TestCasesClient) RunTestCase(ctx context.Context, req *cxpb.RunTestCaseRequest, opts ...gax.CallOption) (*RunTestCaseOperation, error)
- func (c *TestCasesClient) RunTestCaseOperation(name string) *RunTestCaseOperation
- func (c *TestCasesClient) UpdateTestCase(ctx context.Context, req *cxpb.UpdateTestCaseRequest, opts ...gax.CallOption) (*cxpb.TestCase, error)
- type ToolIterator
- func (it *ToolIterator) All() iter.Seq2[*cxpb.Tool, error]
- func (it *ToolIterator) Next() (*cxpb.Tool, error)
- func (it *ToolIterator) PageInfo() *iterator.PageInfo
- type ToolsCallOptions
- type ToolsClient
- func NewToolsClient(ctx context.Context, opts ...option.ClientOption) (*ToolsClient, error)
- func NewToolsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ToolsClient, error)
- func (c *ToolsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *ToolsClient) Close() error
- func (c *ToolsClient) Connection() *grpc.ClientConn
- func (c *ToolsClient) CreateTool(ctx context.Context, req *cxpb.CreateToolRequest, opts ...gax.CallOption) (*cxpb.Tool, error)
- func (c *ToolsClient) DeleteTool(ctx context.Context, req *cxpb.DeleteToolRequest, opts ...gax.CallOption) error
- func (c *ToolsClient) ExportTools(ctx context.Context, req *cxpb.ExportToolsRequest, opts ...gax.CallOption) (*ExportToolsOperation, error)
- func (c *ToolsClient) ExportToolsOperation(name string) *ExportToolsOperation
- func (c *ToolsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *ToolsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *ToolsClient) GetTool(ctx context.Context, req *cxpb.GetToolRequest, opts ...gax.CallOption) (*cxpb.Tool, error)
- func (c *ToolsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *ToolsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *ToolsClient) ListTools(ctx context.Context, req *cxpb.ListToolsRequest, opts ...gax.CallOption) *ToolIterator
- func (c *ToolsClient) UpdateTool(ctx context.Context, req *cxpb.UpdateToolRequest, opts ...gax.CallOption) (*cxpb.Tool, error)
- type TrainFlowOperation
- func (op *TrainFlowOperation) Done() bool
- func (op *TrainFlowOperation) Metadata() (*structpb.Struct, error)
- func (op *TrainFlowOperation) Name() string
- func (op *TrainFlowOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *TrainFlowOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type TransitionRouteGroupIterator
- func (it *TransitionRouteGroupIterator) All() iter.Seq2[*cxpb.TransitionRouteGroup, error]
- func (it *TransitionRouteGroupIterator) Next() (*cxpb.TransitionRouteGroup, error)
- func (it *TransitionRouteGroupIterator) PageInfo() *iterator.PageInfo
- type TransitionRouteGroupsCallOptions
- type TransitionRouteGroupsClient
- func NewTransitionRouteGroupsClient(ctx context.Context, opts ...option.ClientOption) (*TransitionRouteGroupsClient, error)
- func NewTransitionRouteGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*TransitionRouteGroupsClient, error)
- func (c *TransitionRouteGroupsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *TransitionRouteGroupsClient) Close() error
- func (c *TransitionRouteGroupsClient) Connection() *grpc.ClientConn
- func (c *TransitionRouteGroupsClient) CreateTransitionRouteGroup(ctx context.Context, req *cxpb.CreateTransitionRouteGroupRequest, opts ...gax.CallOption) (*cxpb.TransitionRouteGroup, error)
- func (c *TransitionRouteGroupsClient) DeleteTransitionRouteGroup(ctx context.Context, req *cxpb.DeleteTransitionRouteGroupRequest, opts ...gax.CallOption) error
- func (c *TransitionRouteGroupsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *TransitionRouteGroupsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *TransitionRouteGroupsClient) GetTransitionRouteGroup(ctx context.Context, req *cxpb.GetTransitionRouteGroupRequest, opts ...gax.CallOption) (*cxpb.TransitionRouteGroup, error)
- func (c *TransitionRouteGroupsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *TransitionRouteGroupsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *TransitionRouteGroupsClient) ListTransitionRouteGroups(ctx context.Context, req *cxpb.ListTransitionRouteGroupsRequest, opts ...gax.CallOption) *TransitionRouteGroupIterator
- func (c *TransitionRouteGroupsClient) UpdateTransitionRouteGroup(ctx context.Context, req *cxpb.UpdateTransitionRouteGroupRequest, opts ...gax.CallOption) (*cxpb.TransitionRouteGroup, error)
- type UpdateEnvironmentOperation
- func (op *UpdateEnvironmentOperation) Done() bool
- func (op *UpdateEnvironmentOperation) Metadata() (*structpb.Struct, error)
- func (op *UpdateEnvironmentOperation) Name() string
- func (op *UpdateEnvironmentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.Environment, error)
- func (op *UpdateEnvironmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.Environment, error)
- type VersionIterator
- func (it *VersionIterator) All() iter.Seq2[*cxpb.Version, error]
- func (it *VersionIterator) Next() (*cxpb.Version, error)
- func (it *VersionIterator) PageInfo() *iterator.PageInfo
- type VersionsCallOptions
- type VersionsClient
- func NewVersionsClient(ctx context.Context, opts ...option.ClientOption) (*VersionsClient, error)
- func NewVersionsRESTClient(ctx context.Context, opts ...option.ClientOption) (*VersionsClient, error)
- func (c *VersionsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *VersionsClient) Close() error
- func (c *VersionsClient) CompareVersions(ctx context.Context, req *cxpb.CompareVersionsRequest, opts ...gax.CallOption) (*cxpb.CompareVersionsResponse, error)
- func (c *VersionsClient) Connection() *grpc.ClientConn
- func (c *VersionsClient) CreateVersion(ctx context.Context, req *cxpb.CreateVersionRequest, opts ...gax.CallOption) (*CreateVersionOperation, error)
- func (c *VersionsClient) CreateVersionOperation(name string) *CreateVersionOperation
- func (c *VersionsClient) DeleteVersion(ctx context.Context, req *cxpb.DeleteVersionRequest, opts ...gax.CallOption) error
- func (c *VersionsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *VersionsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *VersionsClient) GetVersion(ctx context.Context, req *cxpb.GetVersionRequest, opts ...gax.CallOption) (*cxpb.Version, error)
- func (c *VersionsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *VersionsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *VersionsClient) ListVersions(ctx context.Context, req *cxpb.ListVersionsRequest, opts ...gax.CallOption) *VersionIterator
- func (c *VersionsClient) LoadVersion(ctx context.Context, req *cxpb.LoadVersionRequest, opts ...gax.CallOption) (*LoadVersionOperation, error)
- func (c *VersionsClient) LoadVersionOperation(name string) *LoadVersionOperation
- func (c *VersionsClient) UpdateVersion(ctx context.Context, req *cxpb.UpdateVersionRequest, opts ...gax.CallOption) (*cxpb.Version, error)
- type WebhookIterator
- func (it *WebhookIterator) All() iter.Seq2[*cxpb.Webhook, error]
- func (it *WebhookIterator) Next() (*cxpb.Webhook, error)
- func (it *WebhookIterator) PageInfo() *iterator.PageInfo
- type WebhooksCallOptions
- type WebhooksClient
- func NewWebhooksClient(ctx context.Context, opts ...option.ClientOption) (*WebhooksClient, error)
- func NewWebhooksRESTClient(ctx context.Context, opts ...option.ClientOption) (*WebhooksClient, error)
- func (c *WebhooksClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *WebhooksClient) Close() error
- func (c *WebhooksClient) Connection() *grpc.ClientConn
- func (c *WebhooksClient) CreateWebhook(ctx context.Context, req *cxpb.CreateWebhookRequest, opts ...gax.CallOption) (*cxpb.Webhook, error)
- func (c *WebhooksClient) DeleteWebhook(ctx context.Context, req *cxpb.DeleteWebhookRequest, opts ...gax.CallOption) error
- func (c *WebhooksClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *WebhooksClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *WebhooksClient) GetWebhook(ctx context.Context, req *cxpb.GetWebhookRequest, opts ...gax.CallOption) (*cxpb.Webhook, error)
- func (c *WebhooksClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *WebhooksClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *WebhooksClient) ListWebhooks(ctx context.Context, req *cxpb.ListWebhooksRequest, opts ...gax.CallOption) *WebhookIterator
- func (c *WebhooksClient) UpdateWebhook(ctx context.Context, req *cxpb.UpdateWebhookRequest, opts ...gax.CallOption) (*cxpb.Webhook, error)
Examples ¶
- AgentsClient.CancelOperation
- AgentsClient.CreateAgent
- AgentsClient.DeleteAgent
- AgentsClient.ExportAgent
- AgentsClient.GetAgent
- AgentsClient.GetAgentValidationResult
- AgentsClient.GetGenerativeSettings
- AgentsClient.GetLocation
- AgentsClient.GetOperation
- AgentsClient.ListAgents
- AgentsClient.ListAgents (All)
- AgentsClient.ListLocations
- AgentsClient.ListLocations (All)
- AgentsClient.ListOperations
- AgentsClient.ListOperations (All)
- AgentsClient.RestoreAgent
- AgentsClient.UpdateAgent
- AgentsClient.UpdateGenerativeSettings
- AgentsClient.ValidateAgent
- ChangelogsClient.CancelOperation
- ChangelogsClient.GetChangelog
- ChangelogsClient.GetLocation
- ChangelogsClient.GetOperation
- ChangelogsClient.ListChangelogs
- ChangelogsClient.ListChangelogs (All)
- ChangelogsClient.ListLocations
- ChangelogsClient.ListLocations (All)
- ChangelogsClient.ListOperations
- ChangelogsClient.ListOperations (All)
- ConversationHistoryClient.CancelOperation
- ConversationHistoryClient.DeleteConversation
- ConversationHistoryClient.GetConversation
- ConversationHistoryClient.GetLocation
- ConversationHistoryClient.GetOperation
- ConversationHistoryClient.ListConversations
- ConversationHistoryClient.ListConversations (All)
- ConversationHistoryClient.ListLocations
- ConversationHistoryClient.ListLocations (All)
- ConversationHistoryClient.ListOperations
- ConversationHistoryClient.ListOperations (All)
- DeploymentsClient.CancelOperation
- DeploymentsClient.GetDeployment
- DeploymentsClient.GetLocation
- DeploymentsClient.GetOperation
- DeploymentsClient.ListDeployments
- DeploymentsClient.ListDeployments (All)
- DeploymentsClient.ListLocations
- DeploymentsClient.ListLocations (All)
- DeploymentsClient.ListOperations
- DeploymentsClient.ListOperations (All)
- EntityTypesClient.CancelOperation
- EntityTypesClient.CreateEntityType
- EntityTypesClient.DeleteEntityType
- EntityTypesClient.ExportEntityTypes
- EntityTypesClient.GetEntityType
- EntityTypesClient.GetLocation
- EntityTypesClient.GetOperation
- EntityTypesClient.ImportEntityTypes
- EntityTypesClient.ListEntityTypes
- EntityTypesClient.ListEntityTypes (All)
- EntityTypesClient.ListLocations
- EntityTypesClient.ListLocations (All)
- EntityTypesClient.ListOperations
- EntityTypesClient.ListOperations (All)
- EntityTypesClient.UpdateEntityType
- EnvironmentsClient.CancelOperation
- EnvironmentsClient.CreateEnvironment
- EnvironmentsClient.DeleteEnvironment
- EnvironmentsClient.DeployFlow
- EnvironmentsClient.GetEnvironment
- EnvironmentsClient.GetLocation
- EnvironmentsClient.GetOperation
- EnvironmentsClient.ListContinuousTestResults
- EnvironmentsClient.ListContinuousTestResults (All)
- EnvironmentsClient.ListEnvironments
- EnvironmentsClient.ListEnvironments (All)
- EnvironmentsClient.ListLocations
- EnvironmentsClient.ListLocations (All)
- EnvironmentsClient.ListOperations
- EnvironmentsClient.ListOperations (All)
- EnvironmentsClient.LookupEnvironmentHistory
- EnvironmentsClient.LookupEnvironmentHistory (All)
- EnvironmentsClient.RunContinuousTest
- EnvironmentsClient.UpdateEnvironment
- ExamplesClient.CancelOperation
- ExamplesClient.CreateExample
- ExamplesClient.DeleteExample
- ExamplesClient.GetExample
- ExamplesClient.GetLocation
- ExamplesClient.GetOperation
- ExamplesClient.ListExamples
- ExamplesClient.ListExamples (All)
- ExamplesClient.ListLocations
- ExamplesClient.ListLocations (All)
- ExamplesClient.ListOperations
- ExamplesClient.ListOperations (All)
- ExamplesClient.UpdateExample
- ExperimentsClient.CancelOperation
- ExperimentsClient.CreateExperiment
- ExperimentsClient.DeleteExperiment
- ExperimentsClient.GetExperiment
- ExperimentsClient.GetLocation
- ExperimentsClient.GetOperation
- ExperimentsClient.ListExperiments
- ExperimentsClient.ListExperiments (All)
- ExperimentsClient.ListLocations
- ExperimentsClient.ListLocations (All)
- ExperimentsClient.ListOperations
- ExperimentsClient.ListOperations (All)
- ExperimentsClient.StartExperiment
- ExperimentsClient.StopExperiment
- ExperimentsClient.UpdateExperiment
- FlowsClient.CancelOperation
- FlowsClient.CreateFlow
- FlowsClient.DeleteFlow
- FlowsClient.ExportFlow
- FlowsClient.GetFlow
- FlowsClient.GetFlowValidationResult
- FlowsClient.GetLocation
- FlowsClient.GetOperation
- FlowsClient.ImportFlow
- FlowsClient.ListFlows
- FlowsClient.ListFlows (All)
- FlowsClient.ListLocations
- FlowsClient.ListLocations (All)
- FlowsClient.ListOperations
- FlowsClient.ListOperations (All)
- FlowsClient.TrainFlow
- FlowsClient.UpdateFlow
- FlowsClient.ValidateFlow
- GeneratorsClient.CancelOperation
- GeneratorsClient.CreateGenerator
- GeneratorsClient.DeleteGenerator
- GeneratorsClient.GetGenerator
- GeneratorsClient.GetLocation
- GeneratorsClient.GetOperation
- GeneratorsClient.ListGenerators
- GeneratorsClient.ListGenerators (All)
- GeneratorsClient.ListLocations
- GeneratorsClient.ListLocations (All)
- GeneratorsClient.ListOperations
- GeneratorsClient.ListOperations (All)
- GeneratorsClient.UpdateGenerator
- IntentsClient.CancelOperation
- IntentsClient.CreateIntent
- IntentsClient.DeleteIntent
- IntentsClient.ExportIntents
- IntentsClient.GetIntent
- IntentsClient.GetLocation
- IntentsClient.GetOperation
- IntentsClient.ImportIntents
- IntentsClient.ListIntents
- IntentsClient.ListIntents (All)
- IntentsClient.ListLocations
- IntentsClient.ListLocations (All)
- IntentsClient.ListOperations
- IntentsClient.ListOperations (All)
- IntentsClient.UpdateIntent
- NewAgentsClient
- NewAgentsRESTClient
- NewChangelogsClient
- NewChangelogsRESTClient
- NewConversationHistoryClient
- NewConversationHistoryRESTClient
- NewDeploymentsClient
- NewDeploymentsRESTClient
- NewEntityTypesClient
- NewEntityTypesRESTClient
- NewEnvironmentsClient
- NewEnvironmentsRESTClient
- NewExamplesClient
- NewExamplesRESTClient
- NewExperimentsClient
- NewExperimentsRESTClient
- NewFlowsClient
- NewFlowsRESTClient
- NewGeneratorsClient
- NewGeneratorsRESTClient
- NewIntentsClient
- NewIntentsRESTClient
- NewPagesClient
- NewPagesRESTClient
- NewPlaybooksClient
- NewPlaybooksRESTClient
- NewSecuritySettingsClient
- NewSecuritySettingsRESTClient
- NewSessionEntityTypesClient
- NewSessionEntityTypesRESTClient
- NewSessionsClient
- NewSessionsRESTClient
- NewTestCasesClient
- NewTestCasesRESTClient
- NewToolsClient
- NewToolsRESTClient
- NewTransitionRouteGroupsClient
- NewTransitionRouteGroupsRESTClient
- NewVersionsClient
- NewVersionsRESTClient
- NewWebhooksClient
- NewWebhooksRESTClient
- PagesClient.CancelOperation
- PagesClient.CreatePage
- PagesClient.DeletePage
- PagesClient.GetLocation
- PagesClient.GetOperation
- PagesClient.GetPage
- PagesClient.ListLocations
- PagesClient.ListLocations (All)
- PagesClient.ListOperations
- PagesClient.ListOperations (All)
- PagesClient.ListPages
- PagesClient.ListPages (All)
- PagesClient.UpdatePage
- PlaybooksClient.CancelOperation
- PlaybooksClient.CreatePlaybook
- PlaybooksClient.CreatePlaybookVersion
- PlaybooksClient.DeletePlaybook
- PlaybooksClient.DeletePlaybookVersion
- PlaybooksClient.GetLocation
- PlaybooksClient.GetOperation
- PlaybooksClient.GetPlaybook
- PlaybooksClient.GetPlaybookVersion
- PlaybooksClient.ListLocations
- PlaybooksClient.ListLocations (All)
- PlaybooksClient.ListOperations
- PlaybooksClient.ListOperations (All)
- PlaybooksClient.ListPlaybookVersions
- PlaybooksClient.ListPlaybookVersions (All)
- PlaybooksClient.ListPlaybooks
- PlaybooksClient.ListPlaybooks (All)
- PlaybooksClient.UpdatePlaybook
- SecuritySettingsClient.CancelOperation
- SecuritySettingsClient.CreateSecuritySettings
- SecuritySettingsClient.DeleteSecuritySettings
- SecuritySettingsClient.GetLocation
- SecuritySettingsClient.GetOperation
- SecuritySettingsClient.GetSecuritySettings
- SecuritySettingsClient.ListLocations
- SecuritySettingsClient.ListLocations (All)
- SecuritySettingsClient.ListOperations
- SecuritySettingsClient.ListOperations (All)
- SecuritySettingsClient.ListSecuritySettings
- SecuritySettingsClient.ListSecuritySettings (All)
- SecuritySettingsClient.UpdateSecuritySettings
- SessionEntityTypesClient.CancelOperation
- SessionEntityTypesClient.CreateSessionEntityType
- SessionEntityTypesClient.DeleteSessionEntityType
- SessionEntityTypesClient.GetLocation
- SessionEntityTypesClient.GetOperation
- SessionEntityTypesClient.GetSessionEntityType
- SessionEntityTypesClient.ListLocations
- SessionEntityTypesClient.ListLocations (All)
- SessionEntityTypesClient.ListOperations
- SessionEntityTypesClient.ListOperations (All)
- SessionEntityTypesClient.ListSessionEntityTypes
- SessionEntityTypesClient.ListSessionEntityTypes (All)
- SessionEntityTypesClient.UpdateSessionEntityType
- SessionsClient.CancelOperation
- SessionsClient.DetectIntent
- SessionsClient.FulfillIntent
- SessionsClient.GetLocation
- SessionsClient.GetOperation
- SessionsClient.ListLocations
- SessionsClient.ListLocations (All)
- SessionsClient.ListOperations
- SessionsClient.ListOperations (All)
- SessionsClient.MatchIntent
- SessionsClient.StreamingDetectIntent
- SessionsClient.SubmitAnswerFeedback
- TestCasesClient.BatchDeleteTestCases
- TestCasesClient.BatchRunTestCases
- TestCasesClient.CalculateCoverage
- TestCasesClient.CancelOperation
- TestCasesClient.CreateTestCase
- TestCasesClient.ExportTestCases
- TestCasesClient.GetLocation
- TestCasesClient.GetOperation
- TestCasesClient.GetTestCase
- TestCasesClient.GetTestCaseResult
- TestCasesClient.ImportTestCases
- TestCasesClient.ListLocations
- TestCasesClient.ListLocations (All)
- TestCasesClient.ListOperations
- TestCasesClient.ListOperations (All)
- TestCasesClient.ListTestCaseResults
- TestCasesClient.ListTestCaseResults (All)
- TestCasesClient.ListTestCases
- TestCasesClient.ListTestCases (All)
- TestCasesClient.RunTestCase
- TestCasesClient.UpdateTestCase
- ToolsClient.CancelOperation
- ToolsClient.CreateTool
- ToolsClient.DeleteTool
- ToolsClient.ExportTools
- ToolsClient.GetLocation
- ToolsClient.GetOperation
- ToolsClient.GetTool
- ToolsClient.ListLocations
- ToolsClient.ListLocations (All)
- ToolsClient.ListOperations
- ToolsClient.ListOperations (All)
- ToolsClient.ListTools
- ToolsClient.ListTools (All)
- ToolsClient.UpdateTool
- TransitionRouteGroupsClient.CancelOperation
- TransitionRouteGroupsClient.CreateTransitionRouteGroup
- TransitionRouteGroupsClient.DeleteTransitionRouteGroup
- TransitionRouteGroupsClient.GetLocation
- TransitionRouteGroupsClient.GetOperation
- TransitionRouteGroupsClient.GetTransitionRouteGroup
- TransitionRouteGroupsClient.ListLocations
- TransitionRouteGroupsClient.ListLocations (All)
- TransitionRouteGroupsClient.ListOperations
- TransitionRouteGroupsClient.ListOperations (All)
- TransitionRouteGroupsClient.ListTransitionRouteGroups
- TransitionRouteGroupsClient.ListTransitionRouteGroups (All)
- TransitionRouteGroupsClient.UpdateTransitionRouteGroup
- VersionsClient.CancelOperation
- VersionsClient.CompareVersions
- VersionsClient.CreateVersion
- VersionsClient.DeleteVersion
- VersionsClient.GetLocation
- VersionsClient.GetOperation
- VersionsClient.GetVersion
- VersionsClient.ListLocations
- VersionsClient.ListLocations (All)
- VersionsClient.ListOperations
- VersionsClient.ListOperations (All)
- VersionsClient.ListVersions
- VersionsClient.ListVersions (All)
- VersionsClient.LoadVersion
- VersionsClient.UpdateVersion
- WebhooksClient.CancelOperation
- WebhooksClient.CreateWebhook
- WebhooksClient.DeleteWebhook
- WebhooksClient.GetLocation
- WebhooksClient.GetOperation
- WebhooksClient.GetWebhook
- WebhooksClient.ListLocations
- WebhooksClient.ListLocations (All)
- WebhooksClient.ListOperations
- WebhooksClient.ListOperations (All)
- WebhooksClient.ListWebhooks
- WebhooksClient.ListWebhooks (All)
- WebhooksClient.UpdateWebhook
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type 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 []*cxpb.Agent, nextPageToken string, err error) // contains filtered or unexported fields }
AgentIterator manages a stream of *cxpb.Agent.
func (*AgentIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*AgentIterator) Next ¶
func (it *AgentIterator) Next() (*cxpb.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.
type AgentsCallOptions ¶
type AgentsCallOptions struct { ListAgents []gax.CallOption GetAgent []gax.CallOption CreateAgent []gax.CallOption UpdateAgent []gax.CallOption DeleteAgent []gax.CallOption ExportAgent []gax.CallOption RestoreAgent []gax.CallOption ValidateAgent []gax.CallOption GetAgentValidationResult []gax.CallOption GetGenerativeSettings []gax.CallOption UpdateGenerativeSettings []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.
type 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.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewAgentsRESTClient ¶
func NewAgentsRESTClient(ctx context.Context, opts ...option.ClientOption) (*AgentsClient, error)
NewAgentsRESTClient creates a new agents rest client.
Service for managing Agents.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewAgentsRESTClient(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.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*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: Connections are now pooled so this method does not always return the same resource.
func (*AgentsClient) CreateAgent ¶
func (c *AgentsClient) CreateAgent(ctx context.Context, req *cxpb.CreateAgentRequest, opts ...gax.CallOption) (*cxpb.Agent, error)
CreateAgent creates an agent in the specified location.
Note: You should always train a flow prior to sending it queries. See the
training
documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training).
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateAgentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreateAgentRequest.
}
resp, err := c.CreateAgent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentsClient) DeleteAgent ¶
func (c *AgentsClient) DeleteAgent(ctx context.Context, req *cxpb.DeleteAgentRequest, opts ...gax.CallOption) error
DeleteAgent deletes the specified agent.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteAgentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeleteAgentRequest.
}
err = c.DeleteAgent(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AgentsClient) ExportAgent ¶
func (c *AgentsClient) ExportAgent(ctx context.Context, req *cxpb.ExportAgentRequest, opts ...gax.CallOption) (*ExportAgentOperation, error)
ExportAgent exports the specified agent to a binary file.
This method is a long-running operation (at https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 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¶
Code:play
package main import ( "context" cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := cx.NewAgentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &cxpb.ExportAgentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#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 *cxpb.GetAgentRequest, opts ...gax.CallOption) (*cxpb.Agent, error)
GetAgent retrieves the specified agent.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetAgentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetAgentRequest.
}
resp, err := c.GetAgent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentsClient) GetAgentValidationResult ¶
func (c *AgentsClient) GetAgentValidationResult(ctx context.Context, req *cxpb.GetAgentValidationResultRequest, opts ...gax.CallOption) (*cxpb.AgentValidationResult, error)
GetAgentValidationResult gets the latest agent validation result. Agent validation is performed
when ValidateAgent is called.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetAgentValidationResultRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetAgentValidationResultRequest.
}
resp, err := c.GetAgentValidationResult(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentsClient) GetGenerativeSettings ¶
func (c *AgentsClient) GetGenerativeSettings(ctx context.Context, req *cxpb.GetGenerativeSettingsRequest, opts ...gax.CallOption) (*cxpb.GenerativeSettings, error)
GetGenerativeSettings gets the generative settings for the agent.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetGenerativeSettingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetGenerativeSettingsRequest.
}
resp, err := c.GetGenerativeSettings(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.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.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.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentsClient) ListAgents ¶
func (c *AgentsClient) ListAgents(ctx context.Context, req *cxpb.ListAgentsRequest, opts ...gax.CallOption) *AgentIterator
ListAgents returns the list of all agents in the specified location.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListAgentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListAgentsRequest.
}
it := c.ListAgents(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListAgentsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListAgentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListAgentsRequest.
}
for resp, err := range c.ListAgents(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
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.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.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
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any 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.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AgentsClient) RestoreAgent ¶
func (c *AgentsClient) RestoreAgent(ctx context.Context, req *cxpb.RestoreAgentRequest, opts ...gax.CallOption) (*RestoreAgentOperation, error)
RestoreAgent restores the specified agent from a binary file.
Replaces the current agent with a new one. Note that all existing resources in agent (e.g. intents, entity types, flows) will be removed.
This method is a long-running operation (at https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 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 a flow prior to sending it queries. See the
training
documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training).
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.RestoreAgentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#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) UpdateAgent ¶
func (c *AgentsClient) UpdateAgent(ctx context.Context, req *cxpb.UpdateAgentRequest, opts ...gax.CallOption) (*cxpb.Agent, error)
UpdateAgent updates the specified agent.
Note: You should always train a flow prior to sending it queries. See the
training
documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training).
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateAgentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdateAgentRequest.
}
resp, err := c.UpdateAgent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentsClient) UpdateGenerativeSettings ¶
func (c *AgentsClient) UpdateGenerativeSettings(ctx context.Context, req *cxpb.UpdateGenerativeSettingsRequest, opts ...gax.CallOption) (*cxpb.GenerativeSettings, error)
UpdateGenerativeSettings updates the generative settings for the agent.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateGenerativeSettingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdateGenerativeSettingsRequest.
}
resp, err := c.UpdateGenerativeSettings(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentsClient) ValidateAgent ¶
func (c *AgentsClient) ValidateAgent(ctx context.Context, req *cxpb.ValidateAgentRequest, opts ...gax.CallOption) (*cxpb.AgentValidationResult, error)
ValidateAgent validates the specified agent and creates or updates validation results.
The agent in draft version is validated. Please call this API after the
training is completed to get the complete validation results.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ValidateAgentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ValidateAgentRequest.
}
resp, err := c.ValidateAgent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type BatchRunTestCasesOperation ¶
type BatchRunTestCasesOperation struct {
// contains filtered or unexported fields
}
BatchRunTestCasesOperation manages a long-running operation from BatchRunTestCases.
func (*BatchRunTestCasesOperation) Done ¶
func (op *BatchRunTestCasesOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*BatchRunTestCasesOperation) Metadata ¶
func (op *BatchRunTestCasesOperation) Metadata() (*cxpb.BatchRunTestCasesMetadata, 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 (*BatchRunTestCasesOperation) Name ¶
func (op *BatchRunTestCasesOperation) 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 (*BatchRunTestCasesOperation) Poll ¶
func (op *BatchRunTestCasesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.BatchRunTestCasesResponse, 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 (*BatchRunTestCasesOperation) Wait ¶
func (op *BatchRunTestCasesOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.BatchRunTestCasesResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type ChangelogIterator ¶
type ChangelogIterator 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 []*cxpb.Changelog, nextPageToken string, err error) // contains filtered or unexported fields }
ChangelogIterator manages a stream of *cxpb.Changelog.
func (*ChangelogIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ChangelogIterator) Next ¶
func (it *ChangelogIterator) Next() (*cxpb.Changelog, 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 (*ChangelogIterator) PageInfo ¶
func (it *ChangelogIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ChangelogsCallOptions ¶
type ChangelogsCallOptions struct { ListChangelogs []gax.CallOption GetChangelog []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
ChangelogsCallOptions contains the retry settings for each method of ChangelogsClient.
type ChangelogsClient ¶
type ChangelogsClient struct { // The call options for this service. CallOptions *ChangelogsCallOptions // contains filtered or unexported fields }
ChangelogsClient 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 Changelogs.
func NewChangelogsClient ¶
func NewChangelogsClient(ctx context.Context, opts ...option.ClientOption) (*ChangelogsClient, error)
NewChangelogsClient creates a new changelogs 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
Changelogs.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewChangelogsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewChangelogsRESTClient ¶
func NewChangelogsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ChangelogsClient, error)
NewChangelogsRESTClient creates a new changelogs rest client.
Service for managing
Changelogs.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewChangelogsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ChangelogsClient) CancelOperation ¶
func (c *ChangelogsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewChangelogsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ChangelogsClient) Close ¶
func (c *ChangelogsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ChangelogsClient) Connection ¶
func (c *ChangelogsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ChangelogsClient) GetChangelog ¶
func (c *ChangelogsClient) GetChangelog(ctx context.Context, req *cxpb.GetChangelogRequest, opts ...gax.CallOption) (*cxpb.Changelog, error)
GetChangelog retrieves the specified Changelog.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewChangelogsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetChangelogRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetChangelogRequest.
}
resp, err := c.GetChangelog(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ChangelogsClient) GetLocation ¶
func (c *ChangelogsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewChangelogsClient(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 (*ChangelogsClient) GetOperation ¶
func (c *ChangelogsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewChangelogsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ChangelogsClient) ListChangelogs ¶
func (c *ChangelogsClient) ListChangelogs(ctx context.Context, req *cxpb.ListChangelogsRequest, opts ...gax.CallOption) *ChangelogIterator
ListChangelogs returns the list of Changelogs.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewChangelogsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListChangelogsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListChangelogsRequest.
}
it := c.ListChangelogs(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListChangelogsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewChangelogsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListChangelogsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListChangelogsRequest.
}
for resp, err := range c.ListChangelogs(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ChangelogsClient) ListLocations ¶
func (c *ChangelogsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewChangelogsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewChangelogsClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ChangelogsClient) ListOperations ¶
func (c *ChangelogsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewChangelogsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewChangelogsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type ContinuousTestResultIterator ¶
type ContinuousTestResultIterator 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 []*cxpb.ContinuousTestResult, nextPageToken string, err error) // contains filtered or unexported fields }
ContinuousTestResultIterator manages a stream of *cxpb.ContinuousTestResult.
func (*ContinuousTestResultIterator) All ¶
func (it *ContinuousTestResultIterator) All() iter.Seq2[*cxpb.ContinuousTestResult, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ContinuousTestResultIterator) Next ¶
func (it *ContinuousTestResultIterator) Next() (*cxpb.ContinuousTestResult, 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 (*ContinuousTestResultIterator) PageInfo ¶
func (it *ContinuousTestResultIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ConversationHistoryCallOptions ¶
type ConversationHistoryCallOptions struct { ListConversations []gax.CallOption GetConversation []gax.CallOption DeleteConversation []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
ConversationHistoryCallOptions contains the retry settings for each method of ConversationHistoryClient.
type ConversationHistoryClient ¶
type ConversationHistoryClient struct { // The call options for this service. CallOptions *ConversationHistoryCallOptions // contains filtered or unexported fields }
ConversationHistoryClient 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 conversation history.
func NewConversationHistoryClient ¶
func NewConversationHistoryClient(ctx context.Context, opts ...option.ClientOption) (*ConversationHistoryClient, error)
NewConversationHistoryClient creates a new conversation history 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 conversation history.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewConversationHistoryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewConversationHistoryRESTClient ¶
func NewConversationHistoryRESTClient(ctx context.Context, opts ...option.ClientOption) (*ConversationHistoryClient, error)
NewConversationHistoryRESTClient creates a new conversation history rest client.
Service for managing conversation history.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewConversationHistoryRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ConversationHistoryClient) CancelOperation ¶
func (c *ConversationHistoryClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewConversationHistoryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ConversationHistoryClient) Close ¶
func (c *ConversationHistoryClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ConversationHistoryClient) Connection ¶
func (c *ConversationHistoryClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ConversationHistoryClient) DeleteConversation ¶
func (c *ConversationHistoryClient) DeleteConversation(ctx context.Context, req *cxpb.DeleteConversationRequest, opts ...gax.CallOption) error
DeleteConversation deletes the specified conversation.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewConversationHistoryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteConversationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeleteConversationRequest.
}
err = c.DeleteConversation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ConversationHistoryClient) GetConversation ¶
func (c *ConversationHistoryClient) GetConversation(ctx context.Context, req *cxpb.GetConversationRequest, opts ...gax.CallOption) (*cxpb.Conversation, error)
GetConversation retrieves the specified conversation.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewConversationHistoryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetConversationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetConversationRequest.
}
resp, err := c.GetConversation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConversationHistoryClient) GetLocation ¶
func (c *ConversationHistoryClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewConversationHistoryClient(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 (*ConversationHistoryClient) GetOperation ¶
func (c *ConversationHistoryClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewConversationHistoryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ConversationHistoryClient) ListConversations ¶
func (c *ConversationHistoryClient) ListConversations(ctx context.Context, req *cxpb.ListConversationsRequest, opts ...gax.CallOption) *ConversationIterator
ListConversations returns the list of all conversations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewConversationHistoryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListConversationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListConversationsRequest.
}
it := c.ListConversations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListConversationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewConversationHistoryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListConversationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListConversationsRequest.
}
for resp, err := range c.ListConversations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ConversationHistoryClient) ListLocations ¶
func (c *ConversationHistoryClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewConversationHistoryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewConversationHistoryClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ConversationHistoryClient) ListOperations ¶
func (c *ConversationHistoryClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewConversationHistoryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewConversationHistoryClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type 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 []*cxpb.Conversation, nextPageToken string, err error) // contains filtered or unexported fields }
ConversationIterator manages a stream of *cxpb.Conversation.
func (*ConversationIterator) All ¶
func (it *ConversationIterator) All() iter.Seq2[*cxpb.Conversation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ConversationIterator) Next ¶
func (it *ConversationIterator) Next() (*cxpb.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.
type CreateEnvironmentOperation ¶
type CreateEnvironmentOperation struct {
// contains filtered or unexported fields
}
CreateEnvironmentOperation manages a long-running operation from CreateEnvironment.
func (*CreateEnvironmentOperation) Done ¶
func (op *CreateEnvironmentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateEnvironmentOperation) Metadata ¶
func (op *CreateEnvironmentOperation) 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 (*CreateEnvironmentOperation) Name ¶
func (op *CreateEnvironmentOperation) 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 (*CreateEnvironmentOperation) Poll ¶
func (op *CreateEnvironmentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.Environment, 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 (*CreateEnvironmentOperation) Wait ¶
func (op *CreateEnvironmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.Environment, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type CreateVersionOperation ¶
type CreateVersionOperation struct {
// contains filtered or unexported fields
}
CreateVersionOperation manages a long-running operation from CreateVersion.
func (*CreateVersionOperation) Done ¶
func (op *CreateVersionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateVersionOperation) Metadata ¶
func (op *CreateVersionOperation) Metadata() (*cxpb.CreateVersionOperationMetadata, 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 (*CreateVersionOperation) Name ¶
func (op *CreateVersionOperation) 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 (*CreateVersionOperation) Poll ¶
func (op *CreateVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.Version, 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 (*CreateVersionOperation) Wait ¶
func (op *CreateVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.Version, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeployFlowOperation ¶
type DeployFlowOperation struct {
// contains filtered or unexported fields
}
DeployFlowOperation manages a long-running operation from DeployFlow.
func (*DeployFlowOperation) Done ¶
func (op *DeployFlowOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeployFlowOperation) Metadata ¶
func (op *DeployFlowOperation) Metadata() (*cxpb.DeployFlowMetadata, 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 (*DeployFlowOperation) Name ¶
func (op *DeployFlowOperation) 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 (*DeployFlowOperation) Poll ¶
func (op *DeployFlowOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.DeployFlowResponse, 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 (*DeployFlowOperation) Wait ¶
func (op *DeployFlowOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.DeployFlowResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeploymentIterator ¶
type DeploymentIterator 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 []*cxpb.Deployment, nextPageToken string, err error) // contains filtered or unexported fields }
DeploymentIterator manages a stream of *cxpb.Deployment.
func (*DeploymentIterator) All ¶
func (it *DeploymentIterator) All() iter.Seq2[*cxpb.Deployment, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*DeploymentIterator) Next ¶
func (it *DeploymentIterator) Next() (*cxpb.Deployment, 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 (*DeploymentIterator) PageInfo ¶
func (it *DeploymentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type DeploymentsCallOptions ¶
type DeploymentsCallOptions struct { ListDeployments []gax.CallOption GetDeployment []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
DeploymentsCallOptions contains the retry settings for each method of DeploymentsClient.
type DeploymentsClient ¶
type DeploymentsClient struct { // The call options for this service. CallOptions *DeploymentsCallOptions // contains filtered or unexported fields }
DeploymentsClient 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 Deployments.
func NewDeploymentsClient ¶
func NewDeploymentsClient(ctx context.Context, opts ...option.ClientOption) (*DeploymentsClient, error)
NewDeploymentsClient creates a new deployments 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
Deployments.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewDeploymentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewDeploymentsRESTClient ¶
func NewDeploymentsRESTClient(ctx context.Context, opts ...option.ClientOption) (*DeploymentsClient, error)
NewDeploymentsRESTClient creates a new deployments rest client.
Service for managing
Deployments.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewDeploymentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*DeploymentsClient) CancelOperation ¶
func (c *DeploymentsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewDeploymentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*DeploymentsClient) Close ¶
func (c *DeploymentsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*DeploymentsClient) Connection ¶
func (c *DeploymentsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*DeploymentsClient) GetDeployment ¶
func (c *DeploymentsClient) GetDeployment(ctx context.Context, req *cxpb.GetDeploymentRequest, opts ...gax.CallOption) (*cxpb.Deployment, error)
GetDeployment retrieves the specified
Deployment.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewDeploymentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetDeploymentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetDeploymentRequest.
}
resp, err := c.GetDeployment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DeploymentsClient) GetLocation ¶
func (c *DeploymentsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewDeploymentsClient(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 (*DeploymentsClient) GetOperation ¶
func (c *DeploymentsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewDeploymentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DeploymentsClient) ListDeployments ¶
func (c *DeploymentsClient) ListDeployments(ctx context.Context, req *cxpb.ListDeploymentsRequest, opts ...gax.CallOption) *DeploymentIterator
ListDeployments returns the list of all deployments in the specified
Environment.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewDeploymentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListDeploymentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListDeploymentsRequest.
}
it := c.ListDeployments(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListDeploymentsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewDeploymentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListDeploymentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListDeploymentsRequest.
}
for resp, err := range c.ListDeployments(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DeploymentsClient) ListLocations ¶
func (c *DeploymentsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewDeploymentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewDeploymentsClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DeploymentsClient) ListOperations ¶
func (c *DeploymentsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewDeploymentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewDeploymentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
type EntityTypeIterator ¶
type EntityTypeIterator 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 []*cxpb.EntityType, nextPageToken string, err error) // contains filtered or unexported fields }
EntityTypeIterator manages a stream of *cxpb.EntityType.
func (*EntityTypeIterator) All ¶
func (it *EntityTypeIterator) All() iter.Seq2[*cxpb.EntityType, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*EntityTypeIterator) Next ¶
func (it *EntityTypeIterator) Next() (*cxpb.EntityType, 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 (*EntityTypeIterator) PageInfo ¶
func (it *EntityTypeIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type EntityTypesCallOptions ¶
type EntityTypesCallOptions struct { GetEntityType []gax.CallOption CreateEntityType []gax.CallOption UpdateEntityType []gax.CallOption DeleteEntityType []gax.CallOption ListEntityTypes []gax.CallOption ExportEntityTypes []gax.CallOption ImportEntityTypes []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
EntityTypesCallOptions contains the retry settings for each method of EntityTypesClient.
type EntityTypesClient ¶
type EntityTypesClient struct { // The call options for this service. CallOptions *EntityTypesCallOptions // 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 }
EntityTypesClient 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 EntityTypes.
func NewEntityTypesClient ¶
func NewEntityTypesClient(ctx context.Context, opts ...option.ClientOption) (*EntityTypesClient, error)
NewEntityTypesClient creates a new entity types 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
EntityTypes.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewEntityTypesRESTClient ¶
func NewEntityTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*EntityTypesClient, error)
NewEntityTypesRESTClient creates a new entity types rest client.
Service for managing
EntityTypes.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEntityTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*EntityTypesClient) CancelOperation ¶
func (c *EntityTypesClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*EntityTypesClient) Close ¶
func (c *EntityTypesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*EntityTypesClient) Connection ¶
func (c *EntityTypesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*EntityTypesClient) CreateEntityType ¶
func (c *EntityTypesClient) CreateEntityType(ctx context.Context, req *cxpb.CreateEntityTypeRequest, opts ...gax.CallOption) (*cxpb.EntityType, error)
CreateEntityType creates an entity type in the specified agent.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateEntityTypeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreateEntityTypeRequest.
}
resp, err := c.CreateEntityType(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EntityTypesClient) DeleteEntityType ¶
func (c *EntityTypesClient) DeleteEntityType(ctx context.Context, req *cxpb.DeleteEntityTypeRequest, opts ...gax.CallOption) error
DeleteEntityType deletes the specified entity type.
Note: You should always train a flow prior to sending it queries. See the
training
documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training).
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteEntityTypeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeleteEntityTypeRequest.
}
err = c.DeleteEntityType(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*EntityTypesClient) ExportEntityTypes ¶
func (c *EntityTypesClient) ExportEntityTypes(ctx context.Context, req *cxpb.ExportEntityTypesRequest, opts ...gax.CallOption) (*ExportEntityTypesOperation, error)
ExportEntityTypes exports the selected entity types.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ExportEntityTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ExportEntityTypesRequest.
}
op, err := c.ExportEntityTypes(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EntityTypesClient) ExportEntityTypesOperation ¶
func (c *EntityTypesClient) ExportEntityTypesOperation(name string) *ExportEntityTypesOperation
ExportEntityTypesOperation returns a new ExportEntityTypesOperation from a given name. The name must be that of a previously created ExportEntityTypesOperation, possibly from a different process.
func (*EntityTypesClient) GetEntityType ¶
func (c *EntityTypesClient) GetEntityType(ctx context.Context, req *cxpb.GetEntityTypeRequest, opts ...gax.CallOption) (*cxpb.EntityType, error)
GetEntityType retrieves the specified entity type.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetEntityTypeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetEntityTypeRequest.
}
resp, err := c.GetEntityType(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EntityTypesClient) GetLocation ¶
func (c *EntityTypesClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEntityTypesClient(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 (*EntityTypesClient) GetOperation ¶
func (c *EntityTypesClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EntityTypesClient) ImportEntityTypes ¶
func (c *EntityTypesClient) ImportEntityTypes(ctx context.Context, req *cxpb.ImportEntityTypesRequest, opts ...gax.CallOption) (*ImportEntityTypesOperation, error)
ImportEntityTypes imports the specified entitytypes into the agent.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ImportEntityTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ImportEntityTypesRequest.
}
op, err := c.ImportEntityTypes(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EntityTypesClient) ImportEntityTypesOperation ¶
func (c *EntityTypesClient) ImportEntityTypesOperation(name string) *ImportEntityTypesOperation
ImportEntityTypesOperation returns a new ImportEntityTypesOperation from a given name. The name must be that of a previously created ImportEntityTypesOperation, possibly from a different process.
func (*EntityTypesClient) ListEntityTypes ¶
func (c *EntityTypesClient) ListEntityTypes(ctx context.Context, req *cxpb.ListEntityTypesRequest, opts ...gax.CallOption) *EntityTypeIterator
ListEntityTypes returns the list of all entity types in the specified agent.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListEntityTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListEntityTypesRequest.
}
it := c.ListEntityTypes(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListEntityTypesResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListEntityTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListEntityTypesRequest.
}
for resp, err := range c.ListEntityTypes(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*EntityTypesClient) ListLocations ¶
func (c *EntityTypesClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEntityTypesClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*EntityTypesClient) ListOperations ¶
func (c *EntityTypesClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*EntityTypesClient) UpdateEntityType ¶
func (c *EntityTypesClient) UpdateEntityType(ctx context.Context, req *cxpb.UpdateEntityTypeRequest, opts ...gax.CallOption) (*cxpb.EntityType, error)
UpdateEntityType updates the specified entity type.
Note: You should always train a flow prior to sending it queries. See the
training
documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training).
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateEntityTypeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdateEntityTypeRequest.
}
resp, err := c.UpdateEntityType(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type EnvironmentIterator ¶
type EnvironmentIterator 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 []*cxpb.Environment, nextPageToken string, err error) // contains filtered or unexported fields }
EnvironmentIterator manages a stream of *cxpb.Environment.
func (*EnvironmentIterator) All ¶
func (it *EnvironmentIterator) All() iter.Seq2[*cxpb.Environment, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*EnvironmentIterator) Next ¶
func (it *EnvironmentIterator) Next() (*cxpb.Environment, 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 (*EnvironmentIterator) PageInfo ¶
func (it *EnvironmentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type EnvironmentsCallOptions ¶
type EnvironmentsCallOptions struct { ListEnvironments []gax.CallOption GetEnvironment []gax.CallOption CreateEnvironment []gax.CallOption UpdateEnvironment []gax.CallOption DeleteEnvironment []gax.CallOption LookupEnvironmentHistory []gax.CallOption RunContinuousTest []gax.CallOption ListContinuousTestResults []gax.CallOption DeployFlow []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
EnvironmentsCallOptions contains the retry settings for each method of EnvironmentsClient.
type EnvironmentsClient ¶
type EnvironmentsClient struct { // The call options for this service. CallOptions *EnvironmentsCallOptions // 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 }
EnvironmentsClient 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 Environments.
func NewEnvironmentsClient ¶
func NewEnvironmentsClient(ctx context.Context, opts ...option.ClientOption) (*EnvironmentsClient, error)
NewEnvironmentsClient creates a new environments 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
Environments.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewEnvironmentsRESTClient ¶
func NewEnvironmentsRESTClient(ctx context.Context, opts ...option.ClientOption) (*EnvironmentsClient, error)
NewEnvironmentsRESTClient creates a new environments rest client.
Service for managing
Environments.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEnvironmentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*EnvironmentsClient) CancelOperation ¶
func (c *EnvironmentsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*EnvironmentsClient) Close ¶
func (c *EnvironmentsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*EnvironmentsClient) Connection ¶
func (c *EnvironmentsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*EnvironmentsClient) CreateEnvironment ¶
func (c *EnvironmentsClient) CreateEnvironment(ctx context.Context, req *cxpb.CreateEnvironmentRequest, opts ...gax.CallOption) (*CreateEnvironmentOperation, error)
CreateEnvironment creates an Environment in the specified Agent.
This method is a long-running operation (at https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 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: Environment
Example¶
Code:play
package main import ( "context" cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := cx.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &cxpb.CreateEnvironmentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreateEnvironmentRequest. } op, err := c.CreateEnvironment(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
func (*EnvironmentsClient) CreateEnvironmentOperation ¶
func (c *EnvironmentsClient) CreateEnvironmentOperation(name string) *CreateEnvironmentOperation
CreateEnvironmentOperation returns a new CreateEnvironmentOperation from a given name. The name must be that of a previously created CreateEnvironmentOperation, possibly from a different process.
func (*EnvironmentsClient) DeleteEnvironment ¶
func (c *EnvironmentsClient) DeleteEnvironment(ctx context.Context, req *cxpb.DeleteEnvironmentRequest, opts ...gax.CallOption) error
DeleteEnvironment deletes the specified
Environment.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteEnvironmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeleteEnvironmentRequest.
}
err = c.DeleteEnvironment(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*EnvironmentsClient) DeployFlow ¶
func (c *EnvironmentsClient) DeployFlow(ctx context.Context, req *cxpb.DeployFlowRequest, opts ...gax.CallOption) (*DeployFlowOperation, error)
DeployFlow deploys a flow to the specified Environment.
This method is a long-running operation (at https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned Operation type has the following method-specific fields:
metadata: DeployFlowMetadata response: DeployFlowResponse
Example¶
Code:play
package main import ( "context" cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := cx.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &cxpb.DeployFlowRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeployFlowRequest. } op, err := c.DeployFlow(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
func (*EnvironmentsClient) DeployFlowOperation ¶
func (c *EnvironmentsClient) DeployFlowOperation(name string) *DeployFlowOperation
DeployFlowOperation returns a new DeployFlowOperation from a given name. The name must be that of a previously created DeployFlowOperation, possibly from a different process.
func (*EnvironmentsClient) GetEnvironment ¶
func (c *EnvironmentsClient) GetEnvironment(ctx context.Context, req *cxpb.GetEnvironmentRequest, opts ...gax.CallOption) (*cxpb.Environment, error)
GetEnvironment retrieves the specified
Environment.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetEnvironmentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetEnvironmentRequest.
}
resp, err := c.GetEnvironment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EnvironmentsClient) GetLocation ¶
func (c *EnvironmentsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEnvironmentsClient(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 (*EnvironmentsClient) GetOperation ¶
func (c *EnvironmentsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EnvironmentsClient) ListContinuousTestResults ¶
func (c *EnvironmentsClient) ListContinuousTestResults(ctx context.Context, req *cxpb.ListContinuousTestResultsRequest, opts ...gax.CallOption) *ContinuousTestResultIterator
ListContinuousTestResults fetches a list of continuous test results for a given environment.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListContinuousTestResultsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListContinuousTestResultsRequest.
}
it := c.ListContinuousTestResults(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListContinuousTestResultsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListContinuousTestResultsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListContinuousTestResultsRequest.
}
for resp, err := range c.ListContinuousTestResults(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*EnvironmentsClient) ListEnvironments ¶
func (c *EnvironmentsClient) ListEnvironments(ctx context.Context, req *cxpb.ListEnvironmentsRequest, opts ...gax.CallOption) *EnvironmentIterator
ListEnvironments returns the list of all environments in the specified
Agent.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListEnvironmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListEnvironmentsRequest.
}
it := c.ListEnvironments(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListEnvironmentsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListEnvironmentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListEnvironmentsRequest.
}
for resp, err := range c.ListEnvironments(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*EnvironmentsClient) ListLocations ¶
func (c *EnvironmentsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEnvironmentsClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*EnvironmentsClient) ListOperations ¶
func (c *EnvironmentsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*EnvironmentsClient) LookupEnvironmentHistory ¶
func (c *EnvironmentsClient) LookupEnvironmentHistory(ctx context.Context, req *cxpb.LookupEnvironmentHistoryRequest, opts ...gax.CallOption) *EnvironmentIterator
LookupEnvironmentHistory looks up the history of the specified
Environment.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.LookupEnvironmentHistoryRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#LookupEnvironmentHistoryRequest.
}
it := c.LookupEnvironmentHistory(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.LookupEnvironmentHistoryResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.LookupEnvironmentHistoryRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#LookupEnvironmentHistoryRequest.
}
for resp, err := range c.LookupEnvironmentHistory(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*EnvironmentsClient) RunContinuousTest ¶
func (c *EnvironmentsClient) RunContinuousTest(ctx context.Context, req *cxpb.RunContinuousTestRequest, opts ...gax.CallOption) (*RunContinuousTestOperation, error)
RunContinuousTest kicks off a continuous test under the specified Environment.
This method is a long-running operation (at https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned Operation type has the following method-specific fields:
metadata: RunContinuousTestMetadata response: RunContinuousTestResponse
Example¶
Code:play
package main import ( "context" cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := cx.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &cxpb.RunContinuousTestRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#RunContinuousTestRequest. } op, err := c.RunContinuousTest(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
func (*EnvironmentsClient) RunContinuousTestOperation ¶
func (c *EnvironmentsClient) RunContinuousTestOperation(name string) *RunContinuousTestOperation
RunContinuousTestOperation returns a new RunContinuousTestOperation from a given name. The name must be that of a previously created RunContinuousTestOperation, possibly from a different process.
func (*EnvironmentsClient) UpdateEnvironment ¶
func (c *EnvironmentsClient) UpdateEnvironment(ctx context.Context, req *cxpb.UpdateEnvironmentRequest, opts ...gax.CallOption) (*UpdateEnvironmentOperation, error)
UpdateEnvironment updates the specified Environment.
This method is a long-running operation (at https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 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: Environment
Example¶
Code:play
package main import ( "context" cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := cx.NewEnvironmentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &cxpb.UpdateEnvironmentRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdateEnvironmentRequest. } op, err := c.UpdateEnvironment(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
func (*EnvironmentsClient) UpdateEnvironmentOperation ¶
func (c *EnvironmentsClient) UpdateEnvironmentOperation(name string) *UpdateEnvironmentOperation
UpdateEnvironmentOperation returns a new UpdateEnvironmentOperation from a given name. The name must be that of a previously created UpdateEnvironmentOperation, possibly from a different process.
type ExampleIterator ¶
type ExampleIterator 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 []*cxpb.Example, nextPageToken string, err error) // contains filtered or unexported fields }
ExampleIterator manages a stream of *cxpb.Example.
func (*ExampleIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ExampleIterator) Next ¶
func (it *ExampleIterator) Next() (*cxpb.Example, 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 (*ExampleIterator) PageInfo ¶
func (it *ExampleIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ExamplesCallOptions ¶
type ExamplesCallOptions struct { CreateExample []gax.CallOption DeleteExample []gax.CallOption ListExamples []gax.CallOption GetExample []gax.CallOption UpdateExample []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
ExamplesCallOptions contains the retry settings for each method of ExamplesClient.
type ExamplesClient ¶
type ExamplesClient struct { // The call options for this service. CallOptions *ExamplesCallOptions // contains filtered or unexported fields }
ExamplesClient 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 Examples.
func NewExamplesClient ¶
func NewExamplesClient(ctx context.Context, opts ...option.ClientOption) (*ExamplesClient, error)
NewExamplesClient creates a new examples 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 Examples.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExamplesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewExamplesRESTClient ¶
func NewExamplesRESTClient(ctx context.Context, opts ...option.ClientOption) (*ExamplesClient, error)
NewExamplesRESTClient creates a new examples rest client.
Service for managing Examples.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExamplesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ExamplesClient) CancelOperation ¶
func (c *ExamplesClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExamplesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ExamplesClient) Close ¶
func (c *ExamplesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ExamplesClient) Connection ¶
func (c *ExamplesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ExamplesClient) CreateExample ¶
func (c *ExamplesClient) CreateExample(ctx context.Context, req *cxpb.CreateExampleRequest, opts ...gax.CallOption) (*cxpb.Example, error)
CreateExample creates an example in the specified playbook.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExamplesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateExampleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreateExampleRequest.
}
resp, err := c.CreateExample(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ExamplesClient) DeleteExample ¶
func (c *ExamplesClient) DeleteExample(ctx context.Context, req *cxpb.DeleteExampleRequest, opts ...gax.CallOption) error
DeleteExample deletes the specified example.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExamplesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteExampleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeleteExampleRequest.
}
err = c.DeleteExample(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ExamplesClient) GetExample ¶
func (c *ExamplesClient) GetExample(ctx context.Context, req *cxpb.GetExampleRequest, opts ...gax.CallOption) (*cxpb.Example, error)
GetExample retrieves the specified example.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExamplesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetExampleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetExampleRequest.
}
resp, err := c.GetExample(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ExamplesClient) GetLocation ¶
func (c *ExamplesClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExamplesClient(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 (*ExamplesClient) GetOperation ¶
func (c *ExamplesClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExamplesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ExamplesClient) ListExamples ¶
func (c *ExamplesClient) ListExamples(ctx context.Context, req *cxpb.ListExamplesRequest, opts ...gax.CallOption) *ExampleIterator
ListExamples returns a list of examples in the specified playbook.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExamplesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListExamplesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListExamplesRequest.
}
it := c.ListExamples(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListExamplesResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExamplesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListExamplesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListExamplesRequest.
}
for resp, err := range c.ListExamples(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ExamplesClient) ListLocations ¶
func (c *ExamplesClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExamplesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExamplesClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ExamplesClient) ListOperations ¶
func (c *ExamplesClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExamplesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExamplesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ExamplesClient) UpdateExample ¶
func (c *ExamplesClient) UpdateExample(ctx context.Context, req *cxpb.UpdateExampleRequest, opts ...gax.CallOption) (*cxpb.Example, error)
UpdateExample update the specified example.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExamplesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateExampleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdateExampleRequest.
}
resp, err := c.UpdateExample(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type ExperimentIterator ¶
type ExperimentIterator 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 []*cxpb.Experiment, nextPageToken string, err error) // contains filtered or unexported fields }
ExperimentIterator manages a stream of *cxpb.Experiment.
func (*ExperimentIterator) All ¶
func (it *ExperimentIterator) All() iter.Seq2[*cxpb.Experiment, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ExperimentIterator) Next ¶
func (it *ExperimentIterator) Next() (*cxpb.Experiment, 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 (*ExperimentIterator) PageInfo ¶
func (it *ExperimentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ExperimentsCallOptions ¶
type ExperimentsCallOptions struct { ListExperiments []gax.CallOption GetExperiment []gax.CallOption CreateExperiment []gax.CallOption UpdateExperiment []gax.CallOption DeleteExperiment []gax.CallOption StartExperiment []gax.CallOption StopExperiment []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
ExperimentsCallOptions contains the retry settings for each method of ExperimentsClient.
type ExperimentsClient ¶
type ExperimentsClient struct { // The call options for this service. CallOptions *ExperimentsCallOptions // contains filtered or unexported fields }
ExperimentsClient 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 Experiments.
func NewExperimentsClient ¶
func NewExperimentsClient(ctx context.Context, opts ...option.ClientOption) (*ExperimentsClient, error)
NewExperimentsClient creates a new experiments 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
Experiments.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewExperimentsRESTClient ¶
func NewExperimentsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ExperimentsClient, error)
NewExperimentsRESTClient creates a new experiments rest client.
Service for managing
Experiments.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExperimentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ExperimentsClient) CancelOperation ¶
func (c *ExperimentsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ExperimentsClient) Close ¶
func (c *ExperimentsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ExperimentsClient) Connection ¶
func (c *ExperimentsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ExperimentsClient) CreateExperiment ¶
func (c *ExperimentsClient) CreateExperiment(ctx context.Context, req *cxpb.CreateExperimentRequest, opts ...gax.CallOption) (*cxpb.Experiment, error)
CreateExperiment creates an Experiment in
the specified
Environment.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateExperimentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreateExperimentRequest.
}
resp, err := c.CreateExperiment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ExperimentsClient) DeleteExperiment ¶
func (c *ExperimentsClient) DeleteExperiment(ctx context.Context, req *cxpb.DeleteExperimentRequest, opts ...gax.CallOption) error
DeleteExperiment deletes the specified
Experiment.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteExperimentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeleteExperimentRequest.
}
err = c.DeleteExperiment(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ExperimentsClient) GetExperiment ¶
func (c *ExperimentsClient) GetExperiment(ctx context.Context, req *cxpb.GetExperimentRequest, opts ...gax.CallOption) (*cxpb.Experiment, error)
GetExperiment retrieves the specified
Experiment.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetExperimentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetExperimentRequest.
}
resp, err := c.GetExperiment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ExperimentsClient) GetLocation ¶
func (c *ExperimentsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExperimentsClient(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 (*ExperimentsClient) GetOperation ¶
func (c *ExperimentsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ExperimentsClient) ListExperiments ¶
func (c *ExperimentsClient) ListExperiments(ctx context.Context, req *cxpb.ListExperimentsRequest, opts ...gax.CallOption) *ExperimentIterator
ListExperiments returns the list of all experiments in the specified
Environment.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListExperimentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListExperimentsRequest.
}
it := c.ListExperiments(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListExperimentsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListExperimentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListExperimentsRequest.
}
for resp, err := range c.ListExperiments(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ExperimentsClient) ListLocations ¶
func (c *ExperimentsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExperimentsClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ExperimentsClient) ListOperations ¶
func (c *ExperimentsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ExperimentsClient) StartExperiment ¶
func (c *ExperimentsClient) StartExperiment(ctx context.Context, req *cxpb.StartExperimentRequest, opts ...gax.CallOption) (*cxpb.Experiment, error)
StartExperiment starts the specified
Experiment. This rpc only
changes the state of experiment from PENDING to RUNNING.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.StartExperimentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#StartExperimentRequest.
}
resp, err := c.StartExperiment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ExperimentsClient) StopExperiment ¶
func (c *ExperimentsClient) StopExperiment(ctx context.Context, req *cxpb.StopExperimentRequest, opts ...gax.CallOption) (*cxpb.Experiment, error)
StopExperiment stops the specified
Experiment. This rpc only
changes the state of experiment from RUNNING to DONE.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.StopExperimentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#StopExperimentRequest.
}
resp, err := c.StopExperiment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ExperimentsClient) UpdateExperiment ¶
func (c *ExperimentsClient) UpdateExperiment(ctx context.Context, req *cxpb.UpdateExperimentRequest, opts ...gax.CallOption) (*cxpb.Experiment, error)
UpdateExperiment updates the specified
Experiment.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateExperimentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdateExperimentRequest.
}
resp, err := c.UpdateExperiment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type ExportAgentOperation ¶
type ExportAgentOperation struct {
// contains filtered or unexported fields
}
ExportAgentOperation manages a long-running operation from ExportAgent.
func (*ExportAgentOperation) Done ¶
func (op *ExportAgentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ExportAgentOperation) Metadata ¶
func (op *ExportAgentOperation) 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 (*ExportAgentOperation) Name ¶
func (op *ExportAgentOperation) 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 (*ExportAgentOperation) Poll ¶
func (op *ExportAgentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportAgentResponse, 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 (*ExportAgentOperation) Wait ¶
func (op *ExportAgentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportAgentResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type ExportEntityTypesOperation ¶
type ExportEntityTypesOperation struct {
// contains filtered or unexported fields
}
ExportEntityTypesOperation manages a long-running operation from ExportEntityTypes.
func (*ExportEntityTypesOperation) Done ¶
func (op *ExportEntityTypesOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ExportEntityTypesOperation) Metadata ¶
func (op *ExportEntityTypesOperation) Metadata() (*cxpb.ExportEntityTypesMetadata, 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 (*ExportEntityTypesOperation) Name ¶
func (op *ExportEntityTypesOperation) 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 (*ExportEntityTypesOperation) Poll ¶
func (op *ExportEntityTypesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportEntityTypesResponse, 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 (*ExportEntityTypesOperation) Wait ¶
func (op *ExportEntityTypesOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportEntityTypesResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type ExportFlowOperation ¶
type ExportFlowOperation struct {
// contains filtered or unexported fields
}
ExportFlowOperation manages a long-running operation from ExportFlow.
func (*ExportFlowOperation) Done ¶
func (op *ExportFlowOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ExportFlowOperation) Metadata ¶
func (op *ExportFlowOperation) 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 (*ExportFlowOperation) Name ¶
func (op *ExportFlowOperation) 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 (*ExportFlowOperation) Poll ¶
func (op *ExportFlowOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportFlowResponse, 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 (*ExportFlowOperation) Wait ¶
func (op *ExportFlowOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportFlowResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type ExportIntentsOperation ¶
type ExportIntentsOperation struct {
// contains filtered or unexported fields
}
ExportIntentsOperation manages a long-running operation from ExportIntents.
func (*ExportIntentsOperation) Done ¶
func (op *ExportIntentsOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ExportIntentsOperation) Metadata ¶
func (op *ExportIntentsOperation) Metadata() (*cxpb.ExportIntentsMetadata, 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 (*ExportIntentsOperation) Name ¶
func (op *ExportIntentsOperation) 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 (*ExportIntentsOperation) Poll ¶
func (op *ExportIntentsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportIntentsResponse, 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 (*ExportIntentsOperation) Wait ¶
func (op *ExportIntentsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportIntentsResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type ExportTestCasesOperation ¶
type ExportTestCasesOperation struct {
// contains filtered or unexported fields
}
ExportTestCasesOperation manages a long-running operation from ExportTestCases.
func (*ExportTestCasesOperation) Done ¶
func (op *ExportTestCasesOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ExportTestCasesOperation) Metadata ¶
func (op *ExportTestCasesOperation) Metadata() (*cxpb.ExportTestCasesMetadata, 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 (*ExportTestCasesOperation) Name ¶
func (op *ExportTestCasesOperation) 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 (*ExportTestCasesOperation) Poll ¶
func (op *ExportTestCasesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportTestCasesResponse, 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 (*ExportTestCasesOperation) Wait ¶
func (op *ExportTestCasesOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportTestCasesResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type ExportToolsOperation ¶
type ExportToolsOperation struct {
// contains filtered or unexported fields
}
ExportToolsOperation manages a long-running operation from ExportTools.
func (*ExportToolsOperation) Done ¶
func (op *ExportToolsOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ExportToolsOperation) Metadata ¶
func (op *ExportToolsOperation) Metadata() (*cxpb.ExportToolsMetadata, 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 (*ExportToolsOperation) Name ¶
func (op *ExportToolsOperation) 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 (*ExportToolsOperation) Poll ¶
func (op *ExportToolsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportToolsResponse, 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 (*ExportToolsOperation) Wait ¶
func (op *ExportToolsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ExportToolsResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type FlowIterator ¶
type FlowIterator 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 []*cxpb.Flow, nextPageToken string, err error) // contains filtered or unexported fields }
FlowIterator manages a stream of *cxpb.Flow.
func (*FlowIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*FlowIterator) Next ¶
func (it *FlowIterator) Next() (*cxpb.Flow, 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 (*FlowIterator) PageInfo ¶
func (it *FlowIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type FlowsCallOptions ¶
type FlowsCallOptions struct { CreateFlow []gax.CallOption DeleteFlow []gax.CallOption ListFlows []gax.CallOption GetFlow []gax.CallOption UpdateFlow []gax.CallOption TrainFlow []gax.CallOption ValidateFlow []gax.CallOption GetFlowValidationResult []gax.CallOption ImportFlow []gax.CallOption ExportFlow []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
FlowsCallOptions contains the retry settings for each method of FlowsClient.
type FlowsClient ¶
type FlowsClient struct { // The call options for this service. CallOptions *FlowsCallOptions // 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 }
FlowsClient 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 Flows.
func NewFlowsClient ¶
func NewFlowsClient(ctx context.Context, opts ...option.ClientOption) (*FlowsClient, error)
NewFlowsClient creates a new flows 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 Flows.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewFlowsRESTClient ¶
func NewFlowsRESTClient(ctx context.Context, opts ...option.ClientOption) (*FlowsClient, error)
NewFlowsRESTClient creates a new flows rest client.
Service for managing Flows.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*FlowsClient) CancelOperation ¶
func (c *FlowsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*FlowsClient) Close ¶
func (c *FlowsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*FlowsClient) Connection ¶
func (c *FlowsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*FlowsClient) CreateFlow ¶
func (c *FlowsClient) CreateFlow(ctx context.Context, req *cxpb.CreateFlowRequest, opts ...gax.CallOption) (*cxpb.Flow, error)
CreateFlow creates a flow in the specified agent.
Note: You should always train a flow prior to sending it queries. See the
training
documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training).
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateFlowRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreateFlowRequest.
}
resp, err := c.CreateFlow(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*FlowsClient) DeleteFlow ¶
func (c *FlowsClient) DeleteFlow(ctx context.Context, req *cxpb.DeleteFlowRequest, opts ...gax.CallOption) error
DeleteFlow deletes a specified flow.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteFlowRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeleteFlowRequest.
}
err = c.DeleteFlow(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*FlowsClient) ExportFlow ¶
func (c *FlowsClient) ExportFlow(ctx context.Context, req *cxpb.ExportFlowRequest, opts ...gax.CallOption) (*ExportFlowOperation, error)
ExportFlow exports the specified flow to a binary file.
This method is a long-running operation (at https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 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: ExportFlowResponse
Note that resources (e.g. intents, entities, webhooks) that the flow
references will also be exported.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ExportFlowRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ExportFlowRequest.
}
op, err := c.ExportFlow(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*FlowsClient) ExportFlowOperation ¶
func (c *FlowsClient) ExportFlowOperation(name string) *ExportFlowOperation
ExportFlowOperation returns a new ExportFlowOperation from a given name. The name must be that of a previously created ExportFlowOperation, possibly from a different process.
func (*FlowsClient) GetFlow ¶
func (c *FlowsClient) GetFlow(ctx context.Context, req *cxpb.GetFlowRequest, opts ...gax.CallOption) (*cxpb.Flow, error)
GetFlow retrieves the specified flow.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetFlowRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetFlowRequest.
}
resp, err := c.GetFlow(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*FlowsClient) GetFlowValidationResult ¶
func (c *FlowsClient) GetFlowValidationResult(ctx context.Context, req *cxpb.GetFlowValidationResultRequest, opts ...gax.CallOption) (*cxpb.FlowValidationResult, error)
GetFlowValidationResult gets the latest flow validation result. Flow validation is performed
when ValidateFlow is called.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetFlowValidationResultRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetFlowValidationResultRequest.
}
resp, err := c.GetFlowValidationResult(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*FlowsClient) GetLocation ¶
func (c *FlowsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(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 (*FlowsClient) GetOperation ¶
func (c *FlowsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*FlowsClient) ImportFlow ¶
func (c *FlowsClient) ImportFlow(ctx context.Context, req *cxpb.ImportFlowRequest, opts ...gax.CallOption) (*ImportFlowOperation, error)
ImportFlow imports the specified flow to the specified agent from a binary file.
This method is a long-running operation (at https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 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: ImportFlowResponse
Note: You should always train a flow prior to sending it queries. See the
training
documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training).
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ImportFlowRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ImportFlowRequest.
}
op, err := c.ImportFlow(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*FlowsClient) ImportFlowOperation ¶
func (c *FlowsClient) ImportFlowOperation(name string) *ImportFlowOperation
ImportFlowOperation returns a new ImportFlowOperation from a given name. The name must be that of a previously created ImportFlowOperation, possibly from a different process.
func (*FlowsClient) ListFlows ¶
func (c *FlowsClient) ListFlows(ctx context.Context, req *cxpb.ListFlowsRequest, opts ...gax.CallOption) *FlowIterator
ListFlows returns the list of all flows in the specified agent.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListFlowsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListFlowsRequest.
}
it := c.ListFlows(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListFlowsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListFlowsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListFlowsRequest.
}
for resp, err := range c.ListFlows(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*FlowsClient) ListLocations ¶
func (c *FlowsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*FlowsClient) ListOperations ¶
func (c *FlowsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*FlowsClient) TrainFlow ¶
func (c *FlowsClient) TrainFlow(ctx context.Context, req *cxpb.TrainFlowRequest, opts ...gax.CallOption) (*TrainFlowOperation, error)
TrainFlow trains the specified flow. Note that only the flow in ‘draft’ environment is trained.
This method is a long-running operation (at https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 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 a flow prior to sending it queries. See the
training
documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training).
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.TrainFlowRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#TrainFlowRequest.
}
op, err := c.TrainFlow(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*FlowsClient) TrainFlowOperation ¶
func (c *FlowsClient) TrainFlowOperation(name string) *TrainFlowOperation
TrainFlowOperation returns a new TrainFlowOperation from a given name. The name must be that of a previously created TrainFlowOperation, possibly from a different process.
func (*FlowsClient) UpdateFlow ¶
func (c *FlowsClient) UpdateFlow(ctx context.Context, req *cxpb.UpdateFlowRequest, opts ...gax.CallOption) (*cxpb.Flow, error)
UpdateFlow updates the specified flow.
Note: You should always train a flow prior to sending it queries. See the
training
documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training).
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateFlowRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdateFlowRequest.
}
resp, err := c.UpdateFlow(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*FlowsClient) ValidateFlow ¶
func (c *FlowsClient) ValidateFlow(ctx context.Context, req *cxpb.ValidateFlowRequest, opts ...gax.CallOption) (*cxpb.FlowValidationResult, error)
ValidateFlow validates the specified flow and creates or updates validation results.
Please call this API after the training is completed to get the complete
validation results.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ValidateFlowRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ValidateFlowRequest.
}
resp, err := c.ValidateFlow(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type GeneratorIterator ¶
type GeneratorIterator 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 []*cxpb.Generator, nextPageToken string, err error) // contains filtered or unexported fields }
GeneratorIterator manages a stream of *cxpb.Generator.
func (*GeneratorIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*GeneratorIterator) Next ¶
func (it *GeneratorIterator) Next() (*cxpb.Generator, 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 (*GeneratorIterator) PageInfo ¶
func (it *GeneratorIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type GeneratorsCallOptions ¶
type GeneratorsCallOptions struct { ListGenerators []gax.CallOption GetGenerator []gax.CallOption CreateGenerator []gax.CallOption UpdateGenerator []gax.CallOption DeleteGenerator []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
GeneratorsCallOptions contains the retry settings for each method of GeneratorsClient.
type GeneratorsClient ¶
type GeneratorsClient struct { // The call options for this service. CallOptions *GeneratorsCallOptions // contains filtered or unexported fields }
GeneratorsClient 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 Generators
func NewGeneratorsClient ¶
func NewGeneratorsClient(ctx context.Context, opts ...option.ClientOption) (*GeneratorsClient, error)
NewGeneratorsClient creates a new generators 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
Generators
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewGeneratorsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewGeneratorsRESTClient ¶
func NewGeneratorsRESTClient(ctx context.Context, opts ...option.ClientOption) (*GeneratorsClient, error)
NewGeneratorsRESTClient creates a new generators rest client.
Service for managing
Generators
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewGeneratorsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*GeneratorsClient) CancelOperation ¶
func (c *GeneratorsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewGeneratorsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*GeneratorsClient) Close ¶
func (c *GeneratorsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*GeneratorsClient) Connection ¶
func (c *GeneratorsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*GeneratorsClient) CreateGenerator ¶
func (c *GeneratorsClient) CreateGenerator(ctx context.Context, req *cxpb.CreateGeneratorRequest, opts ...gax.CallOption) (*cxpb.Generator, error)
CreateGenerator creates a generator in the specified agent.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewGeneratorsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateGeneratorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreateGeneratorRequest.
}
resp, err := c.CreateGenerator(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*GeneratorsClient) DeleteGenerator ¶
func (c *GeneratorsClient) DeleteGenerator(ctx context.Context, req *cxpb.DeleteGeneratorRequest, opts ...gax.CallOption) error
DeleteGenerator deletes the specified generators.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewGeneratorsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteGeneratorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeleteGeneratorRequest.
}
err = c.DeleteGenerator(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*GeneratorsClient) GetGenerator ¶
func (c *GeneratorsClient) GetGenerator(ctx context.Context, req *cxpb.GetGeneratorRequest, opts ...gax.CallOption) (*cxpb.Generator, error)
GetGenerator retrieves the specified generator.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewGeneratorsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetGeneratorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetGeneratorRequest.
}
resp, err := c.GetGenerator(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*GeneratorsClient) GetLocation ¶
func (c *GeneratorsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewGeneratorsClient(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 (*GeneratorsClient) GetOperation ¶
func (c *GeneratorsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewGeneratorsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*GeneratorsClient) ListGenerators ¶
func (c *GeneratorsClient) ListGenerators(ctx context.Context, req *cxpb.ListGeneratorsRequest, opts ...gax.CallOption) *GeneratorIterator
ListGenerators returns the list of all generators in the specified agent.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewGeneratorsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListGeneratorsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListGeneratorsRequest.
}
it := c.ListGenerators(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListGeneratorsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewGeneratorsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListGeneratorsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListGeneratorsRequest.
}
for resp, err := range c.ListGenerators(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*GeneratorsClient) ListLocations ¶
func (c *GeneratorsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewGeneratorsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewGeneratorsClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*GeneratorsClient) ListOperations ¶
func (c *GeneratorsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewGeneratorsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewGeneratorsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*GeneratorsClient) UpdateGenerator ¶
func (c *GeneratorsClient) UpdateGenerator(ctx context.Context, req *cxpb.UpdateGeneratorRequest, opts ...gax.CallOption) (*cxpb.Generator, error)
UpdateGenerator update the specified generator.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewGeneratorsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateGeneratorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdateGeneratorRequest.
}
resp, err := c.UpdateGenerator(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type ImportEntityTypesOperation ¶
type ImportEntityTypesOperation struct {
// contains filtered or unexported fields
}
ImportEntityTypesOperation manages a long-running operation from ImportEntityTypes.
func (*ImportEntityTypesOperation) Done ¶
func (op *ImportEntityTypesOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ImportEntityTypesOperation) Metadata ¶
func (op *ImportEntityTypesOperation) Metadata() (*cxpb.ImportEntityTypesMetadata, 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 (*ImportEntityTypesOperation) Name ¶
func (op *ImportEntityTypesOperation) 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 (*ImportEntityTypesOperation) Poll ¶
func (op *ImportEntityTypesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ImportEntityTypesResponse, 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 (*ImportEntityTypesOperation) Wait ¶
func (op *ImportEntityTypesOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ImportEntityTypesResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type ImportFlowOperation ¶
type ImportFlowOperation struct {
// contains filtered or unexported fields
}
ImportFlowOperation manages a long-running operation from ImportFlow.
func (*ImportFlowOperation) Done ¶
func (op *ImportFlowOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ImportFlowOperation) Metadata ¶
func (op *ImportFlowOperation) 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 (*ImportFlowOperation) Name ¶
func (op *ImportFlowOperation) 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 (*ImportFlowOperation) Poll ¶
func (op *ImportFlowOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ImportFlowResponse, 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 (*ImportFlowOperation) Wait ¶
func (op *ImportFlowOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ImportFlowResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type ImportIntentsOperation ¶
type ImportIntentsOperation struct {
// contains filtered or unexported fields
}
ImportIntentsOperation manages a long-running operation from ImportIntents.
func (*ImportIntentsOperation) Done ¶
func (op *ImportIntentsOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ImportIntentsOperation) Metadata ¶
func (op *ImportIntentsOperation) Metadata() (*cxpb.ImportIntentsMetadata, 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 (*ImportIntentsOperation) Name ¶
func (op *ImportIntentsOperation) 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 (*ImportIntentsOperation) Poll ¶
func (op *ImportIntentsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ImportIntentsResponse, 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 (*ImportIntentsOperation) Wait ¶
func (op *ImportIntentsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ImportIntentsResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type ImportTestCasesOperation ¶
type ImportTestCasesOperation struct {
// contains filtered or unexported fields
}
ImportTestCasesOperation manages a long-running operation from ImportTestCases.
func (*ImportTestCasesOperation) Done ¶
func (op *ImportTestCasesOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ImportTestCasesOperation) Metadata ¶
func (op *ImportTestCasesOperation) Metadata() (*cxpb.ImportTestCasesMetadata, 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 (*ImportTestCasesOperation) Name ¶
func (op *ImportTestCasesOperation) 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 (*ImportTestCasesOperation) Poll ¶
func (op *ImportTestCasesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.ImportTestCasesResponse, 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 (*ImportTestCasesOperation) Wait ¶
func (op *ImportTestCasesOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.ImportTestCasesResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type IntentIterator ¶
type IntentIterator 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 []*cxpb.Intent, nextPageToken string, err error) // contains filtered or unexported fields }
IntentIterator manages a stream of *cxpb.Intent.
func (*IntentIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*IntentIterator) Next ¶
func (it *IntentIterator) Next() (*cxpb.Intent, 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 (*IntentIterator) PageInfo ¶
func (it *IntentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type IntentsCallOptions ¶
type IntentsCallOptions struct { ListIntents []gax.CallOption GetIntent []gax.CallOption CreateIntent []gax.CallOption UpdateIntent []gax.CallOption DeleteIntent []gax.CallOption ImportIntents []gax.CallOption ExportIntents []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
IntentsCallOptions contains the retry settings for each method of IntentsClient.
type IntentsClient ¶
type IntentsClient struct { // The call options for this service. CallOptions *IntentsCallOptions // 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 }
IntentsClient 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 Intents.
func NewIntentsClient ¶
func NewIntentsClient(ctx context.Context, opts ...option.ClientOption) (*IntentsClient, error)
NewIntentsClient creates a new intents 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 Intents.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewIntentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewIntentsRESTClient ¶
func NewIntentsRESTClient(ctx context.Context, opts ...option.ClientOption) (*IntentsClient, error)
NewIntentsRESTClient creates a new intents rest client.
Service for managing Intents.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewIntentsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*IntentsClient) CancelOperation ¶
func (c *IntentsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewIntentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*IntentsClient) Close ¶
func (c *IntentsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*IntentsClient) Connection ¶
func (c *IntentsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*IntentsClient) CreateIntent ¶
func (c *IntentsClient) CreateIntent(ctx context.Context, req *cxpb.CreateIntentRequest, opts ...gax.CallOption) (*cxpb.Intent, error)
CreateIntent creates an intent in the specified agent.
Note: You should always train a flow prior to sending it queries. See the
training
documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training).
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewIntentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateIntentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreateIntentRequest.
}
resp, err := c.CreateIntent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*IntentsClient) DeleteIntent ¶
func (c *IntentsClient) DeleteIntent(ctx context.Context, req *cxpb.DeleteIntentRequest, opts ...gax.CallOption) error
DeleteIntent deletes the specified intent.
Note: You should always train a flow prior to sending it queries. See the
training
documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training).
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewIntentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteIntentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeleteIntentRequest.
}
err = c.DeleteIntent(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*IntentsClient) ExportIntents ¶
func (c *IntentsClient) ExportIntents(ctx context.Context, req *cxpb.ExportIntentsRequest, opts ...gax.CallOption) (*ExportIntentsOperation, error)
ExportIntents exports the selected intents.
This method is a long-running operation (at https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned Operation type has the following method-specific fields:
metadata: ExportIntentsMetadata response: ExportIntentsResponse
Example¶
Code:play
package main import ( "context" cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := cx.NewIntentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &cxpb.ExportIntentsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ExportIntentsRequest. } op, err := c.ExportIntents(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
func (*IntentsClient) ExportIntentsOperation ¶
func (c *IntentsClient) ExportIntentsOperation(name string) *ExportIntentsOperation
ExportIntentsOperation returns a new ExportIntentsOperation from a given name. The name must be that of a previously created ExportIntentsOperation, possibly from a different process.
func (*IntentsClient) GetIntent ¶
func (c *IntentsClient) GetIntent(ctx context.Context, req *cxpb.GetIntentRequest, opts ...gax.CallOption) (*cxpb.Intent, error)
GetIntent retrieves the specified intent.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewIntentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetIntentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetIntentRequest.
}
resp, err := c.GetIntent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*IntentsClient) GetLocation ¶
func (c *IntentsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewIntentsClient(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 (*IntentsClient) GetOperation ¶
func (c *IntentsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewIntentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*IntentsClient) ImportIntents ¶
func (c *IntentsClient) ImportIntents(ctx context.Context, req *cxpb.ImportIntentsRequest, opts ...gax.CallOption) (*ImportIntentsOperation, error)
ImportIntents imports the specified intents into the agent.
This method is a long-running operation (at https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned Operation type has the following method-specific fields:
metadata: ImportIntentsMetadata response: ImportIntentsResponse
Example¶
Code:play
package main import ( "context" cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := cx.NewIntentsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &cxpb.ImportIntentsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ImportIntentsRequest. } op, err := c.ImportIntents(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
func (*IntentsClient) ImportIntentsOperation ¶
func (c *IntentsClient) ImportIntentsOperation(name string) *ImportIntentsOperation
ImportIntentsOperation returns a new ImportIntentsOperation from a given name. The name must be that of a previously created ImportIntentsOperation, possibly from a different process.
func (*IntentsClient) ListIntents ¶
func (c *IntentsClient) ListIntents(ctx context.Context, req *cxpb.ListIntentsRequest, opts ...gax.CallOption) *IntentIterator
ListIntents returns the list of all intents in the specified agent.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewIntentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListIntentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListIntentsRequest.
}
it := c.ListIntents(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListIntentsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewIntentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListIntentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListIntentsRequest.
}
for resp, err := range c.ListIntents(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*IntentsClient) ListLocations ¶
func (c *IntentsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewIntentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewIntentsClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*IntentsClient) ListOperations ¶
func (c *IntentsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewIntentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewIntentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*IntentsClient) UpdateIntent ¶
func (c *IntentsClient) UpdateIntent(ctx context.Context, req *cxpb.UpdateIntentRequest, opts ...gax.CallOption) (*cxpb.Intent, error)
UpdateIntent updates the specified intent.
Note: You should always train a flow prior to sending it queries. See the
training
documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training).
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewIntentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateIntentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdateIntentRequest.
}
resp, err := c.UpdateIntent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type LoadVersionOperation ¶
type LoadVersionOperation struct {
// contains filtered or unexported fields
}
LoadVersionOperation manages a long-running operation from LoadVersion.
func (*LoadVersionOperation) Done ¶
func (op *LoadVersionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*LoadVersionOperation) Metadata ¶
func (op *LoadVersionOperation) 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 (*LoadVersionOperation) Name ¶
func (op *LoadVersionOperation) 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 (*LoadVersionOperation) Poll ¶
func (op *LoadVersionOperation) 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 (*LoadVersionOperation) Wait ¶
func (op *LoadVersionOperation) 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.
type LocationIterator ¶
type LocationIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error) // contains filtered or unexported fields }
LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator) All ¶
func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*LocationIterator) Next ¶
func (it *LocationIterator) Next() (*locationpb.Location, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*LocationIterator) PageInfo ¶
func (it *LocationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type OperationIterator ¶
type OperationIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error) // contains filtered or unexported fields }
OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All ¶
func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*OperationIterator) Next ¶
func (it *OperationIterator) Next() (*longrunningpb.Operation, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo ¶
func (it *OperationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type PageIterator ¶
type PageIterator 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 []*cxpb.Page, nextPageToken string, err error) // contains filtered or unexported fields }
PageIterator manages a stream of *cxpb.Page.
func (*PageIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*PageIterator) Next ¶
func (it *PageIterator) Next() (*cxpb.Page, 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 (*PageIterator) PageInfo ¶
func (it *PageIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type PagesCallOptions ¶
type PagesCallOptions struct { ListPages []gax.CallOption GetPage []gax.CallOption CreatePage []gax.CallOption UpdatePage []gax.CallOption DeletePage []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
PagesCallOptions contains the retry settings for each method of PagesClient.
type PagesClient ¶
type PagesClient struct { // The call options for this service. CallOptions *PagesCallOptions // contains filtered or unexported fields }
PagesClient 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 [Pages][google.cloud.dialogflow.cx.v3beta1.Page (at http://google.cloud.dialogflow.cx.v3beta1.Page)].
func NewPagesClient ¶
func NewPagesClient(ctx context.Context, opts ...option.ClientOption) (*PagesClient, error)
NewPagesClient creates a new pages 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 [Pages][google.cloud.dialogflow.cx.v3beta1.Page (at http://google.cloud.dialogflow.cx.v3beta1.Page)].
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPagesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewPagesRESTClient ¶
func NewPagesRESTClient(ctx context.Context, opts ...option.ClientOption) (*PagesClient, error)
NewPagesRESTClient creates a new pages rest client.
Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page (at http://google.cloud.dialogflow.cx.v3beta1.Page)].
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPagesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*PagesClient) CancelOperation ¶
func (c *PagesClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPagesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*PagesClient) Close ¶
func (c *PagesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*PagesClient) Connection ¶
func (c *PagesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*PagesClient) CreatePage ¶
func (c *PagesClient) CreatePage(ctx context.Context, req *cxpb.CreatePageRequest, opts ...gax.CallOption) (*cxpb.Page, error)
CreatePage creates a page in the specified flow.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPagesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreatePageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreatePageRequest.
}
resp, err := c.CreatePage(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*PagesClient) DeletePage ¶
func (c *PagesClient) DeletePage(ctx context.Context, req *cxpb.DeletePageRequest, opts ...gax.CallOption) error
DeletePage deletes the specified page.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPagesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeletePageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeletePageRequest.
}
err = c.DeletePage(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*PagesClient) GetLocation ¶
func (c *PagesClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPagesClient(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 (*PagesClient) GetOperation ¶
func (c *PagesClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPagesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*PagesClient) GetPage ¶
func (c *PagesClient) GetPage(ctx context.Context, req *cxpb.GetPageRequest, opts ...gax.CallOption) (*cxpb.Page, error)
GetPage retrieves the specified page.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPagesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetPageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetPageRequest.
}
resp, err := c.GetPage(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*PagesClient) ListLocations ¶
func (c *PagesClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPagesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPagesClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*PagesClient) ListOperations ¶
func (c *PagesClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPagesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPagesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*PagesClient) ListPages ¶
func (c *PagesClient) ListPages(ctx context.Context, req *cxpb.ListPagesRequest, opts ...gax.CallOption) *PageIterator
ListPages returns the list of all pages in the specified flow.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPagesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListPagesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListPagesRequest.
}
it := c.ListPages(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListPagesResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPagesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListPagesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListPagesRequest.
}
for resp, err := range c.ListPages(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*PagesClient) UpdatePage ¶
func (c *PagesClient) UpdatePage(ctx context.Context, req *cxpb.UpdatePageRequest, opts ...gax.CallOption) (*cxpb.Page, error)
UpdatePage updates the specified page.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPagesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdatePageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdatePageRequest.
}
resp, err := c.UpdatePage(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type PlaybookIterator ¶
type PlaybookIterator 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 []*cxpb.Playbook, nextPageToken string, err error) // contains filtered or unexported fields }
PlaybookIterator manages a stream of *cxpb.Playbook.
func (*PlaybookIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*PlaybookIterator) Next ¶
func (it *PlaybookIterator) Next() (*cxpb.Playbook, 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 (*PlaybookIterator) PageInfo ¶
func (it *PlaybookIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type PlaybookVersionIterator ¶
type PlaybookVersionIterator 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 []*cxpb.PlaybookVersion, nextPageToken string, err error) // contains filtered or unexported fields }
PlaybookVersionIterator manages a stream of *cxpb.PlaybookVersion.
func (*PlaybookVersionIterator) All ¶
func (it *PlaybookVersionIterator) All() iter.Seq2[*cxpb.PlaybookVersion, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*PlaybookVersionIterator) Next ¶
func (it *PlaybookVersionIterator) Next() (*cxpb.PlaybookVersion, 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 (*PlaybookVersionIterator) PageInfo ¶
func (it *PlaybookVersionIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type PlaybooksCallOptions ¶
type PlaybooksCallOptions struct { CreatePlaybook []gax.CallOption DeletePlaybook []gax.CallOption ListPlaybooks []gax.CallOption GetPlaybook []gax.CallOption UpdatePlaybook []gax.CallOption CreatePlaybookVersion []gax.CallOption GetPlaybookVersion []gax.CallOption ListPlaybookVersions []gax.CallOption DeletePlaybookVersion []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
PlaybooksCallOptions contains the retry settings for each method of PlaybooksClient.
type PlaybooksClient ¶
type PlaybooksClient struct { // The call options for this service. CallOptions *PlaybooksCallOptions // contains filtered or unexported fields }
PlaybooksClient 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 Playbooks.
func NewPlaybooksClient ¶
func NewPlaybooksClient(ctx context.Context, opts ...option.ClientOption) (*PlaybooksClient, error)
NewPlaybooksClient creates a new playbooks 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
Playbooks.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewPlaybooksRESTClient ¶
func NewPlaybooksRESTClient(ctx context.Context, opts ...option.ClientOption) (*PlaybooksClient, error)
NewPlaybooksRESTClient creates a new playbooks rest client.
Service for managing
Playbooks.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*PlaybooksClient) CancelOperation ¶
func (c *PlaybooksClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*PlaybooksClient) Close ¶
func (c *PlaybooksClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*PlaybooksClient) Connection ¶
func (c *PlaybooksClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*PlaybooksClient) CreatePlaybook ¶
func (c *PlaybooksClient) CreatePlaybook(ctx context.Context, req *cxpb.CreatePlaybookRequest, opts ...gax.CallOption) (*cxpb.Playbook, error)
CreatePlaybook creates a playbook in a specified agent.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreatePlaybookRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreatePlaybookRequest.
}
resp, err := c.CreatePlaybook(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*PlaybooksClient) CreatePlaybookVersion ¶
func (c *PlaybooksClient) CreatePlaybookVersion(ctx context.Context, req *cxpb.CreatePlaybookVersionRequest, opts ...gax.CallOption) (*cxpb.PlaybookVersion, error)
CreatePlaybookVersion creates a version for the specified Playbook.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreatePlaybookVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreatePlaybookVersionRequest.
}
resp, err := c.CreatePlaybookVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*PlaybooksClient) DeletePlaybook ¶
func (c *PlaybooksClient) DeletePlaybook(ctx context.Context, req *cxpb.DeletePlaybookRequest, opts ...gax.CallOption) error
DeletePlaybook deletes a specified playbook.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeletePlaybookRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeletePlaybookRequest.
}
err = c.DeletePlaybook(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*PlaybooksClient) DeletePlaybookVersion ¶
func (c *PlaybooksClient) DeletePlaybookVersion(ctx context.Context, req *cxpb.DeletePlaybookVersionRequest, opts ...gax.CallOption) error
DeletePlaybookVersion deletes the specified version of the Playbook.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeletePlaybookVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeletePlaybookVersionRequest.
}
err = c.DeletePlaybookVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*PlaybooksClient) GetLocation ¶
func (c *PlaybooksClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(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 (*PlaybooksClient) GetOperation ¶
func (c *PlaybooksClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*PlaybooksClient) GetPlaybook ¶
func (c *PlaybooksClient) GetPlaybook(ctx context.Context, req *cxpb.GetPlaybookRequest, opts ...gax.CallOption) (*cxpb.Playbook, error)
GetPlaybook retrieves the specified Playbook.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetPlaybookRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetPlaybookRequest.
}
resp, err := c.GetPlaybook(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*PlaybooksClient) GetPlaybookVersion ¶
func (c *PlaybooksClient) GetPlaybookVersion(ctx context.Context, req *cxpb.GetPlaybookVersionRequest, opts ...gax.CallOption) (*cxpb.PlaybookVersion, error)
GetPlaybookVersion retrieves the specified version of the Playbook.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetPlaybookVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetPlaybookVersionRequest.
}
resp, err := c.GetPlaybookVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*PlaybooksClient) ListLocations ¶
func (c *PlaybooksClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*PlaybooksClient) ListOperations ¶
func (c *PlaybooksClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*PlaybooksClient) ListPlaybookVersions ¶
func (c *PlaybooksClient) ListPlaybookVersions(ctx context.Context, req *cxpb.ListPlaybookVersionsRequest, opts ...gax.CallOption) *PlaybookVersionIterator
ListPlaybookVersions lists versions for the specified Playbook.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListPlaybookVersionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListPlaybookVersionsRequest.
}
it := c.ListPlaybookVersions(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListPlaybookVersionsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListPlaybookVersionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListPlaybookVersionsRequest.
}
for resp, err := range c.ListPlaybookVersions(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*PlaybooksClient) ListPlaybooks ¶
func (c *PlaybooksClient) ListPlaybooks(ctx context.Context, req *cxpb.ListPlaybooksRequest, opts ...gax.CallOption) *PlaybookIterator
ListPlaybooks returns a list of playbooks in the specified agent.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListPlaybooksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListPlaybooksRequest.
}
it := c.ListPlaybooks(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListPlaybooksResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListPlaybooksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListPlaybooksRequest.
}
for resp, err := range c.ListPlaybooks(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*PlaybooksClient) UpdatePlaybook ¶
func (c *PlaybooksClient) UpdatePlaybook(ctx context.Context, req *cxpb.UpdatePlaybookRequest, opts ...gax.CallOption) (*cxpb.Playbook, error)
UpdatePlaybook updates the specified Playbook.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewPlaybooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdatePlaybookRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdatePlaybookRequest.
}
resp, err := c.UpdatePlaybook(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type RestoreAgentOperation ¶
type RestoreAgentOperation struct {
// contains filtered or unexported fields
}
RestoreAgentOperation manages a long-running operation from RestoreAgent.
func (*RestoreAgentOperation) Done ¶
func (op *RestoreAgentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*RestoreAgentOperation) Metadata ¶
func (op *RestoreAgentOperation) 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 (*RestoreAgentOperation) Name ¶
func (op *RestoreAgentOperation) 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 (*RestoreAgentOperation) Poll ¶
func (op *RestoreAgentOperation) 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 (*RestoreAgentOperation) Wait ¶
func (op *RestoreAgentOperation) 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.
type RunContinuousTestOperation ¶
type RunContinuousTestOperation struct {
// contains filtered or unexported fields
}
RunContinuousTestOperation manages a long-running operation from RunContinuousTest.
func (*RunContinuousTestOperation) Done ¶
func (op *RunContinuousTestOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*RunContinuousTestOperation) Metadata ¶
func (op *RunContinuousTestOperation) Metadata() (*cxpb.RunContinuousTestMetadata, 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 (*RunContinuousTestOperation) Name ¶
func (op *RunContinuousTestOperation) 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 (*RunContinuousTestOperation) Poll ¶
func (op *RunContinuousTestOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.RunContinuousTestResponse, 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 (*RunContinuousTestOperation) Wait ¶
func (op *RunContinuousTestOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.RunContinuousTestResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type RunTestCaseOperation ¶
type RunTestCaseOperation struct {
// contains filtered or unexported fields
}
RunTestCaseOperation manages a long-running operation from RunTestCase.
func (*RunTestCaseOperation) Done ¶
func (op *RunTestCaseOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*RunTestCaseOperation) Metadata ¶
func (op *RunTestCaseOperation) Metadata() (*cxpb.RunTestCaseMetadata, 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 (*RunTestCaseOperation) Name ¶
func (op *RunTestCaseOperation) 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 (*RunTestCaseOperation) Poll ¶
func (op *RunTestCaseOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.RunTestCaseResponse, 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 (*RunTestCaseOperation) Wait ¶
func (op *RunTestCaseOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.RunTestCaseResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type SecuritySettingsCallOptions ¶
type SecuritySettingsCallOptions struct { CreateSecuritySettings []gax.CallOption GetSecuritySettings []gax.CallOption UpdateSecuritySettings []gax.CallOption ListSecuritySettings []gax.CallOption DeleteSecuritySettings []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
SecuritySettingsCallOptions contains the retry settings for each method of SecuritySettingsClient.
type SecuritySettingsClient ¶
type SecuritySettingsClient struct { // The call options for this service. CallOptions *SecuritySettingsCallOptions // contains filtered or unexported fields }
SecuritySettingsClient 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 security settings for Dialogflow.
func NewSecuritySettingsClient ¶
func NewSecuritySettingsClient(ctx context.Context, opts ...option.ClientOption) (*SecuritySettingsClient, error)
NewSecuritySettingsClient creates a new security settings service 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 security settings for Dialogflow.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSecuritySettingsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewSecuritySettingsRESTClient ¶
func NewSecuritySettingsRESTClient(ctx context.Context, opts ...option.ClientOption) (*SecuritySettingsClient, error)
NewSecuritySettingsRESTClient creates a new security settings service rest client.
Service for managing security settings for Dialogflow.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSecuritySettingsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*SecuritySettingsClient) CancelOperation ¶
func (c *SecuritySettingsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSecuritySettingsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*SecuritySettingsClient) Close ¶
func (c *SecuritySettingsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*SecuritySettingsClient) Connection ¶
func (c *SecuritySettingsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*SecuritySettingsClient) CreateSecuritySettings ¶
func (c *SecuritySettingsClient) CreateSecuritySettings(ctx context.Context, req *cxpb.CreateSecuritySettingsRequest, opts ...gax.CallOption) (*cxpb.SecuritySettings, error)
CreateSecuritySettings create security settings in the specified location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSecuritySettingsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateSecuritySettingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreateSecuritySettingsRequest.
}
resp, err := c.CreateSecuritySettings(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SecuritySettingsClient) DeleteSecuritySettings ¶
func (c *SecuritySettingsClient) DeleteSecuritySettings(ctx context.Context, req *cxpb.DeleteSecuritySettingsRequest, opts ...gax.CallOption) error
DeleteSecuritySettings deletes the specified
SecuritySettings.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSecuritySettingsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteSecuritySettingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeleteSecuritySettingsRequest.
}
err = c.DeleteSecuritySettings(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*SecuritySettingsClient) GetLocation ¶
func (c *SecuritySettingsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSecuritySettingsClient(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 (*SecuritySettingsClient) GetOperation ¶
func (c *SecuritySettingsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSecuritySettingsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SecuritySettingsClient) GetSecuritySettings ¶
func (c *SecuritySettingsClient) GetSecuritySettings(ctx context.Context, req *cxpb.GetSecuritySettingsRequest, opts ...gax.CallOption) (*cxpb.SecuritySettings, error)
GetSecuritySettings retrieves the specified
SecuritySettings.
The returned settings may be stale by up to 1 minute.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSecuritySettingsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetSecuritySettingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetSecuritySettingsRequest.
}
resp, err := c.GetSecuritySettings(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SecuritySettingsClient) ListLocations ¶
func (c *SecuritySettingsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSecuritySettingsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSecuritySettingsClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SecuritySettingsClient) ListOperations ¶
func (c *SecuritySettingsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSecuritySettingsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSecuritySettingsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SecuritySettingsClient) ListSecuritySettings ¶
func (c *SecuritySettingsClient) ListSecuritySettings(ctx context.Context, req *cxpb.ListSecuritySettingsRequest, opts ...gax.CallOption) *SecuritySettingsIterator
ListSecuritySettings returns the list of all security settings in the specified location.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSecuritySettingsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListSecuritySettingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListSecuritySettingsRequest.
}
it := c.ListSecuritySettings(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListSecuritySettingsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSecuritySettingsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListSecuritySettingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListSecuritySettingsRequest.
}
for resp, err := range c.ListSecuritySettings(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SecuritySettingsClient) UpdateSecuritySettings ¶
func (c *SecuritySettingsClient) UpdateSecuritySettings(ctx context.Context, req *cxpb.UpdateSecuritySettingsRequest, opts ...gax.CallOption) (*cxpb.SecuritySettings, error)
UpdateSecuritySettings updates the specified
SecuritySettings.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSecuritySettingsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateSecuritySettingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdateSecuritySettingsRequest.
}
resp, err := c.UpdateSecuritySettings(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type SecuritySettingsIterator ¶
type SecuritySettingsIterator 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 []*cxpb.SecuritySettings, nextPageToken string, err error) // contains filtered or unexported fields }
SecuritySettingsIterator manages a stream of *cxpb.SecuritySettings.
func (*SecuritySettingsIterator) All ¶
func (it *SecuritySettingsIterator) All() iter.Seq2[*cxpb.SecuritySettings, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SecuritySettingsIterator) Next ¶
func (it *SecuritySettingsIterator) Next() (*cxpb.SecuritySettings, 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 (*SecuritySettingsIterator) PageInfo ¶
func (it *SecuritySettingsIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type SessionEntityTypeIterator ¶
type SessionEntityTypeIterator 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 []*cxpb.SessionEntityType, nextPageToken string, err error) // contains filtered or unexported fields }
SessionEntityTypeIterator manages a stream of *cxpb.SessionEntityType.
func (*SessionEntityTypeIterator) All ¶
func (it *SessionEntityTypeIterator) All() iter.Seq2[*cxpb.SessionEntityType, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SessionEntityTypeIterator) Next ¶
func (it *SessionEntityTypeIterator) Next() (*cxpb.SessionEntityType, 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 (*SessionEntityTypeIterator) PageInfo ¶
func (it *SessionEntityTypeIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type SessionEntityTypesCallOptions ¶
type SessionEntityTypesCallOptions struct { ListSessionEntityTypes []gax.CallOption GetSessionEntityType []gax.CallOption CreateSessionEntityType []gax.CallOption UpdateSessionEntityType []gax.CallOption DeleteSessionEntityType []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
SessionEntityTypesCallOptions contains the retry settings for each method of SessionEntityTypesClient.
type SessionEntityTypesClient ¶
type SessionEntityTypesClient struct { // The call options for this service. CallOptions *SessionEntityTypesCallOptions // contains filtered or unexported fields }
SessionEntityTypesClient 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 SessionEntityTypes.
func NewSessionEntityTypesClient ¶
func NewSessionEntityTypesClient(ctx context.Context, opts ...option.ClientOption) (*SessionEntityTypesClient, error)
NewSessionEntityTypesClient creates a new session entity types 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
SessionEntityTypes.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewSessionEntityTypesRESTClient ¶
func NewSessionEntityTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*SessionEntityTypesClient, error)
NewSessionEntityTypesRESTClient creates a new session entity types rest client.
Service for managing
SessionEntityTypes.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionEntityTypesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*SessionEntityTypesClient) CancelOperation ¶
func (c *SessionEntityTypesClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*SessionEntityTypesClient) Close ¶
func (c *SessionEntityTypesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*SessionEntityTypesClient) Connection ¶
func (c *SessionEntityTypesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*SessionEntityTypesClient) CreateSessionEntityType ¶
func (c *SessionEntityTypesClient) CreateSessionEntityType(ctx context.Context, req *cxpb.CreateSessionEntityTypeRequest, opts ...gax.CallOption) (*cxpb.SessionEntityType, error)
CreateSessionEntityType creates a session entity type.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateSessionEntityTypeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreateSessionEntityTypeRequest.
}
resp, err := c.CreateSessionEntityType(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SessionEntityTypesClient) DeleteSessionEntityType ¶
func (c *SessionEntityTypesClient) DeleteSessionEntityType(ctx context.Context, req *cxpb.DeleteSessionEntityTypeRequest, opts ...gax.CallOption) error
DeleteSessionEntityType deletes the specified session entity type.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteSessionEntityTypeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeleteSessionEntityTypeRequest.
}
err = c.DeleteSessionEntityType(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*SessionEntityTypesClient) GetLocation ¶
func (c *SessionEntityTypesClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionEntityTypesClient(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 (*SessionEntityTypesClient) GetOperation ¶
func (c *SessionEntityTypesClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SessionEntityTypesClient) GetSessionEntityType ¶
func (c *SessionEntityTypesClient) GetSessionEntityType(ctx context.Context, req *cxpb.GetSessionEntityTypeRequest, opts ...gax.CallOption) (*cxpb.SessionEntityType, error)
GetSessionEntityType retrieves the specified session entity type.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetSessionEntityTypeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetSessionEntityTypeRequest.
}
resp, err := c.GetSessionEntityType(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SessionEntityTypesClient) ListLocations ¶
func (c *SessionEntityTypesClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionEntityTypesClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SessionEntityTypesClient) ListOperations ¶
func (c *SessionEntityTypesClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SessionEntityTypesClient) ListSessionEntityTypes ¶
func (c *SessionEntityTypesClient) ListSessionEntityTypes(ctx context.Context, req *cxpb.ListSessionEntityTypesRequest, opts ...gax.CallOption) *SessionEntityTypeIterator
ListSessionEntityTypes returns the list of all session entity types in the specified session.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListSessionEntityTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListSessionEntityTypesRequest.
}
it := c.ListSessionEntityTypes(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListSessionEntityTypesResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListSessionEntityTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListSessionEntityTypesRequest.
}
for resp, err := range c.ListSessionEntityTypes(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SessionEntityTypesClient) UpdateSessionEntityType ¶
func (c *SessionEntityTypesClient) UpdateSessionEntityType(ctx context.Context, req *cxpb.UpdateSessionEntityTypeRequest, opts ...gax.CallOption) (*cxpb.SessionEntityType, error)
UpdateSessionEntityType updates the specified session entity type.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateSessionEntityTypeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdateSessionEntityTypeRequest.
}
resp, err := c.UpdateSessionEntityType(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type SessionsCallOptions ¶
type SessionsCallOptions struct { DetectIntent []gax.CallOption ServerStreamingDetectIntent []gax.CallOption StreamingDetectIntent []gax.CallOption MatchIntent []gax.CallOption FulfillIntent []gax.CallOption SubmitAnswerFeedback []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
SessionsCallOptions contains the retry settings for each method of SessionsClient.
type SessionsClient ¶
type SessionsClient struct { // The call options for this service. CallOptions *SessionsCallOptions // contains filtered or unexported fields }
SessionsClient 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.
A session represents an interaction with a user. You retrieve user input and pass it to the DetectIntent method to determine user intent and respond.
func NewSessionsClient ¶
func NewSessionsClient(ctx context.Context, opts ...option.ClientOption) (*SessionsClient, error)
NewSessionsClient creates a new sessions client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
A session represents an interaction with a user. You retrieve user input
and pass it to the
DetectIntent
method to determine user intent and respond.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewSessionsRESTClient ¶
func NewSessionsRESTClient(ctx context.Context, opts ...option.ClientOption) (*SessionsClient, error)
NewSessionsRESTClient creates a new sessions rest client.
A session represents an interaction with a user. You retrieve user input
and pass it to the
DetectIntent
method to determine user intent and respond.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*SessionsClient) CancelOperation ¶
func (c *SessionsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*SessionsClient) Close ¶
func (c *SessionsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*SessionsClient) Connection ¶
func (c *SessionsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*SessionsClient) DetectIntent ¶
func (c *SessionsClient) DetectIntent(ctx context.Context, req *cxpb.DetectIntentRequest, opts ...gax.CallOption) (*cxpb.DetectIntentResponse, error)
DetectIntent processes a natural language query and returns structured, actionable data as a result. This method is not idempotent, because it may cause session entity types to be updated, which in turn might affect results of future queries.
Note: Always use agent versions for production traffic.
See Versions and
environments (at https://cloud.google.com/dialogflow/cx/docs/concept/version).
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DetectIntentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DetectIntentRequest.
}
resp, err := c.DetectIntent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SessionsClient) FulfillIntent ¶
func (c *SessionsClient) FulfillIntent(ctx context.Context, req *cxpb.FulfillIntentRequest, opts ...gax.CallOption) (*cxpb.FulfillIntentResponse, error)
FulfillIntent fulfills a matched intent returned by
MatchIntent.
Must be called after
MatchIntent,
with input from
MatchIntentResponse.
Otherwise, the behavior is undefined.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.FulfillIntentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#FulfillIntentRequest.
}
resp, err := c.FulfillIntent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SessionsClient) GetLocation ¶
func (c *SessionsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionsClient(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 (*SessionsClient) GetOperation ¶
func (c *SessionsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SessionsClient) ListLocations ¶
func (c *SessionsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionsClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SessionsClient) ListOperations ¶
func (c *SessionsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SessionsClient) MatchIntent ¶
func (c *SessionsClient) MatchIntent(ctx context.Context, req *cxpb.MatchIntentRequest, opts ...gax.CallOption) (*cxpb.MatchIntentResponse, error)
MatchIntent returns preliminary intent match results, doesn’t change the session
status.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.MatchIntentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#MatchIntentRequest.
}
resp, err := c.MatchIntent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SessionsClient) ServerStreamingDetectIntent ¶
func (c *SessionsClient) ServerStreamingDetectIntent(ctx context.Context, req *cxpb.DetectIntentRequest, opts ...gax.CallOption) (cxpb.Sessions_ServerStreamingDetectIntentClient, error)
ServerStreamingDetectIntent processes a natural language query and returns structured, actionable data as a result through server-side streaming. Server-side streaming allows Dialogflow to send partial responses (at https://cloud.google.com/dialogflow/cx/docs/concept/fulfillment#partial-response) earlier in a single request.
func (*SessionsClient) StreamingDetectIntent ¶
func (c *SessionsClient) StreamingDetectIntent(ctx context.Context, opts ...gax.CallOption) (cxpb.Sessions_StreamingDetectIntentClient, error)
StreamingDetectIntent processes a natural language query in audio format in a streaming fashion and returns structured, actionable data as a result. This method is only available via the gRPC API (not REST).
Note: Always use agent versions for production traffic. See Versions and environments (at https://cloud.google.com/dialogflow/cx/docs/concept/version).
This method is not supported for the REST transport.
Code:play
Example¶
package main
import (
"context"
"io"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
stream, err := c.StreamingDetectIntent(ctx)
if err != nil {
// TODO: Handle error.
}
go func() {
reqs := []*cxpb.StreamingDetectIntentRequest{
// TODO: Create requests.
}
for _, req := range reqs {
if err := stream.Send(req); err != nil {
// TODO: Handle error.
}
}
stream.CloseSend()
}()
for {
resp, err := stream.Recv()
if err == io.EOF {
break
}
if err != nil {
// TODO: handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*SessionsClient) SubmitAnswerFeedback ¶
func (c *SessionsClient) SubmitAnswerFeedback(ctx context.Context, req *cxpb.SubmitAnswerFeedbackRequest, opts ...gax.CallOption) (*cxpb.AnswerFeedback, error)
SubmitAnswerFeedback updates the feedback received from the user for a single turn of the bot
response.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewSessionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.SubmitAnswerFeedbackRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#SubmitAnswerFeedbackRequest.
}
resp, err := c.SubmitAnswerFeedback(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type TestCaseIterator ¶
type TestCaseIterator 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 []*cxpb.TestCase, nextPageToken string, err error) // contains filtered or unexported fields }
TestCaseIterator manages a stream of *cxpb.TestCase.
func (*TestCaseIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*TestCaseIterator) Next ¶
func (it *TestCaseIterator) Next() (*cxpb.TestCase, 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 (*TestCaseIterator) PageInfo ¶
func (it *TestCaseIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TestCaseResultIterator ¶
type TestCaseResultIterator 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 []*cxpb.TestCaseResult, nextPageToken string, err error) // contains filtered or unexported fields }
TestCaseResultIterator manages a stream of *cxpb.TestCaseResult.
func (*TestCaseResultIterator) All ¶
func (it *TestCaseResultIterator) All() iter.Seq2[*cxpb.TestCaseResult, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*TestCaseResultIterator) Next ¶
func (it *TestCaseResultIterator) Next() (*cxpb.TestCaseResult, 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 (*TestCaseResultIterator) PageInfo ¶
func (it *TestCaseResultIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TestCasesCallOptions ¶
type TestCasesCallOptions struct { ListTestCases []gax.CallOption BatchDeleteTestCases []gax.CallOption GetTestCase []gax.CallOption CreateTestCase []gax.CallOption UpdateTestCase []gax.CallOption RunTestCase []gax.CallOption BatchRunTestCases []gax.CallOption CalculateCoverage []gax.CallOption ImportTestCases []gax.CallOption ExportTestCases []gax.CallOption ListTestCaseResults []gax.CallOption GetTestCaseResult []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
TestCasesCallOptions contains the retry settings for each method of TestCasesClient.
type TestCasesClient ¶
type TestCasesClient struct { // The call options for this service. CallOptions *TestCasesCallOptions // 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 }
TestCasesClient 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 [Test Cases][google.cloud.dialogflow.cx.v3beta1.TestCase] and [Test Case Results][google.cloud.dialogflow.cx.v3beta1.TestCaseResult].
func NewTestCasesClient ¶
func NewTestCasesClient(ctx context.Context, opts ...option.ClientOption) (*TestCasesClient, error)
NewTestCasesClient creates a new test cases 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 [Test
Cases][google.cloud.dialogflow.cx.v3beta1.TestCase] and [Test Case
Results][google.cloud.dialogflow.cx.v3beta1.TestCaseResult].
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewTestCasesRESTClient ¶
func NewTestCasesRESTClient(ctx context.Context, opts ...option.ClientOption) (*TestCasesClient, error)
NewTestCasesRESTClient creates a new test cases rest client.
Service for managing [Test
Cases][google.cloud.dialogflow.cx.v3beta1.TestCase] and [Test Case
Results][google.cloud.dialogflow.cx.v3beta1.TestCaseResult].
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*TestCasesClient) BatchDeleteTestCases ¶
func (c *TestCasesClient) BatchDeleteTestCases(ctx context.Context, req *cxpb.BatchDeleteTestCasesRequest, opts ...gax.CallOption) error
BatchDeleteTestCases batch deletes test cases.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.BatchDeleteTestCasesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#BatchDeleteTestCasesRequest.
}
err = c.BatchDeleteTestCases(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*TestCasesClient) BatchRunTestCases ¶
func (c *TestCasesClient) BatchRunTestCases(ctx context.Context, req *cxpb.BatchRunTestCasesRequest, opts ...gax.CallOption) (*BatchRunTestCasesOperation, error)
BatchRunTestCases kicks off a batch run of test cases.
This method is a long-running operation (at https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned Operation type has the following method-specific fields:
metadata: BatchRunTestCasesMetadata response: BatchRunTestCasesResponse
Example¶
Code:play
package main import ( "context" cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := cx.NewTestCasesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &cxpb.BatchRunTestCasesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#BatchRunTestCasesRequest. } op, err := c.BatchRunTestCases(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
func (*TestCasesClient) BatchRunTestCasesOperation ¶
func (c *TestCasesClient) BatchRunTestCasesOperation(name string) *BatchRunTestCasesOperation
BatchRunTestCasesOperation returns a new BatchRunTestCasesOperation from a given name. The name must be that of a previously created BatchRunTestCasesOperation, possibly from a different process.
func (*TestCasesClient) CalculateCoverage ¶
func (c *TestCasesClient) CalculateCoverage(ctx context.Context, req *cxpb.CalculateCoverageRequest, opts ...gax.CallOption) (*cxpb.CalculateCoverageResponse, error)
CalculateCoverage calculates the test coverage for an agent.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CalculateCoverageRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CalculateCoverageRequest.
}
resp, err := c.CalculateCoverage(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TestCasesClient) CancelOperation ¶
func (c *TestCasesClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*TestCasesClient) Close ¶
func (c *TestCasesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*TestCasesClient) Connection ¶
func (c *TestCasesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*TestCasesClient) CreateTestCase ¶
func (c *TestCasesClient) CreateTestCase(ctx context.Context, req *cxpb.CreateTestCaseRequest, opts ...gax.CallOption) (*cxpb.TestCase, error)
CreateTestCase creates a test case for the given agent.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateTestCaseRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreateTestCaseRequest.
}
resp, err := c.CreateTestCase(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TestCasesClient) ExportTestCases ¶
func (c *TestCasesClient) ExportTestCases(ctx context.Context, req *cxpb.ExportTestCasesRequest, opts ...gax.CallOption) (*ExportTestCasesOperation, error)
ExportTestCases exports the test cases under the agent to a Cloud Storage bucket or a local file. Filter can be applied to export a subset of test cases.
This method is a long-running operation (at https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned Operation type has the following method-specific fields:
metadata: ExportTestCasesMetadata response: ExportTestCasesResponse
Example¶
Code:play
package main import ( "context" cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := cx.NewTestCasesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &cxpb.ExportTestCasesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ExportTestCasesRequest. } op, err := c.ExportTestCases(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
func (*TestCasesClient) ExportTestCasesOperation ¶
func (c *TestCasesClient) ExportTestCasesOperation(name string) *ExportTestCasesOperation
ExportTestCasesOperation returns a new ExportTestCasesOperation from a given name. The name must be that of a previously created ExportTestCasesOperation, possibly from a different process.
func (*TestCasesClient) GetLocation ¶
func (c *TestCasesClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesClient(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 (*TestCasesClient) GetOperation ¶
func (c *TestCasesClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TestCasesClient) GetTestCase ¶
func (c *TestCasesClient) GetTestCase(ctx context.Context, req *cxpb.GetTestCaseRequest, opts ...gax.CallOption) (*cxpb.TestCase, error)
GetTestCase gets a test case.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetTestCaseRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetTestCaseRequest.
}
resp, err := c.GetTestCase(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TestCasesClient) GetTestCaseResult ¶
func (c *TestCasesClient) GetTestCaseResult(ctx context.Context, req *cxpb.GetTestCaseResultRequest, opts ...gax.CallOption) (*cxpb.TestCaseResult, error)
GetTestCaseResult gets a test case result.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetTestCaseResultRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetTestCaseResultRequest.
}
resp, err := c.GetTestCaseResult(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TestCasesClient) ImportTestCases ¶
func (c *TestCasesClient) ImportTestCases(ctx context.Context, req *cxpb.ImportTestCasesRequest, opts ...gax.CallOption) (*ImportTestCasesOperation, error)
ImportTestCases imports the test cases from a Cloud Storage bucket or a local file. It always creates new test cases and won’t overwrite any existing ones. The provided ID in the imported test case is neglected.
This method is a long-running operation (at https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned Operation type has the following method-specific fields:
metadata: ImportTestCasesMetadata response: ImportTestCasesResponse
Example¶
Code:play
package main import ( "context" cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := cx.NewTestCasesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &cxpb.ImportTestCasesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ImportTestCasesRequest. } op, err := c.ImportTestCases(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
func (*TestCasesClient) ImportTestCasesOperation ¶
func (c *TestCasesClient) ImportTestCasesOperation(name string) *ImportTestCasesOperation
ImportTestCasesOperation returns a new ImportTestCasesOperation from a given name. The name must be that of a previously created ImportTestCasesOperation, possibly from a different process.
func (*TestCasesClient) ListLocations ¶
func (c *TestCasesClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TestCasesClient) ListOperations ¶
func (c *TestCasesClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TestCasesClient) ListTestCaseResults ¶
func (c *TestCasesClient) ListTestCaseResults(ctx context.Context, req *cxpb.ListTestCaseResultsRequest, opts ...gax.CallOption) *TestCaseResultIterator
ListTestCaseResults fetches the list of run results for the given test case. A maximum of 100
results are kept for each test case.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListTestCaseResultsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListTestCaseResultsRequest.
}
it := c.ListTestCaseResults(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListTestCaseResultsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListTestCaseResultsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListTestCaseResultsRequest.
}
for resp, err := range c.ListTestCaseResults(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TestCasesClient) ListTestCases ¶
func (c *TestCasesClient) ListTestCases(ctx context.Context, req *cxpb.ListTestCasesRequest, opts ...gax.CallOption) *TestCaseIterator
ListTestCases fetches a list of test cases for a given agent.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListTestCasesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListTestCasesRequest.
}
it := c.ListTestCases(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListTestCasesResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListTestCasesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListTestCasesRequest.
}
for resp, err := range c.ListTestCases(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TestCasesClient) RunTestCase ¶
func (c *TestCasesClient) RunTestCase(ctx context.Context, req *cxpb.RunTestCaseRequest, opts ...gax.CallOption) (*RunTestCaseOperation, error)
RunTestCase kicks off a test case run.
This method is a long-running operation (at https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned Operation type has the following method-specific fields:
metadata: RunTestCaseMetadata response: RunTestCaseResponse
Example¶
Code:play
package main import ( "context" cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := cx.NewTestCasesClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &cxpb.RunTestCaseRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#RunTestCaseRequest. } op, err := c.RunTestCase(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
func (*TestCasesClient) RunTestCaseOperation ¶
func (c *TestCasesClient) RunTestCaseOperation(name string) *RunTestCaseOperation
RunTestCaseOperation returns a new RunTestCaseOperation from a given name. The name must be that of a previously created RunTestCaseOperation, possibly from a different process.
func (*TestCasesClient) UpdateTestCase ¶
func (c *TestCasesClient) UpdateTestCase(ctx context.Context, req *cxpb.UpdateTestCaseRequest, opts ...gax.CallOption) (*cxpb.TestCase, error)
UpdateTestCase updates the specified test case.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTestCasesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateTestCaseRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdateTestCaseRequest.
}
resp, err := c.UpdateTestCase(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type ToolIterator ¶
type ToolIterator 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 []*cxpb.Tool, nextPageToken string, err error) // contains filtered or unexported fields }
ToolIterator manages a stream of *cxpb.Tool.
func (*ToolIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ToolIterator) Next ¶
func (it *ToolIterator) Next() (*cxpb.Tool, 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 (*ToolIterator) PageInfo ¶
func (it *ToolIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ToolsCallOptions ¶
type ToolsCallOptions struct { CreateTool []gax.CallOption ListTools []gax.CallOption ExportTools []gax.CallOption GetTool []gax.CallOption UpdateTool []gax.CallOption DeleteTool []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
ToolsCallOptions contains the retry settings for each method of ToolsClient.
type ToolsClient ¶
type ToolsClient struct { // The call options for this service. CallOptions *ToolsCallOptions // 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 }
ToolsClient 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 Tools.
func NewToolsClient ¶
func NewToolsClient(ctx context.Context, opts ...option.ClientOption) (*ToolsClient, error)
NewToolsClient creates a new tools 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 Tools.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewToolsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewToolsRESTClient ¶
func NewToolsRESTClient(ctx context.Context, opts ...option.ClientOption) (*ToolsClient, error)
NewToolsRESTClient creates a new tools rest client.
Service for managing Tools.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewToolsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ToolsClient) CancelOperation ¶
func (c *ToolsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewToolsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ToolsClient) Close ¶
func (c *ToolsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ToolsClient) Connection ¶
func (c *ToolsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ToolsClient) CreateTool ¶
func (c *ToolsClient) CreateTool(ctx context.Context, req *cxpb.CreateToolRequest, opts ...gax.CallOption) (*cxpb.Tool, error)
CreateTool creates a Tool in the specified
agent.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewToolsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateToolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreateToolRequest.
}
resp, err := c.CreateTool(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ToolsClient) DeleteTool ¶
func (c *ToolsClient) DeleteTool(ctx context.Context, req *cxpb.DeleteToolRequest, opts ...gax.CallOption) error
DeleteTool deletes a specified Tool.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewToolsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteToolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeleteToolRequest.
}
err = c.DeleteTool(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ToolsClient) ExportTools ¶
func (c *ToolsClient) ExportTools(ctx context.Context, req *cxpb.ExportToolsRequest, opts ...gax.CallOption) (*ExportToolsOperation, error)
ExportTools exports the selected tools.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewToolsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ExportToolsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ExportToolsRequest.
}
op, err := c.ExportTools(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ToolsClient) ExportToolsOperation ¶
func (c *ToolsClient) ExportToolsOperation(name string) *ExportToolsOperation
ExportToolsOperation returns a new ExportToolsOperation from a given name. The name must be that of a previously created ExportToolsOperation, possibly from a different process.
func (*ToolsClient) GetLocation ¶
func (c *ToolsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewToolsClient(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 (*ToolsClient) GetOperation ¶
func (c *ToolsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewToolsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ToolsClient) GetTool ¶
func (c *ToolsClient) GetTool(ctx context.Context, req *cxpb.GetToolRequest, opts ...gax.CallOption) (*cxpb.Tool, error)
GetTool retrieves the specified Tool.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewToolsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetToolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetToolRequest.
}
resp, err := c.GetTool(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ToolsClient) ListLocations ¶
func (c *ToolsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewToolsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewToolsClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ToolsClient) ListOperations ¶
func (c *ToolsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewToolsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewToolsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ToolsClient) ListTools ¶
func (c *ToolsClient) ListTools(ctx context.Context, req *cxpb.ListToolsRequest, opts ...gax.CallOption) *ToolIterator
ListTools returns a list of Tools in the
specified agent.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewToolsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListToolsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListToolsRequest.
}
it := c.ListTools(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListToolsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewToolsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListToolsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListToolsRequest.
}
for resp, err := range c.ListTools(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ToolsClient) UpdateTool ¶
func (c *ToolsClient) UpdateTool(ctx context.Context, req *cxpb.UpdateToolRequest, opts ...gax.CallOption) (*cxpb.Tool, error)
UpdateTool update the specified Tool.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewToolsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateToolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdateToolRequest.
}
resp, err := c.UpdateTool(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type TrainFlowOperation ¶
type TrainFlowOperation struct {
// contains filtered or unexported fields
}
TrainFlowOperation manages a long-running operation from TrainFlow.
func (*TrainFlowOperation) Done ¶
func (op *TrainFlowOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*TrainFlowOperation) Metadata ¶
func (op *TrainFlowOperation) 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 (*TrainFlowOperation) Name ¶
func (op *TrainFlowOperation) 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 (*TrainFlowOperation) Poll ¶
func (op *TrainFlowOperation) 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 (*TrainFlowOperation) Wait ¶
func (op *TrainFlowOperation) 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.
type TransitionRouteGroupIterator ¶
type TransitionRouteGroupIterator 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 []*cxpb.TransitionRouteGroup, nextPageToken string, err error) // contains filtered or unexported fields }
TransitionRouteGroupIterator manages a stream of *cxpb.TransitionRouteGroup.
func (*TransitionRouteGroupIterator) All ¶
func (it *TransitionRouteGroupIterator) All() iter.Seq2[*cxpb.TransitionRouteGroup, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*TransitionRouteGroupIterator) Next ¶
func (it *TransitionRouteGroupIterator) Next() (*cxpb.TransitionRouteGroup, 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 (*TransitionRouteGroupIterator) PageInfo ¶
func (it *TransitionRouteGroupIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TransitionRouteGroupsCallOptions ¶
type TransitionRouteGroupsCallOptions struct { ListTransitionRouteGroups []gax.CallOption GetTransitionRouteGroup []gax.CallOption CreateTransitionRouteGroup []gax.CallOption UpdateTransitionRouteGroup []gax.CallOption DeleteTransitionRouteGroup []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
TransitionRouteGroupsCallOptions contains the retry settings for each method of TransitionRouteGroupsClient.
type TransitionRouteGroupsClient ¶
type TransitionRouteGroupsClient struct { // The call options for this service. CallOptions *TransitionRouteGroupsCallOptions // contains filtered or unexported fields }
TransitionRouteGroupsClient 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 TransitionRouteGroups.
func NewTransitionRouteGroupsClient ¶
func NewTransitionRouteGroupsClient(ctx context.Context, opts ...option.ClientOption) (*TransitionRouteGroupsClient, error)
NewTransitionRouteGroupsClient creates a new transition route groups 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
TransitionRouteGroups.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTransitionRouteGroupsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewTransitionRouteGroupsRESTClient ¶
func NewTransitionRouteGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (*TransitionRouteGroupsClient, error)
NewTransitionRouteGroupsRESTClient creates a new transition route groups rest client.
Service for managing
TransitionRouteGroups.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTransitionRouteGroupsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*TransitionRouteGroupsClient) CancelOperation ¶
func (c *TransitionRouteGroupsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTransitionRouteGroupsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*TransitionRouteGroupsClient) Close ¶
func (c *TransitionRouteGroupsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*TransitionRouteGroupsClient) Connection ¶
func (c *TransitionRouteGroupsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*TransitionRouteGroupsClient) CreateTransitionRouteGroup ¶
func (c *TransitionRouteGroupsClient) CreateTransitionRouteGroup(ctx context.Context, req *cxpb.CreateTransitionRouteGroupRequest, opts ...gax.CallOption) (*cxpb.TransitionRouteGroup, error)
CreateTransitionRouteGroup creates an TransitionRouteGroup in the specified flow.
Note: You should always train a flow prior to sending it queries. See the
training
documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training).
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTransitionRouteGroupsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateTransitionRouteGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreateTransitionRouteGroupRequest.
}
resp, err := c.CreateTransitionRouteGroup(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TransitionRouteGroupsClient) DeleteTransitionRouteGroup ¶
func (c *TransitionRouteGroupsClient) DeleteTransitionRouteGroup(ctx context.Context, req *cxpb.DeleteTransitionRouteGroupRequest, opts ...gax.CallOption) error
DeleteTransitionRouteGroup deletes the specified TransitionRouteGroup.
Note: You should always train a flow prior to sending it queries. See the
training
documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training).
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTransitionRouteGroupsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteTransitionRouteGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeleteTransitionRouteGroupRequest.
}
err = c.DeleteTransitionRouteGroup(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*TransitionRouteGroupsClient) GetLocation ¶
func (c *TransitionRouteGroupsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTransitionRouteGroupsClient(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 (*TransitionRouteGroupsClient) GetOperation ¶
func (c *TransitionRouteGroupsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTransitionRouteGroupsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TransitionRouteGroupsClient) GetTransitionRouteGroup ¶
func (c *TransitionRouteGroupsClient) GetTransitionRouteGroup(ctx context.Context, req *cxpb.GetTransitionRouteGroupRequest, opts ...gax.CallOption) (*cxpb.TransitionRouteGroup, error)
GetTransitionRouteGroup retrieves the specified
TransitionRouteGroup.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTransitionRouteGroupsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetTransitionRouteGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetTransitionRouteGroupRequest.
}
resp, err := c.GetTransitionRouteGroup(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TransitionRouteGroupsClient) ListLocations ¶
func (c *TransitionRouteGroupsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTransitionRouteGroupsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTransitionRouteGroupsClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TransitionRouteGroupsClient) ListOperations ¶
func (c *TransitionRouteGroupsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTransitionRouteGroupsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTransitionRouteGroupsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TransitionRouteGroupsClient) ListTransitionRouteGroups ¶
func (c *TransitionRouteGroupsClient) ListTransitionRouteGroups(ctx context.Context, req *cxpb.ListTransitionRouteGroupsRequest, opts ...gax.CallOption) *TransitionRouteGroupIterator
ListTransitionRouteGroups returns the list of all transition route groups in the specified flow.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTransitionRouteGroupsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListTransitionRouteGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListTransitionRouteGroupsRequest.
}
it := c.ListTransitionRouteGroups(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListTransitionRouteGroupsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTransitionRouteGroupsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListTransitionRouteGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListTransitionRouteGroupsRequest.
}
for resp, err := range c.ListTransitionRouteGroups(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TransitionRouteGroupsClient) UpdateTransitionRouteGroup ¶
func (c *TransitionRouteGroupsClient) UpdateTransitionRouteGroup(ctx context.Context, req *cxpb.UpdateTransitionRouteGroupRequest, opts ...gax.CallOption) (*cxpb.TransitionRouteGroup, error)
UpdateTransitionRouteGroup updates the specified TransitionRouteGroup.
Note: You should always train a flow prior to sending it queries. See the
training
documentation (at https://cloud.google.com/dialogflow/cx/docs/concept/training).
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewTransitionRouteGroupsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateTransitionRouteGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdateTransitionRouteGroupRequest.
}
resp, err := c.UpdateTransitionRouteGroup(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type UpdateEnvironmentOperation ¶
type UpdateEnvironmentOperation struct {
// contains filtered or unexported fields
}
UpdateEnvironmentOperation manages a long-running operation from UpdateEnvironment.
func (*UpdateEnvironmentOperation) Done ¶
func (op *UpdateEnvironmentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateEnvironmentOperation) Metadata ¶
func (op *UpdateEnvironmentOperation) 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 (*UpdateEnvironmentOperation) Name ¶
func (op *UpdateEnvironmentOperation) 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 (*UpdateEnvironmentOperation) Poll ¶
func (op *UpdateEnvironmentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.Environment, 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 (*UpdateEnvironmentOperation) Wait ¶
func (op *UpdateEnvironmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cxpb.Environment, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type VersionIterator ¶
type VersionIterator 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 []*cxpb.Version, nextPageToken string, err error) // contains filtered or unexported fields }
VersionIterator manages a stream of *cxpb.Version.
func (*VersionIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*VersionIterator) Next ¶
func (it *VersionIterator) Next() (*cxpb.Version, 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 (*VersionIterator) PageInfo ¶
func (it *VersionIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type VersionsCallOptions ¶
type VersionsCallOptions struct { ListVersions []gax.CallOption GetVersion []gax.CallOption CreateVersion []gax.CallOption UpdateVersion []gax.CallOption DeleteVersion []gax.CallOption LoadVersion []gax.CallOption CompareVersions []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
VersionsCallOptions contains the retry settings for each method of VersionsClient.
type VersionsClient ¶
type VersionsClient struct { // The call options for this service. CallOptions *VersionsCallOptions // 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 }
VersionsClient 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 Versions.
func NewVersionsClient ¶
func NewVersionsClient(ctx context.Context, opts ...option.ClientOption) (*VersionsClient, error)
NewVersionsClient creates a new versions 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 Versions.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewVersionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewVersionsRESTClient ¶
func NewVersionsRESTClient(ctx context.Context, opts ...option.ClientOption) (*VersionsClient, error)
NewVersionsRESTClient creates a new versions rest client.
Service for managing Versions.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewVersionsRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*VersionsClient) CancelOperation ¶
func (c *VersionsClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewVersionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*VersionsClient) Close ¶
func (c *VersionsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*VersionsClient) CompareVersions ¶
func (c *VersionsClient) CompareVersions(ctx context.Context, req *cxpb.CompareVersionsRequest, opts ...gax.CallOption) (*cxpb.CompareVersionsResponse, error)
CompareVersions compares the specified base version with target version.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewVersionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CompareVersionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CompareVersionsRequest.
}
resp, err := c.CompareVersions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*VersionsClient) Connection ¶
func (c *VersionsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*VersionsClient) CreateVersion ¶
func (c *VersionsClient) CreateVersion(ctx context.Context, req *cxpb.CreateVersionRequest, opts ...gax.CallOption) (*CreateVersionOperation, error)
CreateVersion creates a Version in the specified Flow.
This method is a long-running operation (at https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned Operation type has the following method-specific fields:
metadata: CreateVersionOperationMetadata response: Version
Example¶
Code:play
package main import ( "context" cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := cx.NewVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &cxpb.CreateVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreateVersionRequest. } op, err := c.CreateVersion(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
func (*VersionsClient) CreateVersionOperation ¶
func (c *VersionsClient) CreateVersionOperation(name string) *CreateVersionOperation
CreateVersionOperation returns a new CreateVersionOperation from a given name. The name must be that of a previously created CreateVersionOperation, possibly from a different process.
func (*VersionsClient) DeleteVersion ¶
func (c *VersionsClient) DeleteVersion(ctx context.Context, req *cxpb.DeleteVersionRequest, opts ...gax.CallOption) error
DeleteVersion deletes the specified
Version.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewVersionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeleteVersionRequest.
}
err = c.DeleteVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*VersionsClient) GetLocation ¶
func (c *VersionsClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewVersionsClient(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 (*VersionsClient) GetOperation ¶
func (c *VersionsClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewVersionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*VersionsClient) GetVersion ¶
func (c *VersionsClient) GetVersion(ctx context.Context, req *cxpb.GetVersionRequest, opts ...gax.CallOption) (*cxpb.Version, error)
GetVersion retrieves the specified
Version.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewVersionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetVersionRequest.
}
resp, err := c.GetVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*VersionsClient) ListLocations ¶
func (c *VersionsClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewVersionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewVersionsClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*VersionsClient) ListOperations ¶
func (c *VersionsClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewVersionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewVersionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*VersionsClient) ListVersions ¶
func (c *VersionsClient) ListVersions(ctx context.Context, req *cxpb.ListVersionsRequest, opts ...gax.CallOption) *VersionIterator
ListVersions returns the list of all versions in the specified
Flow.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewVersionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListVersionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListVersionsRequest.
}
it := c.ListVersions(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListVersionsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewVersionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListVersionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListVersionsRequest.
}
for resp, err := range c.ListVersions(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*VersionsClient) LoadVersion ¶
func (c *VersionsClient) LoadVersion(ctx context.Context, req *cxpb.LoadVersionRequest, opts ...gax.CallOption) (*LoadVersionOperation, error)
LoadVersion loads resources in the specified version to the draft flow.
This method is a long-running operation (at https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 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)
Example¶
Code:play
package main import ( "context" cx "cloud.google.com/go/dialogflow/cx/apiv3beta1" cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := cx.NewVersionsClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &cxpb.LoadVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#LoadVersionRequest. } op, err := c.LoadVersion(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
func (*VersionsClient) LoadVersionOperation ¶
func (c *VersionsClient) LoadVersionOperation(name string) *LoadVersionOperation
LoadVersionOperation returns a new LoadVersionOperation from a given name. The name must be that of a previously created LoadVersionOperation, possibly from a different process.
func (*VersionsClient) UpdateVersion ¶
func (c *VersionsClient) UpdateVersion(ctx context.Context, req *cxpb.UpdateVersionRequest, opts ...gax.CallOption) (*cxpb.Version, error)
UpdateVersion updates the specified
Version.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewVersionsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdateVersionRequest.
}
resp, err := c.UpdateVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
type WebhookIterator ¶
type WebhookIterator 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 []*cxpb.Webhook, nextPageToken string, err error) // contains filtered or unexported fields }
WebhookIterator manages a stream of *cxpb.Webhook.
func (*WebhookIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*WebhookIterator) Next ¶
func (it *WebhookIterator) Next() (*cxpb.Webhook, 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 (*WebhookIterator) PageInfo ¶
func (it *WebhookIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type WebhooksCallOptions ¶
type WebhooksCallOptions struct { ListWebhooks []gax.CallOption GetWebhook []gax.CallOption CreateWebhook []gax.CallOption UpdateWebhook []gax.CallOption DeleteWebhook []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
WebhooksCallOptions contains the retry settings for each method of WebhooksClient.
type WebhooksClient ¶
type WebhooksClient struct { // The call options for this service. CallOptions *WebhooksCallOptions // contains filtered or unexported fields }
WebhooksClient 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 Webhooks.
func NewWebhooksClient ¶
func NewWebhooksClient(ctx context.Context, opts ...option.ClientOption) (*WebhooksClient, error)
NewWebhooksClient creates a new webhooks 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 Webhooks.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewWebhooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewWebhooksRESTClient ¶
func NewWebhooksRESTClient(ctx context.Context, opts ...option.ClientOption) (*WebhooksClient, error)
NewWebhooksRESTClient creates a new webhooks rest client.
Service for managing Webhooks.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewWebhooksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*WebhooksClient) CancelOperation ¶
func (c *WebhooksClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewWebhooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*WebhooksClient) Close ¶
func (c *WebhooksClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*WebhooksClient) Connection ¶
func (c *WebhooksClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*WebhooksClient) CreateWebhook ¶
func (c *WebhooksClient) CreateWebhook(ctx context.Context, req *cxpb.CreateWebhookRequest, opts ...gax.CallOption) (*cxpb.Webhook, error)
CreateWebhook creates a webhook in the specified agent.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewWebhooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateWebhookRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#CreateWebhookRequest.
}
resp, err := c.CreateWebhook(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*WebhooksClient) DeleteWebhook ¶
func (c *WebhooksClient) DeleteWebhook(ctx context.Context, req *cxpb.DeleteWebhookRequest, opts ...gax.CallOption) error
DeleteWebhook deletes the specified webhook.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewWebhooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteWebhookRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#DeleteWebhookRequest.
}
err = c.DeleteWebhook(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*WebhooksClient) GetLocation ¶
func (c *WebhooksClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewWebhooksClient(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 (*WebhooksClient) GetOperation ¶
func (c *WebhooksClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewWebhooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*WebhooksClient) GetWebhook ¶
func (c *WebhooksClient) GetWebhook(ctx context.Context, req *cxpb.GetWebhookRequest, opts ...gax.CallOption) (*cxpb.Webhook, error)
GetWebhook retrieves the specified webhook.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewWebhooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetWebhookRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#GetWebhookRequest.
}
resp, err := c.GetWebhook(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*WebhooksClient) ListLocations ¶
func (c *WebhooksClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewWebhooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewWebhooksClient(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.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*WebhooksClient) ListOperations ¶
func (c *WebhooksClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewWebhooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewWebhooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*WebhooksClient) ListWebhooks ¶
func (c *WebhooksClient) ListWebhooks(ctx context.Context, req *cxpb.ListWebhooksRequest, opts ...gax.CallOption) *WebhookIterator
ListWebhooks returns the list of all webhooks in the specified agent.
Code:play
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewWebhooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListWebhooksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListWebhooksRequest.
}
it := c.ListWebhooks(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cxpb.ListWebhooksResponse)
}
}
Example (All)¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewWebhooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListWebhooksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#ListWebhooksRequest.
}
for resp, err := range c.ListWebhooks(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*WebhooksClient) UpdateWebhook ¶
func (c *WebhooksClient) UpdateWebhook(ctx context.Context, req *cxpb.UpdateWebhookRequest, opts ...gax.CallOption) (*cxpb.Webhook, error)
UpdateWebhook updates the specified webhook.
Code:play
Example¶
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cx.NewWebhooksClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateWebhookRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb#UpdateWebhookRequest.
}
resp, err := c.UpdateWebhook(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
Source Files ¶
agents_client.go auxiliary.go auxiliary_go123.go changelogs_client.go conversation_history_client.go deployments_client.go doc.go entity_types_client.go environments_client.go examples_client.go experiments_client.go flows_client.go generators_client.go helpers.go intents_client.go pages_client.go playbooks_client.go security_settings_client.go session_entity_types_client.go sessions_client.go test_cases_client.go tools_client.go transition_route_groups_client.go version.go versions_client.go webhooks_client.go
Directories ¶
Path | Synopsis |
---|---|
cx/apiv3beta1/cxpb |
- Version
- v1.65.0 (latest)
- Published
- Feb 12, 2025
- Platform
- linux/amd64
- Imports
- 33 packages
- Last checked
- 6 days ago –
Tools for package owners.