Package ces is an auto-generated package for the Gemini Enterprise for Customer Experience API.
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/ces/apiv1@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 := ces.NewAgentClient(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 := &cespb.BatchDeleteConversationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#BatchDeleteConversationsRequest. } op, err := c.BatchDeleteConversations(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context
The ctx passed to NewAgentClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []stringDefaultAuthScopes reports the default set of authentication scopes to use with this package.
AgentCallOptions
type AgentCallOptions struct {
ListApps []gax.CallOption
GetApp []gax.CallOption
CreateApp []gax.CallOption
UpdateApp []gax.CallOption
DeleteApp []gax.CallOption
ExportApp []gax.CallOption
ImportApp []gax.CallOption
ListAgents []gax.CallOption
GetAgent []gax.CallOption
CreateAgent []gax.CallOption
UpdateAgent []gax.CallOption
DeleteAgent []gax.CallOption
ListExamples []gax.CallOption
GetExample []gax.CallOption
CreateExample []gax.CallOption
UpdateExample []gax.CallOption
DeleteExample []gax.CallOption
ListTools []gax.CallOption
GetTool []gax.CallOption
ListConversations []gax.CallOption
GetConversation []gax.CallOption
DeleteConversation []gax.CallOption
BatchDeleteConversations []gax.CallOption
CreateTool []gax.CallOption
UpdateTool []gax.CallOption
DeleteTool []gax.CallOption
ListGuardrails []gax.CallOption
GetGuardrail []gax.CallOption
CreateGuardrail []gax.CallOption
UpdateGuardrail []gax.CallOption
DeleteGuardrail []gax.CallOption
ListDeployments []gax.CallOption
GetDeployment []gax.CallOption
CreateDeployment []gax.CallOption
UpdateDeployment []gax.CallOption
DeleteDeployment []gax.CallOption
ListToolsets []gax.CallOption
GetToolset []gax.CallOption
CreateToolset []gax.CallOption
UpdateToolset []gax.CallOption
DeleteToolset []gax.CallOption
ListAppVersions []gax.CallOption
GetAppVersion []gax.CallOption
CreateAppVersion []gax.CallOption
DeleteAppVersion []gax.CallOption
RestoreAppVersion []gax.CallOption
ListChangelogs []gax.CallOption
GetChangelog []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}AgentCallOptions contains the retry settings for each method of AgentClient.
AgentClient
type AgentClient struct {
// The call options for this service.
CallOptions *AgentCallOptions
// 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
}AgentClient is a client for interacting with Gemini Enterprise for Customer Experience API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The service that manages agent-related resources in Gemini Enterprise for Customer Engagement (CES).
func NewAgentClient
func NewAgentClient(ctx context.Context, opts ...option.ClientOption) (*AgentClient, error)NewAgentClient creates a new agent service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
The service that manages agent-related resources in Gemini Enterprise for Customer Engagement (CES).
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewAgentRESTClient
func NewAgentRESTClient(ctx context.Context, opts ...option.ClientOption) (*AgentClient, error)NewAgentRESTClient creates a new agent service rest client.
The service that manages agent-related resources in Gemini Enterprise for Customer Engagement (CES).
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*AgentClient) BatchDeleteConversations
func (c *AgentClient) BatchDeleteConversations(ctx context.Context, req *cespb.BatchDeleteConversationsRequest, opts ...gax.CallOption) (*BatchDeleteConversationsOperation, error)BatchDeleteConversations batch deletes the specified conversations.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.BatchDeleteConversationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#BatchDeleteConversationsRequest.
}
op, err := c.BatchDeleteConversations(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) BatchDeleteConversationsOperation
func (c *AgentClient) BatchDeleteConversationsOperation(name string) *BatchDeleteConversationsOperationBatchDeleteConversationsOperation returns a new BatchDeleteConversationsOperation from a given name. The name must be that of a previously created BatchDeleteConversationsOperation, possibly from a different process.
func (*AgentClient) CancelOperation
func (c *AgentClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewAgentClient(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 (*AgentClient) Close
func (c *AgentClient) Close() errorClose closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AgentClient) Connection (deprecated)
func (c *AgentClient) Connection() *grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*AgentClient) CreateAgent
func (c *AgentClient) CreateAgent(ctx context.Context, req *cespb.CreateAgentRequest, opts ...gax.CallOption) (*cespb.Agent, error)CreateAgent creates a new agent in the given app.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.CreateAgentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#CreateAgentRequest.
}
resp, err := c.CreateAgent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) CreateApp
func (c *AgentClient) CreateApp(ctx context.Context, req *cespb.CreateAppRequest, opts ...gax.CallOption) (*CreateAppOperation, error)CreateApp creates a new app in the given project and location.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.CreateAppRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#CreateAppRequest.
}
op, err := c.CreateApp(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) CreateAppOperation
func (c *AgentClient) CreateAppOperation(name string) *CreateAppOperationCreateAppOperation returns a new CreateAppOperation from a given name. The name must be that of a previously created CreateAppOperation, possibly from a different process.
func (*AgentClient) CreateAppVersion
func (c *AgentClient) CreateAppVersion(ctx context.Context, req *cespb.CreateAppVersionRequest, opts ...gax.CallOption) (*cespb.AppVersion, error)CreateAppVersion creates a new app version in the given app.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.CreateAppVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#CreateAppVersionRequest.
}
resp, err := c.CreateAppVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) CreateDeployment
func (c *AgentClient) CreateDeployment(ctx context.Context, req *cespb.CreateDeploymentRequest, opts ...gax.CallOption) (*cespb.Deployment, error)CreateDeployment creates a new deployment in the given app.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.CreateDeploymentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#CreateDeploymentRequest.
}
resp, err := c.CreateDeployment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) CreateExample
func (c *AgentClient) CreateExample(ctx context.Context, req *cespb.CreateExampleRequest, opts ...gax.CallOption) (*cespb.Example, error)CreateExample creates a new example in the given app.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.CreateExampleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#CreateExampleRequest.
}
resp, err := c.CreateExample(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) CreateGuardrail
func (c *AgentClient) CreateGuardrail(ctx context.Context, req *cespb.CreateGuardrailRequest, opts ...gax.CallOption) (*cespb.Guardrail, error)CreateGuardrail creates a new guardrail in the given app.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.CreateGuardrailRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#CreateGuardrailRequest.
}
resp, err := c.CreateGuardrail(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) CreateTool
func (c *AgentClient) CreateTool(ctx context.Context, req *cespb.CreateToolRequest, opts ...gax.CallOption) (*cespb.Tool, error)CreateTool creates a new tool in the given app.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.CreateToolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#CreateToolRequest.
}
resp, err := c.CreateTool(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) CreateToolset
func (c *AgentClient) CreateToolset(ctx context.Context, req *cespb.CreateToolsetRequest, opts ...gax.CallOption) (*cespb.Toolset, error)CreateToolset creates a new toolset in the given app.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.CreateToolsetRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#CreateToolsetRequest.
}
resp, err := c.CreateToolset(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) DeleteAgent
func (c *AgentClient) DeleteAgent(ctx context.Context, req *cespb.DeleteAgentRequest, opts ...gax.CallOption) errorDeleteAgent deletes the specified agent.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.DeleteAgentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#DeleteAgentRequest.
}
err = c.DeleteAgent(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AgentClient) DeleteApp
func (c *AgentClient) DeleteApp(ctx context.Context, req *cespb.DeleteAppRequest, opts ...gax.CallOption) (*DeleteAppOperation, error)DeleteApp deletes the specified app.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.DeleteAppRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#DeleteAppRequest.
}
op, err := c.DeleteApp(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*AgentClient) DeleteAppOperation
func (c *AgentClient) DeleteAppOperation(name string) *DeleteAppOperationDeleteAppOperation returns a new DeleteAppOperation from a given name. The name must be that of a previously created DeleteAppOperation, possibly from a different process.
func (*AgentClient) DeleteAppVersion
func (c *AgentClient) DeleteAppVersion(ctx context.Context, req *cespb.DeleteAppVersionRequest, opts ...gax.CallOption) errorDeleteAppVersion deletes the specified app version.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.DeleteAppVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#DeleteAppVersionRequest.
}
err = c.DeleteAppVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AgentClient) DeleteConversation
func (c *AgentClient) DeleteConversation(ctx context.Context, req *cespb.DeleteConversationRequest, opts ...gax.CallOption) errorDeleteConversation deletes the specified conversation.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.DeleteConversationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#DeleteConversationRequest.
}
err = c.DeleteConversation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AgentClient) DeleteDeployment
func (c *AgentClient) DeleteDeployment(ctx context.Context, req *cespb.DeleteDeploymentRequest, opts ...gax.CallOption) errorDeleteDeployment deletes the specified deployment.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.DeleteDeploymentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#DeleteDeploymentRequest.
}
err = c.DeleteDeployment(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AgentClient) DeleteExample
func (c *AgentClient) DeleteExample(ctx context.Context, req *cespb.DeleteExampleRequest, opts ...gax.CallOption) errorDeleteExample deletes the specified example.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.DeleteExampleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#DeleteExampleRequest.
}
err = c.DeleteExample(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AgentClient) DeleteGuardrail
func (c *AgentClient) DeleteGuardrail(ctx context.Context, req *cespb.DeleteGuardrailRequest, opts ...gax.CallOption) errorDeleteGuardrail deletes the specified guardrail.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.DeleteGuardrailRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#DeleteGuardrailRequest.
}
err = c.DeleteGuardrail(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AgentClient) DeleteOperation
func (c *AgentClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AgentClient) DeleteTool
func (c *AgentClient) DeleteTool(ctx context.Context, req *cespb.DeleteToolRequest, opts ...gax.CallOption) errorDeleteTool deletes the specified tool.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.DeleteToolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#DeleteToolRequest.
}
err = c.DeleteTool(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AgentClient) DeleteToolset
func (c *AgentClient) DeleteToolset(ctx context.Context, req *cespb.DeleteToolsetRequest, opts ...gax.CallOption) errorDeleteToolset deletes the specified toolset.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.DeleteToolsetRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#DeleteToolsetRequest.
}
err = c.DeleteToolset(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AgentClient) ExportApp
func (c *AgentClient) ExportApp(ctx context.Context, req *cespb.ExportAppRequest, opts ...gax.CallOption) (*ExportAppOperation, error)ExportApp exports the specified app.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ExportAppRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#ExportAppRequest.
}
op, err := c.ExportApp(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) ExportAppOperation
func (c *AgentClient) ExportAppOperation(name string) *ExportAppOperationExportAppOperation returns a new ExportAppOperation from a given name. The name must be that of a previously created ExportAppOperation, possibly from a different process.
func (*AgentClient) GetAgent
func (c *AgentClient) GetAgent(ctx context.Context, req *cespb.GetAgentRequest, opts ...gax.CallOption) (*cespb.Agent, error)GetAgent gets details of the specified agent.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.GetAgentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#GetAgentRequest.
}
resp, err := c.GetAgent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) GetApp
func (c *AgentClient) GetApp(ctx context.Context, req *cespb.GetAppRequest, opts ...gax.CallOption) (*cespb.App, error)GetApp gets details of the specified app.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.GetAppRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#GetAppRequest.
}
resp, err := c.GetApp(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) GetAppVersion
func (c *AgentClient) GetAppVersion(ctx context.Context, req *cespb.GetAppVersionRequest, opts ...gax.CallOption) (*cespb.AppVersion, error)GetAppVersion gets details of the specified app version.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.GetAppVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#GetAppVersionRequest.
}
resp, err := c.GetAppVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) GetChangelog
func (c *AgentClient) GetChangelog(ctx context.Context, req *cespb.GetChangelogRequest, opts ...gax.CallOption) (*cespb.Changelog, error)GetChangelog gets the specified changelog.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.GetChangelogRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#GetChangelogRequest.
}
resp, err := c.GetChangelog(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) GetConversation
func (c *AgentClient) GetConversation(ctx context.Context, req *cespb.GetConversationRequest, opts ...gax.CallOption) (*cespb.Conversation, error)GetConversation gets details of the specified conversation.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.GetConversationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#GetConversationRequest.
}
resp, err := c.GetConversation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) GetDeployment
func (c *AgentClient) GetDeployment(ctx context.Context, req *cespb.GetDeploymentRequest, opts ...gax.CallOption) (*cespb.Deployment, error)GetDeployment gets details of the specified deployment.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.GetDeploymentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#GetDeploymentRequest.
}
resp, err := c.GetDeployment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) GetExample
func (c *AgentClient) GetExample(ctx context.Context, req *cespb.GetExampleRequest, opts ...gax.CallOption) (*cespb.Example, error)GetExample gets details of the specified example.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.GetExampleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#GetExampleRequest.
}
resp, err := c.GetExample(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) GetGuardrail
func (c *AgentClient) GetGuardrail(ctx context.Context, req *cespb.GetGuardrailRequest, opts ...gax.CallOption) (*cespb.Guardrail, error)GetGuardrail gets details of the specified guardrail.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.GetGuardrailRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#GetGuardrailRequest.
}
resp, err := c.GetGuardrail(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) GetLocation
func (c *AgentClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewAgentClient(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 (*AgentClient) GetOperation
func (c *AgentClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)GetOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewAgentClient(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 (*AgentClient) GetTool
func (c *AgentClient) GetTool(ctx context.Context, req *cespb.GetToolRequest, opts ...gax.CallOption) (*cespb.Tool, error)GetTool gets details of the specified tool.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.GetToolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#GetToolRequest.
}
resp, err := c.GetTool(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) GetToolset
func (c *AgentClient) GetToolset(ctx context.Context, req *cespb.GetToolsetRequest, opts ...gax.CallOption) (*cespb.Toolset, error)GetToolset gets details of the specified toolset.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.GetToolsetRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#GetToolsetRequest.
}
resp, err := c.GetToolset(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) ImportApp
func (c *AgentClient) ImportApp(ctx context.Context, req *cespb.ImportAppRequest, opts ...gax.CallOption) (*ImportAppOperation, error)ImportApp imports the specified app.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ImportAppRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#ImportAppRequest.
}
op, err := c.ImportApp(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) ImportAppOperation
func (c *AgentClient) ImportAppOperation(name string) *ImportAppOperationImportAppOperation returns a new ImportAppOperation from a given name. The name must be that of a previously created ImportAppOperation, possibly from a different process.
func (*AgentClient) ListAgents
func (c *AgentClient) ListAgents(ctx context.Context, req *cespb.ListAgentsRequest, opts ...gax.CallOption) *AgentIteratorListAgents lists agents in the given app.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
"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 := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListAgentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#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.(*cespb.ListAgentsResponse)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListAgentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#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 (*AgentClient) ListAppVersions
func (c *AgentClient) ListAppVersions(ctx context.Context, req *cespb.ListAppVersionsRequest, opts ...gax.CallOption) *AppVersionIteratorListAppVersions lists all app versions in the given app.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
"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 := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListAppVersionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#ListAppVersionsRequest.
}
it := c.ListAppVersions(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.(*cespb.ListAppVersionsResponse)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListAppVersionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#ListAppVersionsRequest.
}
for resp, err := range c.ListAppVersions(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AgentClient) ListApps
func (c *AgentClient) ListApps(ctx context.Context, req *cespb.ListAppsRequest, opts ...gax.CallOption) *AppIteratorListApps lists apps in the given project and location.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
"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 := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListAppsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#ListAppsRequest.
}
it := c.ListApps(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.(*cespb.ListAppsResponse)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListAppsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#ListAppsRequest.
}
for resp, err := range c.ListApps(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AgentClient) ListChangelogs
func (c *AgentClient) ListChangelogs(ctx context.Context, req *cespb.ListChangelogsRequest, opts ...gax.CallOption) *ChangelogIteratorListChangelogs lists the changelogs of the specified app.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
"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 := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListChangelogsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#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.(*cespb.ListChangelogsResponse)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListChangelogsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#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 (*AgentClient) ListConversations
func (c *AgentClient) ListConversations(ctx context.Context, req *cespb.ListConversationsRequest, opts ...gax.CallOption) *ConversationIteratorListConversations lists conversations in the given app.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
"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 := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListConversationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#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.(*cespb.ListConversationsResponse)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListConversationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#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 (*AgentClient) ListDeployments
func (c *AgentClient) ListDeployments(ctx context.Context, req *cespb.ListDeploymentsRequest, opts ...gax.CallOption) *DeploymentIteratorListDeployments lists deployments in the given app.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
"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 := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListDeploymentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#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.(*cespb.ListDeploymentsResponse)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListDeploymentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#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 (*AgentClient) ListExamples
func (c *AgentClient) ListExamples(ctx context.Context, req *cespb.ListExamplesRequest, opts ...gax.CallOption) *ExampleIteratorListExamples lists examples in the given app.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
"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 := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListExamplesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#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.(*cespb.ListExamplesResponse)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListExamplesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#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 (*AgentClient) ListGuardrails
func (c *AgentClient) ListGuardrails(ctx context.Context, req *cespb.ListGuardrailsRequest, opts ...gax.CallOption) *GuardrailIteratorListGuardrails lists guardrails in the given app.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
"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 := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListGuardrailsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#ListGuardrailsRequest.
}
it := c.ListGuardrails(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.(*cespb.ListGuardrailsResponse)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListGuardrailsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#ListGuardrailsRequest.
}
for resp, err := range c.ListGuardrails(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AgentClient) ListLocations
func (c *AgentClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service.
This method lists locations based on the resource scope provided in the [ListLocationsRequest.name (at http://ListLocationsRequest.name)] field:
Global locations: If name is empty, the method lists the
public locations available to all projects. * Project-specific
locations: If name follows the format
projects/{project}, the method lists locations visible to that
specific project. This includes public, private, or other
project-specific locations enabled for the project.
For gRPC and client library implementations, the resource name is passed as the name field. For direct service calls, the resource name is incorporated into the request path based on the specific service implementation and version.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
"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 := ces.NewAgentClient(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)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewAgentClient(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 (*AgentClient) ListOperations
func (c *AgentClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewAgentClient(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)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewAgentClient(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 (*AgentClient) ListTools
func (c *AgentClient) ListTools(ctx context.Context, req *cespb.ListToolsRequest, opts ...gax.CallOption) *ToolIteratorListTools lists tools in the given app.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
"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 := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListToolsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#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.(*cespb.ListToolsResponse)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListToolsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#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 (*AgentClient) ListToolsets
func (c *AgentClient) ListToolsets(ctx context.Context, req *cespb.ListToolsetsRequest, opts ...gax.CallOption) *ToolsetIteratorListToolsets lists toolsets in the given app.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
"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 := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListToolsetsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#ListToolsetsRequest.
}
it := c.ListToolsets(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.(*cespb.ListToolsetsResponse)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListToolsetsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#ListToolsetsRequest.
}
for resp, err := range c.ListToolsets(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AgentClient) RestoreAppVersion
func (c *AgentClient) RestoreAppVersion(ctx context.Context, req *cespb.RestoreAppVersionRequest, opts ...gax.CallOption) (*RestoreAppVersionOperation, error)RestoreAppVersion restores the specified app version. This will create a new app version from the current draft app and overwrite the current draft with the specified app version.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.RestoreAppVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#RestoreAppVersionRequest.
}
op, err := c.RestoreAppVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) RestoreAppVersionOperation
func (c *AgentClient) RestoreAppVersionOperation(name string) *RestoreAppVersionOperationRestoreAppVersionOperation returns a new RestoreAppVersionOperation from a given name. The name must be that of a previously created RestoreAppVersionOperation, possibly from a different process.
func (*AgentClient) UpdateAgent
func (c *AgentClient) UpdateAgent(ctx context.Context, req *cespb.UpdateAgentRequest, opts ...gax.CallOption) (*cespb.Agent, error)UpdateAgent updates the specified agent.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.UpdateAgentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#UpdateAgentRequest.
}
resp, err := c.UpdateAgent(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) UpdateApp
func (c *AgentClient) UpdateApp(ctx context.Context, req *cespb.UpdateAppRequest, opts ...gax.CallOption) (*cespb.App, error)UpdateApp updates the specified app.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.UpdateAppRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#UpdateAppRequest.
}
resp, err := c.UpdateApp(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) UpdateDeployment
func (c *AgentClient) UpdateDeployment(ctx context.Context, req *cespb.UpdateDeploymentRequest, opts ...gax.CallOption) (*cespb.Deployment, error)UpdateDeployment updates the specified deployment.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.UpdateDeploymentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#UpdateDeploymentRequest.
}
resp, err := c.UpdateDeployment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) UpdateExample
func (c *AgentClient) UpdateExample(ctx context.Context, req *cespb.UpdateExampleRequest, opts ...gax.CallOption) (*cespb.Example, error)UpdateExample updates the specified example.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.UpdateExampleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#UpdateExampleRequest.
}
resp, err := c.UpdateExample(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) UpdateGuardrail
func (c *AgentClient) UpdateGuardrail(ctx context.Context, req *cespb.UpdateGuardrailRequest, opts ...gax.CallOption) (*cespb.Guardrail, error)UpdateGuardrail updates the specified guardrail.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.UpdateGuardrailRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#UpdateGuardrailRequest.
}
resp, err := c.UpdateGuardrail(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) UpdateTool
func (c *AgentClient) UpdateTool(ctx context.Context, req *cespb.UpdateToolRequest, opts ...gax.CallOption) (*cespb.Tool, error)UpdateTool updates the specified tool.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.UpdateToolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#UpdateToolRequest.
}
resp, err := c.UpdateTool(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) UpdateToolset
func (c *AgentClient) UpdateToolset(ctx context.Context, req *cespb.UpdateToolsetRequest, opts ...gax.CallOption) (*cespb.Toolset, error)UpdateToolset updates the specified toolset.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewAgentClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.UpdateToolsetRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#UpdateToolsetRequest.
}
resp, err := c.UpdateToolset(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
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 []*cespb.Agent, nextPageToken string, err error)
// contains filtered or unexported fields
}AgentIterator manages a stream of *cespb.Agent.
func (*AgentIterator) All
func (it *AgentIterator) All() iter.Seq2[*cespb.Agent, error]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() (*cespb.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.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
AppIterator
type AppIterator 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 []*cespb.App, nextPageToken string, err error)
// contains filtered or unexported fields
}AppIterator manages a stream of *cespb.App.
func (*AppIterator) All
func (it *AppIterator) All() iter.Seq2[*cespb.App, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*AppIterator) Next
func (it *AppIterator) Next() (*cespb.App, 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 (*AppIterator) PageInfo
func (it *AppIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
AppVersionIterator
type AppVersionIterator 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 []*cespb.AppVersion, nextPageToken string, err error)
// contains filtered or unexported fields
}AppVersionIterator manages a stream of *cespb.AppVersion.
func (*AppVersionIterator) All
func (it *AppVersionIterator) All() iter.Seq2[*cespb.AppVersion, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*AppVersionIterator) Next
func (it *AppVersionIterator) Next() (*cespb.AppVersion, 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 (*AppVersionIterator) PageInfo
func (it *AppVersionIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
BatchDeleteConversationsOperation
type BatchDeleteConversationsOperation struct {
// contains filtered or unexported fields
}BatchDeleteConversationsOperation manages a long-running operation from BatchDeleteConversations.
func (*BatchDeleteConversationsOperation) Done
func (op *BatchDeleteConversationsOperation) Done() boolDone reports whether the long-running operation has completed.
func (*BatchDeleteConversationsOperation) Metadata
func (op *BatchDeleteConversationsOperation) Metadata() (*cespb.OperationMetadata, error)Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*BatchDeleteConversationsOperation) Name
func (op *BatchDeleteConversationsOperation) Name() stringName 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 (*BatchDeleteConversationsOperation) Poll
func (op *BatchDeleteConversationsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cespb.BatchDeleteConversationsResponse, 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 (*BatchDeleteConversationsOperation) Wait
func (op *BatchDeleteConversationsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cespb.BatchDeleteConversationsResponse, 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.
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 []*cespb.Changelog, nextPageToken string, err error)
// contains filtered or unexported fields
}ChangelogIterator manages a stream of *cespb.Changelog.
func (*ChangelogIterator) All
func (it *ChangelogIterator) All() iter.Seq2[*cespb.Changelog, error]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() (*cespb.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.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
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 []*cespb.Conversation, nextPageToken string, err error)
// contains filtered or unexported fields
}ConversationIterator manages a stream of *cespb.Conversation.
func (*ConversationIterator) All
func (it *ConversationIterator) All() iter.Seq2[*cespb.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() (*cespb.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.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
CreateAppOperation
type CreateAppOperation struct {
// contains filtered or unexported fields
}CreateAppOperation manages a long-running operation from CreateApp.
func (*CreateAppOperation) Done
func (op *CreateAppOperation) Done() boolDone reports whether the long-running operation has completed.
func (*CreateAppOperation) Metadata
func (op *CreateAppOperation) Metadata() (*cespb.OperationMetadata, error)Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateAppOperation) Name
func (op *CreateAppOperation) Name() stringName 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 (*CreateAppOperation) Poll
func (op *CreateAppOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cespb.App, 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 (*CreateAppOperation) Wait
func (op *CreateAppOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cespb.App, 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.
DeleteAppOperation
type DeleteAppOperation struct {
// contains filtered or unexported fields
}DeleteAppOperation manages a long-running operation from DeleteApp.
func (*DeleteAppOperation) Done
func (op *DeleteAppOperation) Done() boolDone reports whether the long-running operation has completed.
func (*DeleteAppOperation) Metadata
func (op *DeleteAppOperation) Metadata() (*cespb.OperationMetadata, error)Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteAppOperation) Name
func (op *DeleteAppOperation) Name() stringName 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 (*DeleteAppOperation) Poll
func (op *DeleteAppOperation) Poll(ctx context.Context, opts ...gax.CallOption) errorPoll 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 (*DeleteAppOperation) Wait
func (op *DeleteAppOperation) Wait(ctx context.Context, opts ...gax.CallOption) errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
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 []*cespb.Deployment, nextPageToken string, err error)
// contains filtered or unexported fields
}DeploymentIterator manages a stream of *cespb.Deployment.
func (*DeploymentIterator) All
func (it *DeploymentIterator) All() iter.Seq2[*cespb.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() (*cespb.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.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
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 []*cespb.Example, nextPageToken string, err error)
// contains filtered or unexported fields
}ExampleIterator manages a stream of *cespb.Example.
func (*ExampleIterator) All
func (it *ExampleIterator) All() iter.Seq2[*cespb.Example, error]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() (*cespb.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.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ExportAppOperation
type ExportAppOperation struct {
// contains filtered or unexported fields
}ExportAppOperation manages a long-running operation from ExportApp.
func (*ExportAppOperation) Done
func (op *ExportAppOperation) Done() boolDone reports whether the long-running operation has completed.
func (*ExportAppOperation) Metadata
func (op *ExportAppOperation) Metadata() (*cespb.OperationMetadata, error)Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*ExportAppOperation) Name
func (op *ExportAppOperation) Name() stringName 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 (*ExportAppOperation) Poll
func (op *ExportAppOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cespb.ExportAppResponse, 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 (*ExportAppOperation) Wait
func (op *ExportAppOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cespb.ExportAppResponse, 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.
GuardrailIterator
type GuardrailIterator 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 []*cespb.Guardrail, nextPageToken string, err error)
// contains filtered or unexported fields
}GuardrailIterator manages a stream of *cespb.Guardrail.
func (*GuardrailIterator) All
func (it *GuardrailIterator) All() iter.Seq2[*cespb.Guardrail, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*GuardrailIterator) Next
func (it *GuardrailIterator) Next() (*cespb.Guardrail, 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 (*GuardrailIterator) PageInfo
func (it *GuardrailIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ImportAppOperation
type ImportAppOperation struct {
// contains filtered or unexported fields
}ImportAppOperation manages a long-running operation from ImportApp.
func (*ImportAppOperation) Done
func (op *ImportAppOperation) Done() boolDone reports whether the long-running operation has completed.
func (*ImportAppOperation) Metadata
func (op *ImportAppOperation) Metadata() (*cespb.OperationMetadata, error)Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*ImportAppOperation) Name
func (op *ImportAppOperation) Name() stringName 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 (*ImportAppOperation) Poll
func (op *ImportAppOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cespb.ImportAppResponse, 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 (*ImportAppOperation) Wait
func (op *ImportAppOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cespb.ImportAppResponse, error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
LocationIterator
type LocationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error)
// contains filtered or unexported fields
}LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator) 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.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
OperationIterator
type OperationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error)
// contains filtered or unexported fields
}OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) 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.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
RestoreAppVersionOperation
type RestoreAppVersionOperation struct {
// contains filtered or unexported fields
}RestoreAppVersionOperation manages a long-running operation from RestoreAppVersion.
func (*RestoreAppVersionOperation) Done
func (op *RestoreAppVersionOperation) Done() boolDone reports whether the long-running operation has completed.
func (*RestoreAppVersionOperation) Metadata
func (op *RestoreAppVersionOperation) Metadata() (*cespb.OperationMetadata, error)Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*RestoreAppVersionOperation) Name
func (op *RestoreAppVersionOperation) Name() stringName 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 (*RestoreAppVersionOperation) Poll
func (op *RestoreAppVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cespb.RestoreAppVersionResponse, 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 (*RestoreAppVersionOperation) Wait
func (op *RestoreAppVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cespb.RestoreAppVersionResponse, 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.
SessionCallOptions
type SessionCallOptions struct {
RunSession []gax.CallOption
StreamRunSession []gax.CallOption
BidiRunSession []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}SessionCallOptions contains the retry settings for each method of SessionClient.
SessionClient
type SessionClient struct {
// The call options for this service.
CallOptions *SessionCallOptions
// contains filtered or unexported fields
}SessionClient is a client for interacting with Gemini Enterprise for Customer Experience API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Session service provides APIs for interacting with CES agents.
func NewSessionClient
func NewSessionClient(ctx context.Context, opts ...option.ClientOption) (*SessionClient, error)NewSessionClient creates a new session service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Session service provides APIs for interacting with CES agents.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewSessionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewSessionRESTClient
func NewSessionRESTClient(ctx context.Context, opts ...option.ClientOption) (*SessionClient, error)NewSessionRESTClient creates a new session service rest client.
Session service provides APIs for interacting with CES agents.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewSessionRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*SessionClient) BidiRunSession
func (c *SessionClient) BidiRunSession(ctx context.Context, opts ...gax.CallOption) (cespb.SessionService_BidiRunSessionClient, error)BidiRunSession establishes a bidirectional streaming connection with the CES agent. The agent processes continuous multimodal inputs (e.g., text, audio) and generates real-time multimodal output streams.
— Client Request Stream — The client streams requests in the following order:
Initialization: The first message must contain SessionConfig. For audio sessions, this should also include InputAudioConfig and OutputAudioConfig to define audio processing and synthesis parameters.
Interaction: Subsequent messages stream SessionInput containing real-time user input data.
Termination: The client should half-close the stream when there is no more user input. It should also half-close upon receiving EndSession or GoAway from the agent.
— Server Response Stream — For each interaction turn, the agent streams messages in the following sequence:
Speech Recognition (First N messages): Contains RecognitionResult representing the concatenated user speech segments captured so far. This is only populated for audio sessions.
Response (Next M messages): Contains SessionOutput delivering the agent’s response in various modalities (e.g., text, audio).
Turn Completion (Final message of the turn): Contains SessionOutput with turn_completed set to true. This signals the end of the current turn and includes DiagnosticInfo with execution details.
— Audio Best Practices —
Streaming: Stream [audio data][google.cloud.ces.v1.SessionInput.audio (at http://google.cloud.ces.v1.SessionInput.audio)] CONTINUOUSLY, even during silence. Recommended chunk size: 40-120ms (balances latency vs. efficiency).
Playback & Interruption: Play [audio responses][google.cloud.ces.v1.SessionOutput.audio (at http://google.cloud.ces.v1.SessionOutput.audio)] upon receipt. Stop playback immediately if an InterruptionSignal is received (e.g., user barge-in or new agent response).
This method is not supported for the REST transport.
Example
package main
import (
"context"
"io"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewSessionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
stream, err := c.BidiRunSession(ctx)
if err != nil {
// TODO: Handle error.
}
go func() {
reqs := []*cespb.BidiSessionClientMessage{
// 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 (*SessionClient) CancelOperation
func (c *SessionClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewSessionClient(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 (*SessionClient) Close
func (c *SessionClient) Close() errorClose closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*SessionClient) Connection (deprecated)
func (c *SessionClient) Connection() *grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*SessionClient) DeleteOperation
func (c *SessionClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewSessionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*SessionClient) GetLocation
func (c *SessionClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewSessionClient(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 (*SessionClient) GetOperation
func (c *SessionClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)GetOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewSessionClient(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 (*SessionClient) ListLocations
func (c *SessionClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service.
This method lists locations based on the resource scope provided in the [ListLocationsRequest.name (at http://ListLocationsRequest.name)] field:
Global locations: If name is empty, the method lists the
public locations available to all projects. * Project-specific
locations: If name follows the format
projects/{project}, the method lists locations visible to that
specific project. This includes public, private, or other
project-specific locations enabled for the project.
For gRPC and client library implementations, the resource name is passed as the name field. For direct service calls, the resource name is incorporated into the request path based on the specific service implementation and version.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
"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 := ces.NewSessionClient(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)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewSessionClient(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 (*SessionClient) ListOperations
func (c *SessionClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewSessionClient(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)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewSessionClient(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 (*SessionClient) RunSession
func (c *SessionClient) RunSession(ctx context.Context, req *cespb.RunSessionRequest, opts ...gax.CallOption) (*cespb.RunSessionResponse, error)RunSession initiates a single-turn interaction with the CES agent within a session.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewSessionClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.RunSessionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#RunSessionRequest.
}
resp, err := c.RunSession(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*SessionClient) StreamRunSession
func (c *SessionClient) StreamRunSession(ctx context.Context, req *cespb.RunSessionRequest, opts ...gax.CallOption) (cespb.SessionService_StreamRunSessionClient, error)StreamRunSession initiates a single-turn interaction with the CES agent. Uses server-side streaming to deliver incremental results and partial responses as they are generated.
By default, complete responses (e.g., messages from callbacks or full LLM responses) are sent to the client as soon as they are available. To enable streaming individual text chunks directly from the model, set enable_text_streaming to true.
ToolCallOptions
type ToolCallOptions struct {
ExecuteTool []gax.CallOption
RetrieveToolSchema []gax.CallOption
RetrieveTools []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}ToolCallOptions contains the retry settings for each method of ToolClient.
ToolClient
type ToolClient struct {
// The call options for this service.
CallOptions *ToolCallOptions
// contains filtered or unexported fields
}ToolClient is a client for interacting with Gemini Enterprise for Customer Experience API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Tool service provides APIs for interacting with CES tools.
func NewToolClient
func NewToolClient(ctx context.Context, opts ...option.ClientOption) (*ToolClient, error)NewToolClient creates a new tool service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Tool service provides APIs for interacting with CES tools.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewToolClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewToolRESTClient
func NewToolRESTClient(ctx context.Context, opts ...option.ClientOption) (*ToolClient, error)NewToolRESTClient creates a new tool service rest client.
Tool service provides APIs for interacting with CES tools.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewToolRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ToolClient) CancelOperation
func (c *ToolClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewToolClient(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 (*ToolClient) Close
func (c *ToolClient) Close() errorClose closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ToolClient) Connection (deprecated)
func (c *ToolClient) Connection() *grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ToolClient) DeleteOperation
func (c *ToolClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewToolClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ToolClient) ExecuteTool
func (c *ToolClient) ExecuteTool(ctx context.Context, req *cespb.ExecuteToolRequest, opts ...gax.CallOption) (*cespb.ExecuteToolResponse, error)ExecuteTool executes the given tool with the given arguments.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewToolClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ExecuteToolRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#ExecuteToolRequest.
}
resp, err := c.ExecuteTool(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ToolClient) GetLocation
func (c *ToolClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewToolClient(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 (*ToolClient) GetOperation
func (c *ToolClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)GetOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewToolClient(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 (*ToolClient) ListLocations
func (c *ToolClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service.
This method lists locations based on the resource scope provided in the [ListLocationsRequest.name (at http://ListLocationsRequest.name)] field:
Global locations: If name is empty, the method lists the
public locations available to all projects. * Project-specific
locations: If name follows the format
projects/{project}, the method lists locations visible to that
specific project. This includes public, private, or other
project-specific locations enabled for the project.
For gRPC and client library implementations, the resource name is passed as the name field. For direct service calls, the resource name is incorporated into the request path based on the specific service implementation and version.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
"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 := ces.NewToolClient(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)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewToolClient(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 (*ToolClient) ListOperations
func (c *ToolClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewToolClient(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)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewToolClient(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 (*ToolClient) RetrieveToolSchema
func (c *ToolClient) RetrieveToolSchema(ctx context.Context, req *cespb.RetrieveToolSchemaRequest, opts ...gax.CallOption) (*cespb.RetrieveToolSchemaResponse, error)RetrieveToolSchema retrieve the schema of the given tool. The schema is computed on the fly for the given instance of the tool.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewToolClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.RetrieveToolSchemaRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#RetrieveToolSchemaRequest.
}
resp, err := c.RetrieveToolSchema(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ToolClient) RetrieveTools
func (c *ToolClient) RetrieveTools(ctx context.Context, req *cespb.RetrieveToolsRequest, opts ...gax.CallOption) (*cespb.RetrieveToolsResponse, error)RetrieveTools retrieve the list of tools included in the specified toolset.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewToolClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.RetrieveToolsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#RetrieveToolsRequest.
}
resp, err := c.RetrieveTools(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
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 []*cespb.Tool, nextPageToken string, err error)
// contains filtered or unexported fields
}ToolIterator manages a stream of *cespb.Tool.
func (*ToolIterator) All
func (it *ToolIterator) All() iter.Seq2[*cespb.Tool, error]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() (*cespb.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.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ToolsetIterator
type ToolsetIterator 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 []*cespb.Toolset, nextPageToken string, err error)
// contains filtered or unexported fields
}ToolsetIterator manages a stream of *cespb.Toolset.
func (*ToolsetIterator) All
func (it *ToolsetIterator) All() iter.Seq2[*cespb.Toolset, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ToolsetIterator) Next
func (it *ToolsetIterator) Next() (*cespb.Toolset, 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 (*ToolsetIterator) PageInfo
func (it *ToolsetIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
WidgetCallOptions
type WidgetCallOptions struct {
GenerateChatToken []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}WidgetCallOptions contains the retry settings for each method of WidgetClient.
WidgetClient
type WidgetClient struct {
// The call options for this service.
CallOptions *WidgetCallOptions
// contains filtered or unexported fields
}WidgetClient is a client for interacting with Gemini Enterprise for Customer Experience API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Provides APIs for widgets to interact with CES APIs.
func NewWidgetClient
func NewWidgetClient(ctx context.Context, opts ...option.ClientOption) (*WidgetClient, error)NewWidgetClient creates a new widget service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Provides APIs for widgets to interact with CES APIs.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewWidgetClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewWidgetRESTClient
func NewWidgetRESTClient(ctx context.Context, opts ...option.ClientOption) (*WidgetClient, error)NewWidgetRESTClient creates a new widget service rest client.
Provides APIs for widgets to interact with CES APIs.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewWidgetRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*WidgetClient) CancelOperation
func (c *WidgetClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewWidgetClient(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 (*WidgetClient) Close
func (c *WidgetClient) Close() errorClose closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*WidgetClient) Connection (deprecated)
func (c *WidgetClient) Connection() *grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*WidgetClient) DeleteOperation
func (c *WidgetClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewWidgetClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*WidgetClient) GenerateChatToken
func (c *WidgetClient) GenerateChatToken(ctx context.Context, req *cespb.GenerateChatTokenRequest, opts ...gax.CallOption) (*cespb.GenerateChatTokenResponse, error)GenerateChatToken generates a session scoped token for chat widget to authenticate with Session APIs.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
cespb "cloud.google.com/go/ces/apiv1/cespb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := ces.NewWidgetClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.GenerateChatTokenRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1/cespb#GenerateChatTokenRequest.
}
resp, err := c.GenerateChatToken(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*WidgetClient) GetLocation
func (c *WidgetClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewWidgetClient(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 (*WidgetClient) GetOperation
func (c *WidgetClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)GetOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewWidgetClient(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 (*WidgetClient) ListLocations
func (c *WidgetClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service.
This method lists locations based on the resource scope provided in the [ListLocationsRequest.name (at http://ListLocationsRequest.name)] field:
Global locations: If name is empty, the method lists the
public locations available to all projects. * Project-specific
locations: If name follows the format
projects/{project}, the method lists locations visible to that
specific project. This includes public, private, or other
project-specific locations enabled for the project.
For gRPC and client library implementations, the resource name is passed as the name field. For direct service calls, the resource name is incorporated into the request path based on the specific service implementation and version.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
"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 := ces.NewWidgetClient(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)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewWidgetClient(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 (*WidgetClient) ListOperations
func (c *WidgetClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewWidgetClient(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)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1"
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 := ces.NewWidgetClient(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
}
}