Documentation
¶
Overview ¶
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.
Index ¶
- func DefaultAuthScopes() []string
- type AgentCallOptions
- type AgentClient
- func (c *AgentClient) BatchDeleteConversations(ctx context.Context, req *cespb.BatchDeleteConversationsRequest, ...) (*BatchDeleteConversationsOperation, error)
- func (c *AgentClient) BatchDeleteConversationsOperation(name string) *BatchDeleteConversationsOperation
- func (c *AgentClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *AgentClient) Close() error
- func (c *AgentClient) Connection() *grpc.ClientConndeprecated
- func (c *AgentClient) CreateAgent(ctx context.Context, req *cespb.CreateAgentRequest, opts ...gax.CallOption) (*cespb.Agent, error)
- func (c *AgentClient) CreateApp(ctx context.Context, req *cespb.CreateAppRequest, opts ...gax.CallOption) (*CreateAppOperation, error)
- func (c *AgentClient) CreateAppOperation(name string) *CreateAppOperation
- func (c *AgentClient) CreateAppVersion(ctx context.Context, req *cespb.CreateAppVersionRequest, ...) (*cespb.AppVersion, error)
- func (c *AgentClient) CreateDeployment(ctx context.Context, req *cespb.CreateDeploymentRequest, ...) (*cespb.Deployment, error)
- func (c *AgentClient) CreateExample(ctx context.Context, req *cespb.CreateExampleRequest, opts ...gax.CallOption) (*cespb.Example, error)
- func (c *AgentClient) CreateGuardrail(ctx context.Context, req *cespb.CreateGuardrailRequest, opts ...gax.CallOption) (*cespb.Guardrail, error)
- func (c *AgentClient) CreateTool(ctx context.Context, req *cespb.CreateToolRequest, opts ...gax.CallOption) (*cespb.Tool, error)
- func (c *AgentClient) CreateToolset(ctx context.Context, req *cespb.CreateToolsetRequest, opts ...gax.CallOption) (*cespb.Toolset, error)
- func (c *AgentClient) DeleteAgent(ctx context.Context, req *cespb.DeleteAgentRequest, opts ...gax.CallOption) error
- func (c *AgentClient) DeleteApp(ctx context.Context, req *cespb.DeleteAppRequest, opts ...gax.CallOption) (*DeleteAppOperation, error)
- func (c *AgentClient) DeleteAppOperation(name string) *DeleteAppOperation
- func (c *AgentClient) DeleteAppVersion(ctx context.Context, req *cespb.DeleteAppVersionRequest, ...) error
- func (c *AgentClient) DeleteConversation(ctx context.Context, req *cespb.DeleteConversationRequest, ...) error
- func (c *AgentClient) DeleteDeployment(ctx context.Context, req *cespb.DeleteDeploymentRequest, ...) error
- func (c *AgentClient) DeleteExample(ctx context.Context, req *cespb.DeleteExampleRequest, opts ...gax.CallOption) error
- func (c *AgentClient) DeleteGuardrail(ctx context.Context, req *cespb.DeleteGuardrailRequest, opts ...gax.CallOption) error
- func (c *AgentClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *AgentClient) DeleteTool(ctx context.Context, req *cespb.DeleteToolRequest, opts ...gax.CallOption) error
- func (c *AgentClient) DeleteToolset(ctx context.Context, req *cespb.DeleteToolsetRequest, opts ...gax.CallOption) error
- func (c *AgentClient) ExportApp(ctx context.Context, req *cespb.ExportAppRequest, opts ...gax.CallOption) (*ExportAppOperation, error)
- func (c *AgentClient) ExportAppOperation(name string) *ExportAppOperation
- func (c *AgentClient) GetAgent(ctx context.Context, req *cespb.GetAgentRequest, opts ...gax.CallOption) (*cespb.Agent, error)
- func (c *AgentClient) GetApp(ctx context.Context, req *cespb.GetAppRequest, opts ...gax.CallOption) (*cespb.App, error)
- func (c *AgentClient) GetAppVersion(ctx context.Context, req *cespb.GetAppVersionRequest, opts ...gax.CallOption) (*cespb.AppVersion, error)
- func (c *AgentClient) GetChangelog(ctx context.Context, req *cespb.GetChangelogRequest, opts ...gax.CallOption) (*cespb.Changelog, error)
- func (c *AgentClient) GetConversation(ctx context.Context, req *cespb.GetConversationRequest, opts ...gax.CallOption) (*cespb.Conversation, error)
- func (c *AgentClient) GetDeployment(ctx context.Context, req *cespb.GetDeploymentRequest, opts ...gax.CallOption) (*cespb.Deployment, error)
- func (c *AgentClient) GetExample(ctx context.Context, req *cespb.GetExampleRequest, opts ...gax.CallOption) (*cespb.Example, error)
- func (c *AgentClient) GetGuardrail(ctx context.Context, req *cespb.GetGuardrailRequest, opts ...gax.CallOption) (*cespb.Guardrail, error)
- func (c *AgentClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *AgentClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *AgentClient) GetSecuritySettings(ctx context.Context, req *cespb.GetSecuritySettingsRequest, ...) (*cespb.SecuritySettings, error)
- func (c *AgentClient) GetTool(ctx context.Context, req *cespb.GetToolRequest, opts ...gax.CallOption) (*cespb.Tool, error)
- func (c *AgentClient) GetToolset(ctx context.Context, req *cespb.GetToolsetRequest, opts ...gax.CallOption) (*cespb.Toolset, error)
- func (c *AgentClient) ImportApp(ctx context.Context, req *cespb.ImportAppRequest, opts ...gax.CallOption) (*ImportAppOperation, error)
- func (c *AgentClient) ImportAppOperation(name string) *ImportAppOperation
- func (c *AgentClient) ListAgents(ctx context.Context, req *cespb.ListAgentsRequest, opts ...gax.CallOption) *AgentIterator
- func (c *AgentClient) ListAppVersions(ctx context.Context, req *cespb.ListAppVersionsRequest, opts ...gax.CallOption) *AppVersionIterator
- func (c *AgentClient) ListApps(ctx context.Context, req *cespb.ListAppsRequest, opts ...gax.CallOption) *AppIterator
- func (c *AgentClient) ListChangelogs(ctx context.Context, req *cespb.ListChangelogsRequest, opts ...gax.CallOption) *ChangelogIterator
- func (c *AgentClient) ListConversations(ctx context.Context, req *cespb.ListConversationsRequest, ...) *ConversationIterator
- func (c *AgentClient) ListDeployments(ctx context.Context, req *cespb.ListDeploymentsRequest, opts ...gax.CallOption) *DeploymentIterator
- func (c *AgentClient) ListExamples(ctx context.Context, req *cespb.ListExamplesRequest, opts ...gax.CallOption) *ExampleIterator
- func (c *AgentClient) ListGuardrails(ctx context.Context, req *cespb.ListGuardrailsRequest, opts ...gax.CallOption) *GuardrailIterator
- func (c *AgentClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *AgentClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *AgentClient) ListTools(ctx context.Context, req *cespb.ListToolsRequest, opts ...gax.CallOption) *ToolIterator
- func (c *AgentClient) ListToolsets(ctx context.Context, req *cespb.ListToolsetsRequest, opts ...gax.CallOption) *ToolsetIterator
- func (c *AgentClient) RestoreAppVersion(ctx context.Context, req *cespb.RestoreAppVersionRequest, ...) (*RestoreAppVersionOperation, error)
- func (c *AgentClient) RestoreAppVersionOperation(name string) *RestoreAppVersionOperation
- func (c *AgentClient) UpdateAgent(ctx context.Context, req *cespb.UpdateAgentRequest, opts ...gax.CallOption) (*cespb.Agent, error)
- func (c *AgentClient) UpdateApp(ctx context.Context, req *cespb.UpdateAppRequest, opts ...gax.CallOption) (*cespb.App, error)
- func (c *AgentClient) UpdateDeployment(ctx context.Context, req *cespb.UpdateDeploymentRequest, ...) (*cespb.Deployment, error)
- func (c *AgentClient) UpdateExample(ctx context.Context, req *cespb.UpdateExampleRequest, opts ...gax.CallOption) (*cespb.Example, error)
- func (c *AgentClient) UpdateGuardrail(ctx context.Context, req *cespb.UpdateGuardrailRequest, opts ...gax.CallOption) (*cespb.Guardrail, error)
- func (c *AgentClient) UpdateSecuritySettings(ctx context.Context, req *cespb.UpdateSecuritySettingsRequest, ...) (*cespb.SecuritySettings, error)
- func (c *AgentClient) UpdateTool(ctx context.Context, req *cespb.UpdateToolRequest, opts ...gax.CallOption) (*cespb.Tool, error)
- func (c *AgentClient) UpdateToolset(ctx context.Context, req *cespb.UpdateToolsetRequest, opts ...gax.CallOption) (*cespb.Toolset, error)
- type AgentIterator
- type AppIterator
- type AppVersionIterator
- type BatchDeleteConversationsOperation
- func (op *BatchDeleteConversationsOperation) Done() bool
- func (op *BatchDeleteConversationsOperation) Metadata() (*cespb.OperationMetadata, error)
- func (op *BatchDeleteConversationsOperation) Name() string
- func (op *BatchDeleteConversationsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cespb.BatchDeleteConversationsResponse, error)
- func (op *BatchDeleteConversationsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cespb.BatchDeleteConversationsResponse, error)
- type ChangelogIterator
- type ConversationIterator
- type CreateAppOperation
- func (op *CreateAppOperation) Done() bool
- func (op *CreateAppOperation) Metadata() (*cespb.OperationMetadata, error)
- func (op *CreateAppOperation) Name() string
- func (op *CreateAppOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cespb.App, error)
- func (op *CreateAppOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cespb.App, error)
- type DeleteAppOperation
- func (op *DeleteAppOperation) Done() bool
- func (op *DeleteAppOperation) Metadata() (*cespb.OperationMetadata, error)
- func (op *DeleteAppOperation) Name() string
- func (op *DeleteAppOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteAppOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DeleteEvaluationRunOperation
- func (op *DeleteEvaluationRunOperation) Done() bool
- func (op *DeleteEvaluationRunOperation) Metadata() (*cespb.DeleteEvaluationRunOperationMetadata, error)
- func (op *DeleteEvaluationRunOperation) Name() string
- func (op *DeleteEvaluationRunOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteEvaluationRunOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DeploymentIterator
- type EvaluationCallOptions
- type EvaluationClient
- func (c *EvaluationClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *EvaluationClient) Close() error
- func (c *EvaluationClient) Connection() *grpc.ClientConndeprecated
- func (c *EvaluationClient) CreateEvaluation(ctx context.Context, req *cespb.CreateEvaluationRequest, ...) (*cespb.Evaluation, error)
- func (c *EvaluationClient) CreateEvaluationDataset(ctx context.Context, req *cespb.CreateEvaluationDatasetRequest, ...) (*cespb.EvaluationDataset, error)
- func (c *EvaluationClient) CreateEvaluationExpectation(ctx context.Context, req *cespb.CreateEvaluationExpectationRequest, ...) (*cespb.EvaluationExpectation, error)
- func (c *EvaluationClient) CreateScheduledEvaluationRun(ctx context.Context, req *cespb.CreateScheduledEvaluationRunRequest, ...) (*cespb.ScheduledEvaluationRun, error)
- func (c *EvaluationClient) DeleteEvaluation(ctx context.Context, req *cespb.DeleteEvaluationRequest, ...) error
- func (c *EvaluationClient) DeleteEvaluationDataset(ctx context.Context, req *cespb.DeleteEvaluationDatasetRequest, ...) error
- func (c *EvaluationClient) DeleteEvaluationExpectation(ctx context.Context, req *cespb.DeleteEvaluationExpectationRequest, ...) error
- func (c *EvaluationClient) DeleteEvaluationResult(ctx context.Context, req *cespb.DeleteEvaluationResultRequest, ...) error
- func (c *EvaluationClient) DeleteEvaluationRun(ctx context.Context, req *cespb.DeleteEvaluationRunRequest, ...) (*DeleteEvaluationRunOperation, error)
- func (c *EvaluationClient) DeleteEvaluationRunOperation(name string) *DeleteEvaluationRunOperation
- func (c *EvaluationClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *EvaluationClient) DeleteScheduledEvaluationRun(ctx context.Context, req *cespb.DeleteScheduledEvaluationRunRequest, ...) error
- func (c *EvaluationClient) GenerateEvaluation(ctx context.Context, req *cespb.GenerateEvaluationRequest, ...) (*GenerateEvaluationOperation, error)
- func (c *EvaluationClient) GenerateEvaluationOperation(name string) *GenerateEvaluationOperation
- func (c *EvaluationClient) GetEvaluation(ctx context.Context, req *cespb.GetEvaluationRequest, opts ...gax.CallOption) (*cespb.Evaluation, error)
- func (c *EvaluationClient) GetEvaluationDataset(ctx context.Context, req *cespb.GetEvaluationDatasetRequest, ...) (*cespb.EvaluationDataset, error)
- func (c *EvaluationClient) GetEvaluationExpectation(ctx context.Context, req *cespb.GetEvaluationExpectationRequest, ...) (*cespb.EvaluationExpectation, error)
- func (c *EvaluationClient) GetEvaluationResult(ctx context.Context, req *cespb.GetEvaluationResultRequest, ...) (*cespb.EvaluationResult, error)
- func (c *EvaluationClient) GetEvaluationRun(ctx context.Context, req *cespb.GetEvaluationRunRequest, ...) (*cespb.EvaluationRun, error)
- func (c *EvaluationClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *EvaluationClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *EvaluationClient) GetScheduledEvaluationRun(ctx context.Context, req *cespb.GetScheduledEvaluationRunRequest, ...) (*cespb.ScheduledEvaluationRun, error)
- func (c *EvaluationClient) ImportEvaluations(ctx context.Context, req *cespb.ImportEvaluationsRequest, ...) (*ImportEvaluationsOperation, error)
- func (c *EvaluationClient) ImportEvaluationsOperation(name string) *ImportEvaluationsOperation
- func (c *EvaluationClient) ListEvaluationDatasets(ctx context.Context, req *cespb.ListEvaluationDatasetsRequest, ...) *EvaluationDatasetIterator
- func (c *EvaluationClient) ListEvaluationExpectations(ctx context.Context, req *cespb.ListEvaluationExpectationsRequest, ...) *EvaluationExpectationIterator
- func (c *EvaluationClient) ListEvaluationResults(ctx context.Context, req *cespb.ListEvaluationResultsRequest, ...) *EvaluationResultIterator
- func (c *EvaluationClient) ListEvaluationRuns(ctx context.Context, req *cespb.ListEvaluationRunsRequest, ...) *EvaluationRunIterator
- func (c *EvaluationClient) ListEvaluations(ctx context.Context, req *cespb.ListEvaluationsRequest, opts ...gax.CallOption) *EvaluationIterator
- func (c *EvaluationClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *EvaluationClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *EvaluationClient) ListScheduledEvaluationRuns(ctx context.Context, req *cespb.ListScheduledEvaluationRunsRequest, ...) *ScheduledEvaluationRunIterator
- func (c *EvaluationClient) RunEvaluation(ctx context.Context, req *cespb.RunEvaluationRequest, opts ...gax.CallOption) (*RunEvaluationOperation, error)
- func (c *EvaluationClient) RunEvaluationOperation(name string) *RunEvaluationOperation
- func (c *EvaluationClient) TestPersonaVoice(ctx context.Context, req *cespb.TestPersonaVoiceRequest, ...) (*cespb.TestPersonaVoiceResponse, error)
- func (c *EvaluationClient) UpdateEvaluation(ctx context.Context, req *cespb.UpdateEvaluationRequest, ...) (*cespb.Evaluation, error)
- func (c *EvaluationClient) UpdateEvaluationDataset(ctx context.Context, req *cespb.UpdateEvaluationDatasetRequest, ...) (*cespb.EvaluationDataset, error)
- func (c *EvaluationClient) UpdateEvaluationExpectation(ctx context.Context, req *cespb.UpdateEvaluationExpectationRequest, ...) (*cespb.EvaluationExpectation, error)
- func (c *EvaluationClient) UpdateScheduledEvaluationRun(ctx context.Context, req *cespb.UpdateScheduledEvaluationRunRequest, ...) (*cespb.ScheduledEvaluationRun, error)
- func (c *EvaluationClient) UploadEvaluationAudio(ctx context.Context, req *cespb.UploadEvaluationAudioRequest, ...) (*cespb.UploadEvaluationAudioResponse, error)
- type EvaluationDatasetIterator
- type EvaluationExpectationIterator
- type EvaluationIterator
- type EvaluationResultIterator
- type EvaluationRunIterator
- type ExampleIterator
- type ExportAppOperation
- func (op *ExportAppOperation) Done() bool
- func (op *ExportAppOperation) Metadata() (*cespb.OperationMetadata, error)
- func (op *ExportAppOperation) Name() string
- func (op *ExportAppOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cespb.ExportAppResponse, error)
- func (op *ExportAppOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cespb.ExportAppResponse, error)
- type GenerateEvaluationOperation
- func (op *GenerateEvaluationOperation) Done() bool
- func (op *GenerateEvaluationOperation) Metadata() (*cespb.GenerateEvaluationOperationMetadata, error)
- func (op *GenerateEvaluationOperation) Name() string
- func (op *GenerateEvaluationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cespb.Evaluation, error)
- func (op *GenerateEvaluationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cespb.Evaluation, error)
- type GuardrailIterator
- type ImportAppOperation
- func (op *ImportAppOperation) Done() bool
- func (op *ImportAppOperation) Metadata() (*cespb.OperationMetadata, error)
- func (op *ImportAppOperation) Name() string
- func (op *ImportAppOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cespb.ImportAppResponse, error)
- func (op *ImportAppOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cespb.ImportAppResponse, error)
- type ImportEvaluationsOperation
- func (op *ImportEvaluationsOperation) Done() bool
- func (op *ImportEvaluationsOperation) Metadata() (*cespb.ImportEvaluationsOperationMetadata, error)
- func (op *ImportEvaluationsOperation) Name() string
- func (op *ImportEvaluationsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cespb.ImportEvaluationsResponse, error)
- func (op *ImportEvaluationsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cespb.ImportEvaluationsResponse, error)
- type LocationIterator
- type OperationIterator
- type RestoreAppVersionOperation
- func (op *RestoreAppVersionOperation) Done() bool
- func (op *RestoreAppVersionOperation) Metadata() (*cespb.OperationMetadata, error)
- func (op *RestoreAppVersionOperation) Name() string
- func (op *RestoreAppVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cespb.RestoreAppVersionResponse, error)
- func (op *RestoreAppVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cespb.RestoreAppVersionResponse, error)
- type RunEvaluationOperation
- func (op *RunEvaluationOperation) Done() bool
- func (op *RunEvaluationOperation) Metadata() (*cespb.RunEvaluationOperationMetadata, error)
- func (op *RunEvaluationOperation) Name() string
- func (op *RunEvaluationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cespb.RunEvaluationResponse, error)
- func (op *RunEvaluationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*cespb.RunEvaluationResponse, error)
- type ScheduledEvaluationRunIterator
- type SessionCallOptions
- type SessionClient
- func (c *SessionClient) BidiRunSession(ctx context.Context, opts ...gax.CallOption) (cespb.SessionService_BidiRunSessionClient, error)
- func (c *SessionClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *SessionClient) Close() error
- func (c *SessionClient) Connection() *grpc.ClientConndeprecated
- func (c *SessionClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *SessionClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *SessionClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *SessionClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *SessionClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *SessionClient) RunSession(ctx context.Context, req *cespb.RunSessionRequest, opts ...gax.CallOption) (*cespb.RunSessionResponse, error)
- type ToolCallOptions
- type ToolClient
- func (c *ToolClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *ToolClient) Close() error
- func (c *ToolClient) Connection() *grpc.ClientConndeprecated
- func (c *ToolClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *ToolClient) ExecuteTool(ctx context.Context, req *cespb.ExecuteToolRequest, opts ...gax.CallOption) (*cespb.ExecuteToolResponse, error)
- func (c *ToolClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *ToolClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *ToolClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *ToolClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *ToolClient) RetrieveToolSchema(ctx context.Context, req *cespb.RetrieveToolSchemaRequest, ...) (*cespb.RetrieveToolSchemaResponse, error)
- func (c *ToolClient) RetrieveTools(ctx context.Context, req *cespb.RetrieveToolsRequest, opts ...gax.CallOption) (*cespb.RetrieveToolsResponse, error)
- type ToolIterator
- type ToolsetIterator
- type WidgetCallOptions
- type WidgetClient
- func (c *WidgetClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *WidgetClient) Close() error
- func (c *WidgetClient) Connection() *grpc.ClientConndeprecated
- func (c *WidgetClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *WidgetClient) GenerateChatToken(ctx context.Context, req *cespb.GenerateChatTokenRequest, ...) (*cespb.GenerateChatTokenResponse, error)
- func (c *WidgetClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *WidgetClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *WidgetClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *WidgetClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
Examples ¶
- AgentClient.BatchDeleteConversations
- AgentClient.CancelOperation
- AgentClient.CreateAgent
- AgentClient.CreateApp
- AgentClient.CreateAppVersion
- AgentClient.CreateDeployment
- AgentClient.CreateExample
- AgentClient.CreateGuardrail
- AgentClient.CreateTool
- AgentClient.CreateToolset
- AgentClient.DeleteAgent
- AgentClient.DeleteApp
- AgentClient.DeleteAppVersion
- AgentClient.DeleteConversation
- AgentClient.DeleteDeployment
- AgentClient.DeleteExample
- AgentClient.DeleteGuardrail
- AgentClient.DeleteOperation
- AgentClient.DeleteTool
- AgentClient.DeleteToolset
- AgentClient.ExportApp
- AgentClient.GetAgent
- AgentClient.GetApp
- AgentClient.GetAppVersion
- AgentClient.GetChangelog
- AgentClient.GetConversation
- AgentClient.GetDeployment
- AgentClient.GetExample
- AgentClient.GetGuardrail
- AgentClient.GetLocation
- AgentClient.GetOperation
- AgentClient.GetSecuritySettings
- AgentClient.GetTool
- AgentClient.GetToolset
- AgentClient.ImportApp
- AgentClient.ListAgents
- AgentClient.ListAgents (All)
- AgentClient.ListAppVersions
- AgentClient.ListAppVersions (All)
- AgentClient.ListApps
- AgentClient.ListApps (All)
- AgentClient.ListChangelogs
- AgentClient.ListChangelogs (All)
- AgentClient.ListConversations
- AgentClient.ListConversations (All)
- AgentClient.ListDeployments
- AgentClient.ListDeployments (All)
- AgentClient.ListExamples
- AgentClient.ListExamples (All)
- AgentClient.ListGuardrails
- AgentClient.ListGuardrails (All)
- AgentClient.ListLocations
- AgentClient.ListLocations (All)
- AgentClient.ListOperations
- AgentClient.ListOperations (All)
- AgentClient.ListTools
- AgentClient.ListTools (All)
- AgentClient.ListToolsets
- AgentClient.ListToolsets (All)
- AgentClient.RestoreAppVersion
- AgentClient.UpdateAgent
- AgentClient.UpdateApp
- AgentClient.UpdateDeployment
- AgentClient.UpdateExample
- AgentClient.UpdateGuardrail
- AgentClient.UpdateSecuritySettings
- AgentClient.UpdateTool
- AgentClient.UpdateToolset
- EvaluationClient.CancelOperation
- EvaluationClient.CreateEvaluation
- EvaluationClient.CreateEvaluationDataset
- EvaluationClient.CreateEvaluationExpectation
- EvaluationClient.CreateScheduledEvaluationRun
- EvaluationClient.DeleteEvaluation
- EvaluationClient.DeleteEvaluationDataset
- EvaluationClient.DeleteEvaluationExpectation
- EvaluationClient.DeleteEvaluationResult
- EvaluationClient.DeleteEvaluationRun
- EvaluationClient.DeleteOperation
- EvaluationClient.DeleteScheduledEvaluationRun
- EvaluationClient.GenerateEvaluation
- EvaluationClient.GetEvaluation
- EvaluationClient.GetEvaluationDataset
- EvaluationClient.GetEvaluationExpectation
- EvaluationClient.GetEvaluationResult
- EvaluationClient.GetEvaluationRun
- EvaluationClient.GetLocation
- EvaluationClient.GetOperation
- EvaluationClient.GetScheduledEvaluationRun
- EvaluationClient.ImportEvaluations
- EvaluationClient.ListEvaluationDatasets
- EvaluationClient.ListEvaluationDatasets (All)
- EvaluationClient.ListEvaluationExpectations
- EvaluationClient.ListEvaluationExpectations (All)
- EvaluationClient.ListEvaluationResults
- EvaluationClient.ListEvaluationResults (All)
- EvaluationClient.ListEvaluationRuns
- EvaluationClient.ListEvaluationRuns (All)
- EvaluationClient.ListEvaluations
- EvaluationClient.ListEvaluations (All)
- EvaluationClient.ListLocations
- EvaluationClient.ListLocations (All)
- EvaluationClient.ListOperations
- EvaluationClient.ListOperations (All)
- EvaluationClient.ListScheduledEvaluationRuns
- EvaluationClient.ListScheduledEvaluationRuns (All)
- EvaluationClient.RunEvaluation
- EvaluationClient.TestPersonaVoice
- EvaluationClient.UpdateEvaluation
- EvaluationClient.UpdateEvaluationDataset
- EvaluationClient.UpdateEvaluationExpectation
- EvaluationClient.UpdateScheduledEvaluationRun
- EvaluationClient.UploadEvaluationAudio
- NewAgentClient
- NewAgentRESTClient
- NewEvaluationClient
- NewEvaluationRESTClient
- NewSessionClient
- NewSessionRESTClient
- NewToolClient
- NewToolRESTClient
- NewWidgetClient
- NewWidgetRESTClient
- SessionClient.BidiRunSession
- SessionClient.CancelOperation
- SessionClient.DeleteOperation
- SessionClient.GetLocation
- SessionClient.GetOperation
- SessionClient.ListLocations
- SessionClient.ListLocations (All)
- SessionClient.ListOperations
- SessionClient.ListOperations (All)
- SessionClient.RunSession
- ToolClient.CancelOperation
- ToolClient.DeleteOperation
- ToolClient.ExecuteTool
- ToolClient.GetLocation
- ToolClient.GetOperation
- ToolClient.ListLocations
- ToolClient.ListLocations (All)
- ToolClient.ListOperations
- ToolClient.ListOperations (All)
- ToolClient.RetrieveToolSchema
- ToolClient.RetrieveTools
- WidgetClient.CancelOperation
- WidgetClient.DeleteOperation
- WidgetClient.GenerateChatToken
- WidgetClient.GetLocation
- WidgetClient.GetOperation
- WidgetClient.ListLocations
- WidgetClient.ListLocations (All)
- WidgetClient.ListOperations
- WidgetClient.ListOperations (All)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type 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
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.
type 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) *BatchDeleteConversationsOperation
BatchDeleteConversationsOperation 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) error
CancelOperation 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() error
Close 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.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*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) *CreateAppOperation
CreateAppOperation 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) error
DeleteAgent 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) *DeleteAppOperation
DeleteAppOperation 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) error
DeleteAppVersion 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) error
DeleteConversation 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) error
DeleteDeployment 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) error
DeleteExample 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) error
DeleteGuardrail 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) error
DeleteOperation 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) error
DeleteTool 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) error
DeleteToolset 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) *ExportAppOperation
ExportAppOperation returns a new ExportAppOperation from a given name. The name must be that of a previously created ExportAppOperation, possibly from a different process.
func (*AgentClient) GetAgent ¶
func (c *AgentClient) GetAgent(ctx context.Context, req *cespb.GetAgentRequest, opts ...gax.CallOption) (*cespb.Agent, error)
GetAgent gets details of the specified agent.
Example ¶
package main
import (
"context"
ces "cloud.google.com/go/ces/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 ¶ added in v0.3.0
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) *ImportAppOperation
ImportAppOperation 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) *AgentIterator
ListAgents lists agents in the given app.
Example ¶
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)
}
}
Example (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) *AppVersionIterator
ListAppVersions lists all app versions in the given app.
Example ¶
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)
}
}
Example (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) *AppIterator
ListApps lists apps 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"
"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)
}
}
Example (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) *ChangelogIterator
ListChangelogs lists the changelogs of the specified app.
Example ¶
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)
}
}
Example (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) *ConversationIterator
ListConversations lists conversations in the given app.
Example ¶
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)
}
}
Example (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) *DeploymentIterator
ListDeployments lists deployments in the given app.
Example ¶
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)
}
}
Example (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) *ExampleIterator
ListExamples lists examples in the given app.
Example ¶
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)
}
}
Example (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) *GuardrailIterator
ListGuardrails lists guardrails in the given app.
Example ¶
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)
}
}
Example (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) *LocationIterator
ListLocations lists information about the supported locations for this service. This method can be called in two ways:
List all public locations: Use the path GET /v1/locations.
List project-visible locations: Use the path
GET /v1/projects/{project_id}/locations. This may include public
locations as well as private or other locations specifically visible
to the project.
Example ¶
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)
}
}
Example (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) *OperationIterator
ListOperations 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"
"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)
}
}
Example (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) *ToolIterator
ListTools lists tools in the given app.
Example ¶
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)
}
}
Example (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) *ToolsetIterator
ListToolsets lists toolsets in the given app.
Example ¶
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)
}
}
Example (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) *RestoreAppVersionOperation
RestoreAppVersionOperation 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 ¶ added in v0.3.0
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
}
type AgentIterator ¶
type AgentIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*cespb.Agent, nextPageToken string, err error)
// contains filtered or unexported fields
}
AgentIterator manages a stream of *cespb.Agent.
func (*AgentIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*AgentIterator) Next ¶
func (it *AgentIterator) Next() (*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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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 ¶
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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type BatchDeleteConversationsOperation ¶
type BatchDeleteConversationsOperation struct {
// contains filtered or unexported fields
}
BatchDeleteConversationsOperation manages a long-running operation from BatchDeleteConversations.
func (*BatchDeleteConversationsOperation) Done ¶
func (op *BatchDeleteConversationsOperation) Done() bool
Done 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() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*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.
type ChangelogIterator ¶
type ChangelogIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*cespb.Changelog, nextPageToken string, err error)
// contains filtered or unexported fields
}
ChangelogIterator manages a stream of *cespb.Changelog.
func (*ChangelogIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ChangelogIterator) Next ¶
func (it *ChangelogIterator) Next() (*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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ConversationIterator ¶
type ConversationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type CreateAppOperation ¶
type CreateAppOperation struct {
// contains filtered or unexported fields
}
CreateAppOperation manages a long-running operation from CreateApp.
func (*CreateAppOperation) Done ¶
func (op *CreateAppOperation) Done() bool
Done 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() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*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.
type DeleteAppOperation ¶
type DeleteAppOperation struct {
// contains filtered or unexported fields
}
DeleteAppOperation manages a long-running operation from DeleteApp.
func (*DeleteAppOperation) Done ¶
func (op *DeleteAppOperation) Done() bool
Done 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() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteAppOperation) Poll ¶
func (op *DeleteAppOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteAppOperation) Wait ¶
func (op *DeleteAppOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeleteEvaluationRunOperation ¶
type DeleteEvaluationRunOperation struct {
// contains filtered or unexported fields
}
DeleteEvaluationRunOperation manages a long-running operation from DeleteEvaluationRun.
func (*DeleteEvaluationRunOperation) Done ¶
func (op *DeleteEvaluationRunOperation) Done() bool
Done 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() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteEvaluationRunOperation) Poll ¶
func (op *DeleteEvaluationRunOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteEvaluationRunOperation) Wait ¶
func (op *DeleteEvaluationRunOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type 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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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
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.
type 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) error
CancelOperation 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() error
Close 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.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*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) error
DeleteEvaluation 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) error
DeleteEvaluationDataset 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) error
DeleteEvaluationExpectation 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) error
DeleteEvaluationResult 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) *DeleteEvaluationRunOperation
DeleteEvaluationRunOperation 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) error
DeleteOperation 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) error
DeleteScheduledEvaluationRun 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) 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) *GenerateEvaluationOperation
GenerateEvaluationOperation 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) *ImportEvaluationsOperation
ImportEvaluationsOperation 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) *EvaluationDatasetIterator
ListEvaluationDatasets lists all evaluation datasets in the given app.
Example ¶
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)
}
}
Example (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) *EvaluationExpectationIterator
ListEvaluationExpectations lists all evaluation expectations in the given app.
Example ¶
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)
}
}
Example (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) *EvaluationResultIterator
ListEvaluationResults lists all evaluation results for a given evaluation.
Example ¶
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)
}
}
Example (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) *EvaluationRunIterator
ListEvaluationRuns lists all evaluation runs in the given app.
Example ¶
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)
}
}
Example (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) *EvaluationIterator
ListEvaluations lists all evaluations in the given app.
Example ¶
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)
}
}
Example (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) *LocationIterator
ListLocations lists information about the supported locations for this service. This method can be called in two ways:
List all public locations: Use the path GET /v1/locations.
List project-visible locations: Use the path
GET /v1/projects/{project_id}/locations. This may include public
locations as well as private or other locations specifically visible
to the project.
Example ¶
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)
}
}
Example (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) *OperationIterator
ListOperations 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"
"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)
}
}
Example (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) *ScheduledEvaluationRunIterator
ListScheduledEvaluationRuns lists all scheduled evaluation runs in the given app.
Example ¶
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)
}
}
Example (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) *RunEvaluationOperation
RunEvaluationOperation 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
}
type 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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ExampleIterator ¶
type ExampleIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*cespb.Example, nextPageToken string, err error)
// contains filtered or unexported fields
}
ExampleIterator manages a stream of *cespb.Example.
func (*ExampleIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ExampleIterator) Next ¶
func (it *ExampleIterator) Next() (*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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ExportAppOperation ¶
type ExportAppOperation struct {
// contains filtered or unexported fields
}
ExportAppOperation manages a long-running operation from ExportApp.
func (*ExportAppOperation) Done ¶
func (op *ExportAppOperation) Done() bool
Done 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() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*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.
type GenerateEvaluationOperation ¶
type GenerateEvaluationOperation struct {
// contains filtered or unexported fields
}
GenerateEvaluationOperation manages a long-running operation from GenerateEvaluation.
func (*GenerateEvaluationOperation) Done ¶
func (op *GenerateEvaluationOperation) Done() bool
Done 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() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*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.
type 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 ¶
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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ImportAppOperation ¶
type ImportAppOperation struct {
// contains filtered or unexported fields
}
ImportAppOperation manages a long-running operation from ImportApp.
func (*ImportAppOperation) Done ¶
func (op *ImportAppOperation) Done() bool
Done 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() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*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.
type ImportEvaluationsOperation ¶
type ImportEvaluationsOperation struct {
// contains filtered or unexported fields
}
ImportEvaluationsOperation manages a long-running operation from ImportEvaluations.
func (*ImportEvaluationsOperation) Done ¶
func (op *ImportEvaluationsOperation) Done() bool
Done 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() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*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.
type LocationIterator ¶
type LocationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error)
// contains filtered or unexported fields
}
LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator) All ¶
func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*LocationIterator) Next ¶
func (it *LocationIterator) Next() (*locationpb.Location, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*LocationIterator) PageInfo ¶
func (it *LocationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type OperationIterator ¶
type OperationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error)
// contains filtered or unexported fields
}
OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All ¶
func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*OperationIterator) Next ¶
func (it *OperationIterator) Next() (*longrunningpb.Operation, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo ¶
func (it *OperationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type RestoreAppVersionOperation ¶
type RestoreAppVersionOperation struct {
// contains filtered or unexported fields
}
RestoreAppVersionOperation manages a long-running operation from RestoreAppVersion.
func (*RestoreAppVersionOperation) Done ¶
func (op *RestoreAppVersionOperation) Done() bool
Done 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() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*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.
type RunEvaluationOperation ¶
type RunEvaluationOperation struct {
// contains filtered or unexported fields
}
RunEvaluationOperation manages a long-running operation from RunEvaluation.
func (*RunEvaluationOperation) Done ¶
func (op *RunEvaluationOperation) Done() bool
Done 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() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*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.
type 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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type SessionCallOptions ¶
type SessionCallOptions struct {
RunSession []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.
type 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) error
CancelOperation 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() error
Close 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.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*SessionClient) DeleteOperation ¶
func (c *SessionClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation 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) *LocationIterator
ListLocations lists information about the supported locations for this service. This method can be called in two ways:
List all public locations: Use the path GET /v1/locations.
List project-visible locations: Use the path
GET /v1/projects/{project_id}/locations. This may include public
locations as well as private or other locations specifically visible
to the project.
Example ¶
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)
}
}
Example (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) *OperationIterator
ListOperations 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"
"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)
}
}
Example (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
}
type 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.
type 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) error
CancelOperation 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() error
Close 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.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ToolClient) DeleteOperation ¶
func (c *ToolClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation 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) *LocationIterator
ListLocations lists information about the supported locations for this service. This method can be called in two ways:
List all public locations: Use the path GET /v1/locations.
List project-visible locations: Use the path
GET /v1/projects/{project_id}/locations. This may include public
locations as well as private or other locations specifically visible
to the project.
Example ¶
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)
}
}
Example (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) *OperationIterator
ListOperations 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"
"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)
}
}
Example (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
}
type ToolIterator ¶
type ToolIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*cespb.Tool, nextPageToken string, err error)
// contains filtered or unexported fields
}
ToolIterator manages a stream of *cespb.Tool.
func (*ToolIterator) All ¶
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ToolIterator) Next ¶
func (it *ToolIterator) Next() (*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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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 ¶
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.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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.
type 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) error
CancelOperation 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() error
Close 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.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*WidgetClient) DeleteOperation ¶
func (c *WidgetClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation 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) *LocationIterator
ListLocations lists information about the supported locations for this service. This method can be called in two ways:
List all public locations: Use the path GET /v1/locations.
List project-visible locations: Use the path
GET /v1/projects/{project_id}/locations. This may include public
locations as well as private or other locations specifically visible
to the project.
Example ¶
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)
}
}
Example (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) *OperationIterator
ListOperations 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"
"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)
}
}
Example (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
}
}