- 0.115.1 (latest)
- 0.115.0
- 0.114.0
- 0.113.0
- 0.112.2
- 0.111.0
- 0.110.10
- 0.109.0
- 0.108.0
- 0.107.0
- 0.106.0
- 0.105.0
- 0.104.0
- 0.103.0
- 0.102.1
- 0.101.1
- 0.100.2
- 0.99.0
- 0.98.0
- 0.97.0
- 0.96.0
- 0.95.0
- 0.94.1
- 0.93.3
- 0.92.3
- 0.91.1
- 0.90.0
- 0.89.0
- 0.88.0
- 0.87.0
- 0.86.0
- 0.85.0
- 0.84.0
- 0.83.0
- 0.82.0
- 0.81.0
- 0.80.0
- 0.79.0
- 0.78.0
- 0.77.0
- 0.76.0
- 0.75.0
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.
Use of Context
The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
For information about setting deadlines, reusing contexts, and more please visit https://pkg.go.dev/cloud.google.com/go.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
AgentIterator
type AgentIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*cxpb.Agent, nextPageToken string, err error)
// contains filtered or unexported fields
}
AgentIterator manages a stream of *cxpb.Agent.
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.
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
}
AgentsCallOptions contains the retry settings for each method of AgentsClient.
AgentsClient
type AgentsClient struct {
// The call options for this service.
CallOptions *AgentsCallOptions
// LROClient is used internally to handle long-running operations.
// It is exposed so that its CallOptions can be modified if required.
// Users should not Close this client.
LROClient *lroauto.OperationsClient
// contains filtered or unexported fields
}
AgentsClient is a client for interacting with Dialogflow API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing Agents.
func NewAgentsClient
func NewAgentsClient(ctx context.Context, opts ...option.ClientOption) (*AgentsClient, error)
NewAgentsClient creates a new agents client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing Agents.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*AgentsClient) Close
func (c *AgentsClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AgentsClient) Connection
func (c *AgentsClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*AgentsClient) 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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateAgentRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteAgentRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ExportAgentRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetAgentRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetAgentValidationResultRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetAgentValidationResult(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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListAgentsRequest{
// TODO: Fill request struct fields.
}
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
}
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.RestoreAgentRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateAgentRequest{
// TODO: Fill request struct fields.
}
resp, err := c.UpdateAgent(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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewAgentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ValidateAgentRequest{
// TODO: Fill request struct fields.
}
resp, err := c.ValidateAgent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
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.
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) 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.
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.
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.
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) 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.
EntityTypesCallOptions
type EntityTypesCallOptions struct {
ListEntityTypes []gax.CallOption
GetEntityType []gax.CallOption
CreateEntityType []gax.CallOption
UpdateEntityType []gax.CallOption
DeleteEntityType []gax.CallOption
}
EntityTypesCallOptions contains the retry settings for each method of EntityTypesClient.
EntityTypesClient
type EntityTypesClient struct {
// The call options for this service.
CallOptions *EntityTypesCallOptions
// 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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
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.
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateEntityTypeRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteEntityTypeRequest{
// TODO: Fill request struct fields.
}
err = c.DeleteEntityType(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetEntityTypeRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetEntityType(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListEntityTypesRequest{
// TODO: Fill request struct fields.
}
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
}
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewEntityTypesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateEntityTypeRequest{
// TODO: Fill request struct fields.
}
resp, err := c.UpdateEntityType(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
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) 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.
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
}
EnvironmentsCallOptions contains the retry settings for each method of EnvironmentsClient.
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
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.
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateEnvironmentRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteEnvironmentRequest{
// TODO: Fill request struct fields.
}
err = c.DeleteEnvironment(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*EnvironmentsClient) GetEnvironment
func (c *EnvironmentsClient) GetEnvironment(ctx context.Context, req *cxpb.GetEnvironmentRequest, opts ...gax.CallOption) (*cxpb.Environment, error)
GetEnvironment retrieves the specified Environment.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetEnvironmentRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetEnvironment(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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListContinuousTestResultsRequest{
// TODO: Fill request struct fields.
}
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
}
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListEnvironmentsRequest{
// TODO: Fill request struct fields.
}
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
}
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.LookupEnvironmentHistoryRequest{
// TODO: Fill request struct fields.
}
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
}
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.RunContinuousTestRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewEnvironmentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateEnvironmentRequest{
// TODO: Fill request struct fields.
}
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.
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) 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.
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
}
ExperimentsCallOptions contains the retry settings for each method of ExperimentsClient.
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
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.
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateExperimentRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteExperimentRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetExperimentRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetExperiment(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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListExperimentsRequest{
// TODO: Fill request struct fields.
}
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
}
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.StartExperimentRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.StopExperimentRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewExperimentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateExperimentRequest{
// TODO: Fill request struct fields.
}
resp, err := c.UpdateExperiment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
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.
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.
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.
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) 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.
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
}
FlowsCallOptions contains the retry settings for each method of FlowsClient.
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
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.
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateFlowRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteFlowRequest{
// TODO: Fill request struct fields.
}
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.
Note that resources (e.g. intents, entities, webhooks) that the flow references will also be exported.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ExportFlowRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetFlowRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetFlowValidationResultRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetFlowValidationResult(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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ImportFlowRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListFlowsRequest{
// TODO: Fill request struct fields.
}
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
}
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.TrainFlowRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateFlowRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewFlowsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ValidateFlowRequest{
// TODO: Fill request struct fields.
}
resp, err := c.ValidateFlow(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
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.
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.
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) 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.
IntentsCallOptions
type IntentsCallOptions struct {
ListIntents []gax.CallOption
GetIntent []gax.CallOption
CreateIntent []gax.CallOption
UpdateIntent []gax.CallOption
DeleteIntent []gax.CallOption
}
IntentsCallOptions contains the retry settings for each method of IntentsClient.
IntentsClient
type IntentsClient struct {
// The call options for this service.
CallOptions *IntentsCallOptions
// 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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewIntentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
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.
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewIntentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreateIntentRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewIntentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeleteIntentRequest{
// TODO: Fill request struct fields.
}
err = c.DeleteIntent(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*IntentsClient) GetIntent
func (c *IntentsClient) GetIntent(ctx context.Context, req *cxpb.GetIntentRequest, opts ...gax.CallOption) (*cxpb.Intent, error)
GetIntent retrieves the specified intent.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewIntentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetIntentRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetIntent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewIntentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListIntentsRequest{
// TODO: Fill request struct fields.
}
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
}
}
func (*IntentsClient) UpdateIntent
func (c *IntentsClient) UpdateIntent(ctx context.Context, req *cxpb.UpdateIntentRequest, opts ...gax.CallOption) (*cxpb.Intent, error)
UpdateIntent updates the specified intent.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewIntentsClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.UpdateIntentRequest{
// TODO: Fill request struct fields.
}
resp, err := c.UpdateIntent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
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.
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) 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.
PagesCallOptions
type PagesCallOptions struct {
ListPages []gax.CallOption
GetPage []gax.CallOption
CreatePage []gax.CallOption
UpdatePage []gax.CallOption
DeletePage []gax.CallOption
}
PagesCallOptions contains the retry settings for each method of PagesClient.
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)].
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewPagesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
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.
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewPagesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.CreatePageRequest{
// TODO: Fill request struct fields.
}
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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewPagesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.DeletePageRequest{
// TODO: Fill request struct fields.
}
err = c.DeletePage(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*PagesClient) GetPage
func (c *PagesClient) GetPage(ctx context.Context, req *cxpb.GetPageRequest, opts ...gax.CallOption) (*cxpb.Page, error)
GetPage retrieves the specified page.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewPagesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.GetPageRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetPage(ctx, req)
if err != nil {
// TODO: Handle 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.
Example
package main
import (
"context"
cx "cloud.google.com/go/dialogflow/cx/apiv3beta1"
"google.golang.org/api/iterator"
cxpb "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1"
)
func main() {
ctx := context.Background()
c, err := cx.NewPagesClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cxpb.ListPagesRequest{
// TODO: Fill request struct fields.
}
it := c.ListPages(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.