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/apiv1beta@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.NewSessionClient(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.
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 }
Use of Context
The ctx passed to NewSessionClient 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
GetSecuritySettings []gax.CallOption
UpdateSecuritySettings []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
GenerateAppResource []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/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require 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/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require 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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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) GenerateAppResource
func (c *AgentClient) GenerateAppResource(ctx context.Context, req *cespb.GenerateAppResourceRequest, opts ...gax.CallOption) (*GenerateAppResourceOperation, error)GenerateAppResource generates specific resources (e.g. agent) in the app using LLM assistant.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.GenerateAppResourceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#GenerateAppResourceRequest.
}
op, err := c.GenerateAppResource(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) GenerateAppResourceOperation
func (c *AgentClient) GenerateAppResourceOperation(name string) *GenerateAppResourceOperationGenerateAppResourceOperation returns a new GenerateAppResourceOperation from a given name. The name must be that of a previously created GenerateAppResourceOperation, 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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
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/apiv1beta"
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) GetSecuritySettings
func (c *AgentClient) GetSecuritySettings(ctx context.Context, req *cespb.GetSecuritySettingsRequest, opts ...gax.CallOption) (*cespb.SecuritySettings, error)GetSecuritySettings retrieves the security settings for the project and location.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.GetSecuritySettingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#GetSecuritySettingsRequest.
}
resp, err := c.GetSecuritySettings(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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
"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/apiv1beta"
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/apiv1beta"
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/apiv1beta"
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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/cespb#UpdateGuardrailRequest.
}
resp, err := c.UpdateGuardrail(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AgentClient) UpdateSecuritySettings
func (c *AgentClient) UpdateSecuritySettings(ctx context.Context, req *cespb.UpdateSecuritySettingsRequest, opts ...gax.CallOption) (*cespb.SecuritySettings, error)UpdateSecuritySettings updates the security settings for the project and location.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.UpdateSecuritySettingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#UpdateSecuritySettingsRequest.
}
resp, err := c.UpdateSecuritySettings(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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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.
DeleteEvaluationRunOperation
type DeleteEvaluationRunOperation struct {
// contains filtered or unexported fields
}DeleteEvaluationRunOperation manages a long-running operation from DeleteEvaluationRun.
func (*DeleteEvaluationRunOperation) Done
func (op *DeleteEvaluationRunOperation) Done() boolDone reports whether the long-running operation has completed.
func (*DeleteEvaluationRunOperation) Metadata
func (op *DeleteEvaluationRunOperation) Metadata() (*cespb.DeleteEvaluationRunOperationMetadata, 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 (*DeleteEvaluationRunOperation) Name
func (op *DeleteEvaluationRunOperation) 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 (*DeleteEvaluationRunOperation) Poll
func (op *DeleteEvaluationRunOperation) 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 (*DeleteEvaluationRunOperation) Wait
func (op *DeleteEvaluationRunOperation) 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.
EvaluationCallOptions
type EvaluationCallOptions struct {
RunEvaluation []gax.CallOption
UploadEvaluationAudio []gax.CallOption
CreateEvaluation []gax.CallOption
GenerateEvaluation []gax.CallOption
ImportEvaluations []gax.CallOption
CreateEvaluationDataset []gax.CallOption
UpdateEvaluation []gax.CallOption
UpdateEvaluationDataset []gax.CallOption
DeleteEvaluation []gax.CallOption
DeleteEvaluationResult []gax.CallOption
DeleteEvaluationDataset []gax.CallOption
DeleteEvaluationRun []gax.CallOption
GetEvaluation []gax.CallOption
GetEvaluationResult []gax.CallOption
GetEvaluationDataset []gax.CallOption
GetEvaluationRun []gax.CallOption
ListEvaluations []gax.CallOption
ListEvaluationResults []gax.CallOption
ListEvaluationDatasets []gax.CallOption
ListEvaluationRuns []gax.CallOption
ListEvaluationExpectations []gax.CallOption
GetEvaluationExpectation []gax.CallOption
CreateEvaluationExpectation []gax.CallOption
UpdateEvaluationExpectation []gax.CallOption
DeleteEvaluationExpectation []gax.CallOption
CreateScheduledEvaluationRun []gax.CallOption
GetScheduledEvaluationRun []gax.CallOption
ListScheduledEvaluationRuns []gax.CallOption
UpdateScheduledEvaluationRun []gax.CallOption
DeleteScheduledEvaluationRun []gax.CallOption
TestPersonaVoice []gax.CallOption
ExportEvaluations []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}EvaluationCallOptions contains the retry settings for each method of EvaluationClient.
EvaluationClient
type EvaluationClient struct {
// The call options for this service.
CallOptions *EvaluationCallOptions
// 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
}EvaluationClient 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.
EvaluationService exposes methods to perform evaluation for the CES app.
func NewEvaluationClient
func NewEvaluationClient(ctx context.Context, opts ...option.ClientOption) (*EvaluationClient, error)NewEvaluationClient creates a new evaluation service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
EvaluationService exposes methods to perform evaluation for the CES app.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require 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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewEvaluationRESTClient
func NewEvaluationRESTClient(ctx context.Context, opts ...option.ClientOption) (*EvaluationClient, error)NewEvaluationRESTClient creates a new evaluation service rest client.
EvaluationService exposes methods to perform evaluation for the CES app.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require 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.NewEvaluationRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*EvaluationClient) CancelOperation
func (c *EvaluationClient) 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/apiv1beta"
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.NewEvaluationClient(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 (*EvaluationClient) Close
func (c *EvaluationClient) Close() errorClose closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*EvaluationClient) Connection (deprecated)
func (c *EvaluationClient) 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 (*EvaluationClient) CreateEvaluation
func (c *EvaluationClient) CreateEvaluation(ctx context.Context, req *cespb.CreateEvaluationRequest, opts ...gax.CallOption) (*cespb.Evaluation, error)CreateEvaluation creates an evaluation.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.CreateEvaluationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#CreateEvaluationRequest.
}
resp, err := c.CreateEvaluation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) CreateEvaluationDataset
func (c *EvaluationClient) CreateEvaluationDataset(ctx context.Context, req *cespb.CreateEvaluationDatasetRequest, opts ...gax.CallOption) (*cespb.EvaluationDataset, error)CreateEvaluationDataset creates an evaluation dataset.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.CreateEvaluationDatasetRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#CreateEvaluationDatasetRequest.
}
resp, err := c.CreateEvaluationDataset(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) CreateEvaluationExpectation
func (c *EvaluationClient) CreateEvaluationExpectation(ctx context.Context, req *cespb.CreateEvaluationExpectationRequest, opts ...gax.CallOption) (*cespb.EvaluationExpectation, error)CreateEvaluationExpectation creates an evaluation expectation.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.CreateEvaluationExpectationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#CreateEvaluationExpectationRequest.
}
resp, err := c.CreateEvaluationExpectation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) CreateScheduledEvaluationRun
func (c *EvaluationClient) CreateScheduledEvaluationRun(ctx context.Context, req *cespb.CreateScheduledEvaluationRunRequest, opts ...gax.CallOption) (*cespb.ScheduledEvaluationRun, error)CreateScheduledEvaluationRun creates a scheduled evaluation run.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.CreateScheduledEvaluationRunRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#CreateScheduledEvaluationRunRequest.
}
resp, err := c.CreateScheduledEvaluationRun(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) DeleteEvaluation
func (c *EvaluationClient) DeleteEvaluation(ctx context.Context, req *cespb.DeleteEvaluationRequest, opts ...gax.CallOption) errorDeleteEvaluation deletes an evaluation.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.DeleteEvaluationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#DeleteEvaluationRequest.
}
err = c.DeleteEvaluation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*EvaluationClient) DeleteEvaluationDataset
func (c *EvaluationClient) DeleteEvaluationDataset(ctx context.Context, req *cespb.DeleteEvaluationDatasetRequest, opts ...gax.CallOption) errorDeleteEvaluationDataset deletes an evaluation dataset.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.DeleteEvaluationDatasetRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#DeleteEvaluationDatasetRequest.
}
err = c.DeleteEvaluationDataset(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*EvaluationClient) DeleteEvaluationExpectation
func (c *EvaluationClient) DeleteEvaluationExpectation(ctx context.Context, req *cespb.DeleteEvaluationExpectationRequest, opts ...gax.CallOption) errorDeleteEvaluationExpectation deletes an evaluation expectation.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.DeleteEvaluationExpectationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#DeleteEvaluationExpectationRequest.
}
err = c.DeleteEvaluationExpectation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*EvaluationClient) DeleteEvaluationResult
func (c *EvaluationClient) DeleteEvaluationResult(ctx context.Context, req *cespb.DeleteEvaluationResultRequest, opts ...gax.CallOption) errorDeleteEvaluationResult deletes an evaluation result.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.DeleteEvaluationResultRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#DeleteEvaluationResultRequest.
}
err = c.DeleteEvaluationResult(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*EvaluationClient) DeleteEvaluationRun
func (c *EvaluationClient) DeleteEvaluationRun(ctx context.Context, req *cespb.DeleteEvaluationRunRequest, opts ...gax.CallOption) (*DeleteEvaluationRunOperation, error)DeleteEvaluationRun deletes an evaluation run.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.DeleteEvaluationRunRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#DeleteEvaluationRunRequest.
}
op, err := c.DeleteEvaluationRun(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*EvaluationClient) DeleteEvaluationRunOperation
func (c *EvaluationClient) DeleteEvaluationRunOperation(name string) *DeleteEvaluationRunOperationDeleteEvaluationRunOperation returns a new DeleteEvaluationRunOperation from a given name. The name must be that of a previously created DeleteEvaluationRunOperation, possibly from a different process.
func (*EvaluationClient) DeleteOperation
func (c *EvaluationClient) 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/apiv1beta"
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.NewEvaluationClient(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 (*EvaluationClient) DeleteScheduledEvaluationRun
func (c *EvaluationClient) DeleteScheduledEvaluationRun(ctx context.Context, req *cespb.DeleteScheduledEvaluationRunRequest, opts ...gax.CallOption) errorDeleteScheduledEvaluationRun deletes a scheduled evaluation run.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.DeleteScheduledEvaluationRunRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#DeleteScheduledEvaluationRunRequest.
}
err = c.DeleteScheduledEvaluationRun(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*EvaluationClient) ExportEvaluations
func (c *EvaluationClient) ExportEvaluations(ctx context.Context, req *cespb.ExportEvaluationsRequest, opts ...gax.CallOption) (*ExportEvaluationsOperation, error)ExportEvaluations exports evaluations.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ExportEvaluationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#ExportEvaluationsRequest.
}
op, err := c.ExportEvaluations(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) ExportEvaluationsOperation
func (c *EvaluationClient) ExportEvaluationsOperation(name string) *ExportEvaluationsOperationExportEvaluationsOperation returns a new ExportEvaluationsOperation from a given name. The name must be that of a previously created ExportEvaluationsOperation, possibly from a different process.
func (*EvaluationClient) GenerateEvaluation
func (c *EvaluationClient) GenerateEvaluation(ctx context.Context, req *cespb.GenerateEvaluationRequest, opts ...gax.CallOption) (*GenerateEvaluationOperation, error)GenerateEvaluation creates a golden evaluation from a conversation.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.GenerateEvaluationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#GenerateEvaluationRequest.
}
op, err := c.GenerateEvaluation(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) GenerateEvaluationOperation
func (c *EvaluationClient) GenerateEvaluationOperation(name string) *GenerateEvaluationOperationGenerateEvaluationOperation returns a new GenerateEvaluationOperation from a given name. The name must be that of a previously created GenerateEvaluationOperation, possibly from a different process.
func (*EvaluationClient) GetEvaluation
func (c *EvaluationClient) GetEvaluation(ctx context.Context, req *cespb.GetEvaluationRequest, opts ...gax.CallOption) (*cespb.Evaluation, error)GetEvaluation gets details of the specified evaluation.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.GetEvaluationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#GetEvaluationRequest.
}
resp, err := c.GetEvaluation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) GetEvaluationDataset
func (c *EvaluationClient) GetEvaluationDataset(ctx context.Context, req *cespb.GetEvaluationDatasetRequest, opts ...gax.CallOption) (*cespb.EvaluationDataset, error)GetEvaluationDataset gets details of the specified evaluation dataset.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.GetEvaluationDatasetRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#GetEvaluationDatasetRequest.
}
resp, err := c.GetEvaluationDataset(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) GetEvaluationExpectation
func (c *EvaluationClient) GetEvaluationExpectation(ctx context.Context, req *cespb.GetEvaluationExpectationRequest, opts ...gax.CallOption) (*cespb.EvaluationExpectation, error)GetEvaluationExpectation gets details of the specified evaluation expectation.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.GetEvaluationExpectationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#GetEvaluationExpectationRequest.
}
resp, err := c.GetEvaluationExpectation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) GetEvaluationResult
func (c *EvaluationClient) GetEvaluationResult(ctx context.Context, req *cespb.GetEvaluationResultRequest, opts ...gax.CallOption) (*cespb.EvaluationResult, error)GetEvaluationResult gets details of the specified evaluation result.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.GetEvaluationResultRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#GetEvaluationResultRequest.
}
resp, err := c.GetEvaluationResult(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) GetEvaluationRun
func (c *EvaluationClient) GetEvaluationRun(ctx context.Context, req *cespb.GetEvaluationRunRequest, opts ...gax.CallOption) (*cespb.EvaluationRun, error)GetEvaluationRun gets details of the specified evaluation run.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.GetEvaluationRunRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#GetEvaluationRunRequest.
}
resp, err := c.GetEvaluationRun(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) GetLocation
func (c *EvaluationClient) 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/apiv1beta"
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.NewEvaluationClient(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 (*EvaluationClient) GetOperation
func (c *EvaluationClient) 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/apiv1beta"
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.NewEvaluationClient(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 (*EvaluationClient) GetScheduledEvaluationRun
func (c *EvaluationClient) GetScheduledEvaluationRun(ctx context.Context, req *cespb.GetScheduledEvaluationRunRequest, opts ...gax.CallOption) (*cespb.ScheduledEvaluationRun, error)GetScheduledEvaluationRun gets details of the specified scheduled evaluation run.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.GetScheduledEvaluationRunRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#GetScheduledEvaluationRunRequest.
}
resp, err := c.GetScheduledEvaluationRun(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) ImportEvaluations
func (c *EvaluationClient) ImportEvaluations(ctx context.Context, req *cespb.ImportEvaluationsRequest, opts ...gax.CallOption) (*ImportEvaluationsOperation, error)ImportEvaluations imports evaluations into the app.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ImportEvaluationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#ImportEvaluationsRequest.
}
op, err := c.ImportEvaluations(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) ImportEvaluationsOperation
func (c *EvaluationClient) ImportEvaluationsOperation(name string) *ImportEvaluationsOperationImportEvaluationsOperation returns a new ImportEvaluationsOperation from a given name. The name must be that of a previously created ImportEvaluationsOperation, possibly from a different process.
func (*EvaluationClient) ListEvaluationDatasets
func (c *EvaluationClient) ListEvaluationDatasets(ctx context.Context, req *cespb.ListEvaluationDatasetsRequest, opts ...gax.CallOption) *EvaluationDatasetIteratorListEvaluationDatasets lists all evaluation datasets in the given app.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListEvaluationDatasetsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#ListEvaluationDatasetsRequest.
}
it := c.ListEvaluationDatasets(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.ListEvaluationDatasetsResponse)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListEvaluationDatasetsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#ListEvaluationDatasetsRequest.
}
for resp, err := range c.ListEvaluationDatasets(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*EvaluationClient) ListEvaluationExpectations
func (c *EvaluationClient) ListEvaluationExpectations(ctx context.Context, req *cespb.ListEvaluationExpectationsRequest, opts ...gax.CallOption) *EvaluationExpectationIteratorListEvaluationExpectations lists all evaluation expectations in the given app.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListEvaluationExpectationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#ListEvaluationExpectationsRequest.
}
it := c.ListEvaluationExpectations(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.ListEvaluationExpectationsResponse)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListEvaluationExpectationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#ListEvaluationExpectationsRequest.
}
for resp, err := range c.ListEvaluationExpectations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*EvaluationClient) ListEvaluationResults
func (c *EvaluationClient) ListEvaluationResults(ctx context.Context, req *cespb.ListEvaluationResultsRequest, opts ...gax.CallOption) *EvaluationResultIteratorListEvaluationResults lists all evaluation results for a given evaluation.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListEvaluationResultsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#ListEvaluationResultsRequest.
}
it := c.ListEvaluationResults(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.ListEvaluationResultsResponse)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListEvaluationResultsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#ListEvaluationResultsRequest.
}
for resp, err := range c.ListEvaluationResults(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*EvaluationClient) ListEvaluationRuns
func (c *EvaluationClient) ListEvaluationRuns(ctx context.Context, req *cespb.ListEvaluationRunsRequest, opts ...gax.CallOption) *EvaluationRunIteratorListEvaluationRuns lists all evaluation runs in the given app.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListEvaluationRunsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#ListEvaluationRunsRequest.
}
it := c.ListEvaluationRuns(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.ListEvaluationRunsResponse)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListEvaluationRunsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#ListEvaluationRunsRequest.
}
for resp, err := range c.ListEvaluationRuns(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*EvaluationClient) ListEvaluations
func (c *EvaluationClient) ListEvaluations(ctx context.Context, req *cespb.ListEvaluationsRequest, opts ...gax.CallOption) *EvaluationIteratorListEvaluations lists all evaluations in the given app.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListEvaluationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#ListEvaluationsRequest.
}
it := c.ListEvaluations(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.ListEvaluationsResponse)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListEvaluationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#ListEvaluationsRequest.
}
for resp, err := range c.ListEvaluations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*EvaluationClient) ListLocations
func (c *EvaluationClient) 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/apiv1beta"
"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.NewEvaluationClient(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/apiv1beta"
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.NewEvaluationClient(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 (*EvaluationClient) ListOperations
func (c *EvaluationClient) 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/apiv1beta"
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.NewEvaluationClient(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/apiv1beta"
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.NewEvaluationClient(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 (*EvaluationClient) ListScheduledEvaluationRuns
func (c *EvaluationClient) ListScheduledEvaluationRuns(ctx context.Context, req *cespb.ListScheduledEvaluationRunsRequest, opts ...gax.CallOption) *ScheduledEvaluationRunIteratorListScheduledEvaluationRuns lists all scheduled evaluation runs in the given app.
Examples
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListScheduledEvaluationRunsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#ListScheduledEvaluationRunsRequest.
}
it := c.ListScheduledEvaluationRuns(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.ListScheduledEvaluationRunsResponse)
}
}
all
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.ListScheduledEvaluationRunsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#ListScheduledEvaluationRunsRequest.
}
for resp, err := range c.ListScheduledEvaluationRuns(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*EvaluationClient) RunEvaluation
func (c *EvaluationClient) RunEvaluation(ctx context.Context, req *cespb.RunEvaluationRequest, opts ...gax.CallOption) (*RunEvaluationOperation, error)RunEvaluation runs an evaluation of the app.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.RunEvaluationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#RunEvaluationRequest.
}
op, err := c.RunEvaluation(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) RunEvaluationOperation
func (c *EvaluationClient) RunEvaluationOperation(name string) *RunEvaluationOperationRunEvaluationOperation returns a new RunEvaluationOperation from a given name. The name must be that of a previously created RunEvaluationOperation, possibly from a different process.
func (*EvaluationClient) TestPersonaVoice
func (c *EvaluationClient) TestPersonaVoice(ctx context.Context, req *cespb.TestPersonaVoiceRequest, opts ...gax.CallOption) (*cespb.TestPersonaVoiceResponse, error)TestPersonaVoice tests the voice of a persona. Also accepts a default persona.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.TestPersonaVoiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#TestPersonaVoiceRequest.
}
resp, err := c.TestPersonaVoice(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) UpdateEvaluation
func (c *EvaluationClient) UpdateEvaluation(ctx context.Context, req *cespb.UpdateEvaluationRequest, opts ...gax.CallOption) (*cespb.Evaluation, error)UpdateEvaluation updates an evaluation.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.UpdateEvaluationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#UpdateEvaluationRequest.
}
resp, err := c.UpdateEvaluation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) UpdateEvaluationDataset
func (c *EvaluationClient) UpdateEvaluationDataset(ctx context.Context, req *cespb.UpdateEvaluationDatasetRequest, opts ...gax.CallOption) (*cespb.EvaluationDataset, error)UpdateEvaluationDataset updates an evaluation dataset.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.UpdateEvaluationDatasetRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#UpdateEvaluationDatasetRequest.
}
resp, err := c.UpdateEvaluationDataset(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) UpdateEvaluationExpectation
func (c *EvaluationClient) UpdateEvaluationExpectation(ctx context.Context, req *cespb.UpdateEvaluationExpectationRequest, opts ...gax.CallOption) (*cespb.EvaluationExpectation, error)UpdateEvaluationExpectation updates an evaluation expectation.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.UpdateEvaluationExpectationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#UpdateEvaluationExpectationRequest.
}
resp, err := c.UpdateEvaluationExpectation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) UpdateScheduledEvaluationRun
func (c *EvaluationClient) UpdateScheduledEvaluationRun(ctx context.Context, req *cespb.UpdateScheduledEvaluationRunRequest, opts ...gax.CallOption) (*cespb.ScheduledEvaluationRun, error)UpdateScheduledEvaluationRun updates a scheduled evaluation run.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.UpdateScheduledEvaluationRunRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#UpdateScheduledEvaluationRunRequest.
}
resp, err := c.UpdateScheduledEvaluationRun(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EvaluationClient) UploadEvaluationAudio
func (c *EvaluationClient) UploadEvaluationAudio(ctx context.Context, req *cespb.UploadEvaluationAudioRequest, opts ...gax.CallOption) (*cespb.UploadEvaluationAudioResponse, error)UploadEvaluationAudio uploads audio for use in Golden Evaluations. Stores the audio in the Cloud Storage bucket defined in ‘App.logging_settings.evaluation_audio_recording_config.gcs_bucket’ and returns a transcript.
Example
package main
import (
"context"
ces "cloud.google.com/go/ces/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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.NewEvaluationClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cespb.UploadEvaluationAudioRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/ces/apiv1beta/cespb#UploadEvaluationAudioRequest.
}
resp, err := c.UploadEvaluationAudio(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
EvaluationDatasetIterator
type EvaluationDatasetIterator 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.EvaluationDataset, nextPageToken string, err error)
// contains filtered or unexported fields
}EvaluationDatasetIterator manages a stream of *cespb.EvaluationDataset.
func (*EvaluationDatasetIterator) All
func (it *EvaluationDatasetIterator) All() iter.Seq2[*cespb.EvaluationDataset, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*EvaluationDatasetIterator) Next
func (it *EvaluationDatasetIterator) Next() (*cespb.EvaluationDataset, 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 (*EvaluationDatasetIterator) PageInfo
func (it *EvaluationDatasetIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
EvaluationExpectationIterator
type EvaluationExpectationIterator 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.EvaluationExpectation, nextPageToken string, err error)
// contains filtered or unexported fields
}EvaluationExpectationIterator manages a stream of *cespb.EvaluationExpectation.
func (*EvaluationExpectationIterator) All
func (it *EvaluationExpectationIterator) All() iter.Seq2[*cespb.EvaluationExpectation, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*EvaluationExpectationIterator) Next
func (it *EvaluationExpectationIterator) Next() (*cespb.EvaluationExpectation, 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 (*EvaluationExpectationIterator) PageInfo
func (it *EvaluationExpectationIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
EvaluationIterator
type EvaluationIterator 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.Evaluation, nextPageToken string, err error)
// contains filtered or unexported fields
}EvaluationIterator manages a stream of *cespb.Evaluation.
func (*EvaluationIterator) All
func (it *EvaluationIterator) All() iter.Seq2[*cespb.Evaluation, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*EvaluationIterator) Next
func (it *EvaluationIterator) Next() (*cespb.Evaluation, 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 (*EvaluationIterator) PageInfo
func (it *EvaluationIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
EvaluationResultIterator
type EvaluationResultIterator 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.EvaluationResult, nextPageToken string, err error)
// contains filtered or unexported fields
}EvaluationResultIterator manages a stream of *cespb.EvaluationResult.
func (*EvaluationResultIterator) All
func (it *EvaluationResultIterator) All() iter.Seq2[*cespb.EvaluationResult, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*EvaluationResultIterator) Next
func (it *EvaluationResultIterator) Next() (*cespb.EvaluationResult, 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 (*EvaluationResultIterator) PageInfo
func (it *EvaluationResultIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
EvaluationRunIterator
type EvaluationRunIterator 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.EvaluationRun, nextPageToken string, err error)
// contains filtered or unexported fields
}EvaluationRunIterator manages a stream of *cespb.EvaluationRun.
func (*EvaluationRunIterator) All
func (it *EvaluationRunIterator) All() iter.Seq2[*cespb.EvaluationRun, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*EvaluationRunIterator) Next
func (it *EvaluationRunIterator) Next() (*cespb.EvaluationRun, 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 (*EvaluationRunIterator) PageInfo
func (it *EvaluationRunIterator) 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.
ExportEvaluationsOperation
type ExportEvaluationsOperation struct {
// contains filtered or unexported fields
}ExportEvaluationsOperation manages a long-running operation from ExportEvaluations.
func (*ExportEvaluationsOperation) Done
func (op *ExportEvaluationsOperation) Done() boolDone reports whether the long-running operation has completed.
func (*ExportEvaluationsOperation) Metadata
func (op *ExportEvaluationsOperation) 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 (*ExportEvaluationsOperation) Name
func (op *ExportEvaluationsOperation) 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 (*ExportEvaluationsOperation) Poll
func (op *ExportEvaluationsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cespb.ExportEvaluationsResponse, 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 (*ExportEvaluationsOperation) Wait
func (op *ExportEvaluationsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cespb.ExportEvaluationsResponse, 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.
GenerateAppResourceOperation
type GenerateAppResourceOperation struct {
// contains filtered or unexported fields
}GenerateAppResourceOperation manages a long-running operation from GenerateAppResource.
func (*GenerateAppResourceOperation) Done
func (op *GenerateAppResourceOperation) Done() boolDone reports whether the long-running operation has completed.
func (*GenerateAppResourceOperation) Metadata
func (op *GenerateAppResourceOperation) Metadata() (*cespb.GenerateAppResourceOperationMetadata, 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 (*GenerateAppResourceOperation) Name
func (op *GenerateAppResourceOperation) 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 (*GenerateAppResourceOperation) Poll
func (op *GenerateAppResourceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cespb.GenerateAppResourceResponse, 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 (*GenerateAppResourceOperation) Wait
func (op *GenerateAppResourceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cespb.GenerateAppResourceResponse, 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.
GenerateEvaluationOperation
type GenerateEvaluationOperation struct {
// contains filtered or unexported fields
}GenerateEvaluationOperation manages a long-running operation from GenerateEvaluation.
func (*GenerateEvaluationOperation) Done
func (op *GenerateEvaluationOperation) Done() boolDone reports whether the long-running operation has completed.
func (*GenerateEvaluationOperation) Metadata
func (op *GenerateEvaluationOperation) Metadata() (*cespb.GenerateEvaluationOperationMetadata, 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 (*GenerateEvaluationOperation) Name
func (op *GenerateEvaluationOperation) 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 (*GenerateEvaluationOperation) Poll
func (op *GenerateEvaluationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cespb.Evaluation, 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 (*GenerateEvaluationOperation) Wait
func (op *GenerateEvaluationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cespb.Evaluation, 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.
ImportEvaluationsOperation
type ImportEvaluationsOperation struct {
// contains filtered or unexported fields
}ImportEvaluationsOperation manages a long-running operation from ImportEvaluations.
func (*ImportEvaluationsOperation) Done
func (op *ImportEvaluationsOperation) Done() boolDone reports whether the long-running operation has completed.
func (*ImportEvaluationsOperation) Metadata
func (op *ImportEvaluationsOperation) Metadata() (*cespb.ImportEvaluationsOperationMetadata, 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 (*ImportEvaluationsOperation) Name
func (op *ImportEvaluationsOperation) 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 (*ImportEvaluationsOperation) Poll
func (op *ImportEvaluationsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cespb.ImportEvaluationsResponse, 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 (*ImportEvaluationsOperation) Wait
func (op *ImportEvaluationsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cespb.ImportEvaluationsResponse, 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.
RunEvaluationOperation
type RunEvaluationOperation struct {
// contains filtered or unexported fields
}RunEvaluationOperation manages a long-running operation from RunEvaluation.
func (*RunEvaluationOperation) Done
func (op *RunEvaluationOperation) Done() boolDone reports whether the long-running operation has completed.
func (*RunEvaluationOperation) Metadata
func (op *RunEvaluationOperation) Metadata() (*cespb.RunEvaluationOperationMetadata, 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 (*RunEvaluationOperation) Name
func (op *RunEvaluationOperation) 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 (*RunEvaluationOperation) Poll
func (op *RunEvaluationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cespb.RunEvaluationResponse, 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 (*RunEvaluationOperation) Wait
func (op *RunEvaluationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cespb.RunEvaluationResponse, 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.
ScheduledEvaluationRunIterator
type ScheduledEvaluationRunIterator 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.ScheduledEvaluationRun, nextPageToken string, err error)
// contains filtered or unexported fields
}ScheduledEvaluationRunIterator manages a stream of *cespb.ScheduledEvaluationRun.
func (*ScheduledEvaluationRunIterator) All
func (it *ScheduledEvaluationRunIterator) All() iter.Seq2[*cespb.ScheduledEvaluationRun, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ScheduledEvaluationRunIterator) Next
func (it *ScheduledEvaluationRunIterator) Next() (*cespb.ScheduledEvaluationRun, 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 (*ScheduledEvaluationRunIterator) PageInfo
func (it *ScheduledEvaluationRunIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
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/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require 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/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require 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.v1beta.SessionInput.audio (at http://google.cloud.ces.v1beta.SessionInput.audio)] CONTINUOUSLY, even during silence. Recommended chunk size: 40-120ms (balances latency vs. efficiency).
Playback & Interruption: Play [audio responses][google.cloud.ces.v1beta.SessionOutput.audio (at http://google.cloud.ces.v1beta.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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta"
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/apiv1beta"
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/apiv1beta"
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/apiv1beta"
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/apiv1beta"
"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/apiv1beta"
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/apiv1beta"
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/apiv1beta"
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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require 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/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require 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/apiv1beta"
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/apiv1beta"
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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
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/apiv1beta"
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/apiv1beta"
"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/apiv1beta"
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/apiv1beta"
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/apiv1beta"
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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require 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/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require 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/apiv1beta"
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/apiv1beta"
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/apiv1beta"
cespb "cloud.google.com/go/ces/apiv1beta/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/apiv1beta/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/apiv1beta"
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/apiv1beta"
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/apiv1beta"
"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/apiv1beta"
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/apiv1beta"
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/apiv1beta"
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
}
}