Discovery Engine API v1 - Package cloud.google.com/go/discoveryengine/apiv1 (v1.22.0) Stay organized with collections Save and categorize content based on your preferences.
Package discoveryengine is an auto-generated package for theDiscovery Engine API.
Discovery Engine API.
General documentation
For information that is relevant for all client libraries please referencehttps://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on thispage 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/discoveryengine/apiv1@latestctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed.The methods of Client are safe for concurrent use by multiple goroutines.The returned client must be Closed when it is done being used.
Using the Client
The following is an example of making an API call with the newly created client, mentioned above.
req:=&discoveryenginepb.SearchRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#SearchRequest.}it:=c.Search(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*discoveryenginepb.SearchResponse)}
Use of Context
The ctx passed to NewSearchClient is used for authentication requests andfor creating the underlying connection, but is not used for subsequent calls.Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Functions
func DefaultAuthScopes
funcDefaultAuthScopes()[]stringDefaultAuthScopes reports the default set of authentication scopes to use with this package.
AssistantCallOptions
typeAssistantCallOptionsstruct{StreamAssist[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}AssistantCallOptions contains the retry settings for each method of AssistantClient.
AssistantClient
typeAssistantClientstruct{// The call options for this service.CallOptions*AssistantCallOptions// contains filtered or unexported fields}AssistantClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing Assistant configuration and assisting users.
func NewAssistantClient
funcNewAssistantClient(ctxcontext.Context,opts...option.ClientOption)(*AssistantClient,error)NewAssistantClient creates a new assistant service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing Assistant configuration and assisting users.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewAssistantClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewAssistantRESTClient
funcNewAssistantRESTClient(ctxcontext.Context,opts...option.ClientOption)(*AssistantClient,error)NewAssistantRESTClient creates a new assistant service rest client.
Service for managing Assistant configuration and assisting users.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewAssistantRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*AssistantClient) CancelOperation
func(c*AssistantClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewAssistantClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*AssistantClient) Close
func(c*AssistantClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*AssistantClient) Connection (deprecated)
func(c*AssistantClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*AssistantClient) GetOperation
func(c*AssistantClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewAssistantClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*AssistantClient) ListOperations
func(c*AssistantClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewAssistantClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewAssistantClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*AssistantClient) StreamAssist
func(c*AssistantClient)StreamAssist(ctxcontext.Context,req*discoveryenginepb.StreamAssistRequest,opts...gax.CallOption)(discoveryenginepb.AssistantService_StreamAssistClient,error)StreamAssist assists the user with a query in a streaming fashion.
BatchCreateTargetSitesOperation
typeBatchCreateTargetSitesOperationstruct{// contains filtered or unexported fields}BatchCreateTargetSitesOperation manages a long-running operation from BatchCreateTargetSites.
func (*BatchCreateTargetSitesOperation) Done
func(op*BatchCreateTargetSitesOperation)Done()boolDone reports whether the long-running operation has completed.
func (*BatchCreateTargetSitesOperation) Metadata
func(op*BatchCreateTargetSitesOperation)Metadata()(*discoveryenginepb.BatchCreateTargetSiteMetadata,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 (*BatchCreateTargetSitesOperation) Name
func(op*BatchCreateTargetSitesOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*BatchCreateTargetSitesOperation) Poll
func(op*BatchCreateTargetSitesOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.BatchCreateTargetSitesResponse,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 andthe 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 (*BatchCreateTargetSitesOperation) Wait
func(op*BatchCreateTargetSitesOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.BatchCreateTargetSitesResponse,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.
BatchUpdateUserLicensesOperation
typeBatchUpdateUserLicensesOperationstruct{// contains filtered or unexported fields}BatchUpdateUserLicensesOperation manages a long-running operation from BatchUpdateUserLicenses.
func (*BatchUpdateUserLicensesOperation) Done
func(op*BatchUpdateUserLicensesOperation)Done()boolDone reports whether the long-running operation has completed.
func (*BatchUpdateUserLicensesOperation) Metadata
func(op*BatchUpdateUserLicensesOperation)Metadata()(*discoveryenginepb.BatchUpdateUserLicensesMetadata,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 (*BatchUpdateUserLicensesOperation) Name
func(op*BatchUpdateUserLicensesOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*BatchUpdateUserLicensesOperation) Poll
func(op*BatchUpdateUserLicensesOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.BatchUpdateUserLicensesResponse,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 andthe 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 (*BatchUpdateUserLicensesOperation) Wait
func(op*BatchUpdateUserLicensesOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.BatchUpdateUserLicensesResponse,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.
BatchVerifyTargetSitesOperation
typeBatchVerifyTargetSitesOperationstruct{// contains filtered or unexported fields}BatchVerifyTargetSitesOperation manages a long-running operation from BatchVerifyTargetSites.
func (*BatchVerifyTargetSitesOperation) Done
func(op*BatchVerifyTargetSitesOperation)Done()boolDone reports whether the long-running operation has completed.
func (*BatchVerifyTargetSitesOperation) Metadata
func(op*BatchVerifyTargetSitesOperation)Metadata()(*discoveryenginepb.BatchVerifyTargetSitesMetadata,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 (*BatchVerifyTargetSitesOperation) Name
func(op*BatchVerifyTargetSitesOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*BatchVerifyTargetSitesOperation) Poll
func(op*BatchVerifyTargetSitesOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.BatchVerifyTargetSitesResponse,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 andthe 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 (*BatchVerifyTargetSitesOperation) Wait
func(op*BatchVerifyTargetSitesOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.BatchVerifyTargetSitesResponse,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.
CmekConfigCallOptions
typeCmekConfigCallOptionsstruct{UpdateCmekConfig[]gax.CallOptionGetCmekConfig[]gax.CallOptionListCmekConfigs[]gax.CallOptionDeleteCmekConfig[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}CmekConfigCallOptions contains the retry settings for each method of CmekConfigClient.
CmekConfigClient
typeCmekConfigClientstruct{// The call options for this service.CallOptions*CmekConfigCallOptions// 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}CmekConfigClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing CMEK related tasks
func NewCmekConfigClient
funcNewCmekConfigClient(ctxcontext.Context,opts...option.ClientOption)(*CmekConfigClient,error)NewCmekConfigClient creates a new cmek config service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing CMEK related tasks
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCmekConfigClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewCmekConfigRESTClient
funcNewCmekConfigRESTClient(ctxcontext.Context,opts...option.ClientOption)(*CmekConfigClient,error)NewCmekConfigRESTClient creates a new cmek config service rest client.
Service for managing CMEK related tasks
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCmekConfigRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*CmekConfigClient) CancelOperation
func(c*CmekConfigClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCmekConfigClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*CmekConfigClient) Close
func(c*CmekConfigClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*CmekConfigClient) Connection (deprecated)
func(c*CmekConfigClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*CmekConfigClient) DeleteCmekConfig
func(c*CmekConfigClient)DeleteCmekConfig(ctxcontext.Context,req*discoveryenginepb.DeleteCmekConfigRequest,opts...gax.CallOption)(*DeleteCmekConfigOperation,error)DeleteCmekConfig de-provisions a CmekConfig.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCmekConfigClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.DeleteCmekConfigRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#DeleteCmekConfigRequest.}op,err:=c.DeleteCmekConfig(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*CmekConfigClient) DeleteCmekConfigOperation
func(c*CmekConfigClient)DeleteCmekConfigOperation(namestring)*DeleteCmekConfigOperationDeleteCmekConfigOperation returns a new DeleteCmekConfigOperation from a given name.The name must be that of a previously created DeleteCmekConfigOperation, possibly from a different process.
func (*CmekConfigClient) GetCmekConfig
func(c*CmekConfigClient)GetCmekConfig(ctxcontext.Context,req*discoveryenginepb.GetCmekConfigRequest,opts...gax.CallOption)(*discoveryenginepb.CmekConfig,error)GetCmekConfig gets the CmekConfig.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCmekConfigClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.GetCmekConfigRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#GetCmekConfigRequest.}resp,err:=c.GetCmekConfig(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CmekConfigClient) GetOperation
func(c*CmekConfigClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCmekConfigClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CmekConfigClient) ListCmekConfigs
func(c*CmekConfigClient)ListCmekConfigs(ctxcontext.Context,req*discoveryenginepb.ListCmekConfigsRequest,opts...gax.CallOption)(*discoveryenginepb.ListCmekConfigsResponse,error)ListCmekConfigs lists all the CmekConfigswith the project.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCmekConfigClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListCmekConfigsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListCmekConfigsRequest.}resp,err:=c.ListCmekConfigs(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CmekConfigClient) ListOperations
func(c*CmekConfigClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCmekConfigClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCmekConfigClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*CmekConfigClient) UpdateCmekConfig
func(c*CmekConfigClient)UpdateCmekConfig(ctxcontext.Context,req*discoveryenginepb.UpdateCmekConfigRequest,opts...gax.CallOption)(*UpdateCmekConfigOperation,error)UpdateCmekConfig provisions a CMEK key for use in a location of a customer’s project.This method will also conduct location validation on the providedcmekConfig to make sure the key is valid and can be used in theselected location.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCmekConfigClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.UpdateCmekConfigRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#UpdateCmekConfigRequest.}op,err:=c.UpdateCmekConfig(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CmekConfigClient) UpdateCmekConfigOperation
func(c*CmekConfigClient)UpdateCmekConfigOperation(namestring)*UpdateCmekConfigOperationUpdateCmekConfigOperation returns a new UpdateCmekConfigOperation from a given name.The name must be that of a previously created UpdateCmekConfigOperation, possibly from a different process.
CompletionCallOptions
typeCompletionCallOptionsstruct{CompleteQuery[]gax.CallOptionImportSuggestionDenyListEntries[]gax.CallOptionPurgeSuggestionDenyListEntries[]gax.CallOptionImportCompletionSuggestions[]gax.CallOptionPurgeCompletionSuggestions[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}CompletionCallOptions contains the retry settings for each method of CompletionClient.
CompletionClient
typeCompletionClientstruct{// The call options for this service.CallOptions*CompletionCallOptions// 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}CompletionClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for Auto-Completion.
func NewCompletionClient
funcNewCompletionClient(ctxcontext.Context,opts...option.ClientOption)(*CompletionClient,error)NewCompletionClient creates a new completion service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for Auto-Completion.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCompletionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewCompletionRESTClient
funcNewCompletionRESTClient(ctxcontext.Context,opts...option.ClientOption)(*CompletionClient,error)NewCompletionRESTClient creates a new completion service rest client.
Service for Auto-Completion.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCompletionRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*CompletionClient) CancelOperation
func(c*CompletionClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCompletionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*CompletionClient) Close
func(c*CompletionClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*CompletionClient) CompleteQuery
func(c*CompletionClient)CompleteQuery(ctxcontext.Context,req*discoveryenginepb.CompleteQueryRequest,opts...gax.CallOption)(*discoveryenginepb.CompleteQueryResponse,error)CompleteQuery completes the specified user input with keyword suggestions.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCompletionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.CompleteQueryRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#CompleteQueryRequest.}resp,err:=c.CompleteQuery(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CompletionClient) Connection (deprecated)
func(c*CompletionClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*CompletionClient) GetOperation
func(c*CompletionClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCompletionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CompletionClient) ImportCompletionSuggestions
func(c*CompletionClient)ImportCompletionSuggestions(ctxcontext.Context,req*discoveryenginepb.ImportCompletionSuggestionsRequest,opts...gax.CallOption)(*ImportCompletionSuggestionsOperation,error)ImportCompletionSuggestions importsCompletionSuggestionsfor a DataStore.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCompletionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ImportCompletionSuggestionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ImportCompletionSuggestionsRequest.}op,err:=c.ImportCompletionSuggestions(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CompletionClient) ImportCompletionSuggestionsOperation
func(c*CompletionClient)ImportCompletionSuggestionsOperation(namestring)*ImportCompletionSuggestionsOperationImportCompletionSuggestionsOperation returns a new ImportCompletionSuggestionsOperation from a given name.The name must be that of a previously created ImportCompletionSuggestionsOperation, possibly from a different process.
func (*CompletionClient) ImportSuggestionDenyListEntries
func(c*CompletionClient)ImportSuggestionDenyListEntries(ctxcontext.Context,req*discoveryenginepb.ImportSuggestionDenyListEntriesRequest,opts...gax.CallOption)(*ImportSuggestionDenyListEntriesOperation,error)ImportSuggestionDenyListEntries imports allSuggestionDenyListEntryfor a DataStore.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCompletionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ImportSuggestionDenyListEntriesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ImportSuggestionDenyListEntriesRequest.}op,err:=c.ImportSuggestionDenyListEntries(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CompletionClient) ImportSuggestionDenyListEntriesOperation
func(c*CompletionClient)ImportSuggestionDenyListEntriesOperation(namestring)*ImportSuggestionDenyListEntriesOperationImportSuggestionDenyListEntriesOperation returns a new ImportSuggestionDenyListEntriesOperation from a given name.The name must be that of a previously created ImportSuggestionDenyListEntriesOperation, possibly from a different process.
func (*CompletionClient) ListOperations
func(c*CompletionClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCompletionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCompletionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*CompletionClient) PurgeCompletionSuggestions
func(c*CompletionClient)PurgeCompletionSuggestions(ctxcontext.Context,req*discoveryenginepb.PurgeCompletionSuggestionsRequest,opts...gax.CallOption)(*PurgeCompletionSuggestionsOperation,error)PurgeCompletionSuggestions permanently deletes allCompletionSuggestionsfor a DataStore.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCompletionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.PurgeCompletionSuggestionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#PurgeCompletionSuggestionsRequest.}op,err:=c.PurgeCompletionSuggestions(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CompletionClient) PurgeCompletionSuggestionsOperation
func(c*CompletionClient)PurgeCompletionSuggestionsOperation(namestring)*PurgeCompletionSuggestionsOperationPurgeCompletionSuggestionsOperation returns a new PurgeCompletionSuggestionsOperation from a given name.The name must be that of a previously created PurgeCompletionSuggestionsOperation, possibly from a different process.
func (*CompletionClient) PurgeSuggestionDenyListEntries
func(c*CompletionClient)PurgeSuggestionDenyListEntries(ctxcontext.Context,req*discoveryenginepb.PurgeSuggestionDenyListEntriesRequest,opts...gax.CallOption)(*PurgeSuggestionDenyListEntriesOperation,error)PurgeSuggestionDenyListEntries permanently deletes allSuggestionDenyListEntryfor a DataStore.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewCompletionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.PurgeSuggestionDenyListEntriesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#PurgeSuggestionDenyListEntriesRequest.}op,err:=c.PurgeSuggestionDenyListEntries(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CompletionClient) PurgeSuggestionDenyListEntriesOperation
func(c*CompletionClient)PurgeSuggestionDenyListEntriesOperation(namestring)*PurgeSuggestionDenyListEntriesOperationPurgeSuggestionDenyListEntriesOperation returns a new PurgeSuggestionDenyListEntriesOperation from a given name.The name must be that of a previously created PurgeSuggestionDenyListEntriesOperation, possibly from a different process.
ControlCallOptions
typeControlCallOptionsstruct{CreateControl[]gax.CallOptionDeleteControl[]gax.CallOptionUpdateControl[]gax.CallOptionGetControl[]gax.CallOptionListControls[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}ControlCallOptions contains the retry settings for each method of ControlClient.
ControlClient
typeControlClientstruct{// The call options for this service.CallOptions*ControlCallOptions// contains filtered or unexported fields}ControlClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for performing CRUD operations on Controls.Controls allow for custom logic to be implemented in the serving path.Controls need to be attached to a Serving Config to be considered during arequest.
func NewControlClient
funcNewControlClient(ctxcontext.Context,opts...option.ClientOption)(*ControlClient,error)NewControlClient creates a new control service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for performing CRUD operations on Controls.Controls allow for custom logic to be implemented in the serving path.Controls need to be attached to a Serving Config to be considered during arequest.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewControlClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewControlRESTClient
funcNewControlRESTClient(ctxcontext.Context,opts...option.ClientOption)(*ControlClient,error)NewControlRESTClient creates a new control service rest client.
Service for performing CRUD operations on Controls.Controls allow for custom logic to be implemented in the serving path.Controls need to be attached to a Serving Config to be considered during arequest.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewControlRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*ControlClient) CancelOperation
func(c*ControlClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewControlClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*ControlClient) Close
func(c*ControlClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*ControlClient) Connection (deprecated)
func(c*ControlClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*ControlClient) CreateControl
func(c*ControlClient)CreateControl(ctxcontext.Context,req*discoveryenginepb.CreateControlRequest,opts...gax.CallOption)(*discoveryenginepb.Control,error)CreateControl creates a Control.
By default 1000 controls are allowed for a data store.A request can be submitted to adjust this limit.If the Control to create alreadyexists, an ALREADY_EXISTS error is returned.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewControlClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.CreateControlRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#CreateControlRequest.}resp,err:=c.CreateControl(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ControlClient) DeleteControl
func(c*ControlClient)DeleteControl(ctxcontext.Context,req*discoveryenginepb.DeleteControlRequest,opts...gax.CallOption)errorDeleteControl deletes a Control.
If the Control to delete doesnot exist, a NOT_FOUND error is returned.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewControlClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.DeleteControlRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#DeleteControlRequest.}err=c.DeleteControl(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*ControlClient) GetControl
func(c*ControlClient)GetControl(ctxcontext.Context,req*discoveryenginepb.GetControlRequest,opts...gax.CallOption)(*discoveryenginepb.Control,error)GetControl gets a Control.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewControlClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.GetControlRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#GetControlRequest.}resp,err:=c.GetControl(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ControlClient) GetOperation
func(c*ControlClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewControlClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ControlClient) ListControls
func(c*ControlClient)ListControls(ctxcontext.Context,req*discoveryenginepb.ListControlsRequest,opts...gax.CallOption)*ControlIteratorListControls lists all Controls by their parentDataStore.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewControlClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListControlsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListControlsRequest.}it:=c.ListControls(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*discoveryenginepb.ListControlsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewControlClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListControlsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListControlsRequest.}forresp,err:=rangec.ListControls(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*ControlClient) ListOperations
func(c*ControlClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewControlClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewControlClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*ControlClient) UpdateControl
func(c*ControlClient)UpdateControl(ctxcontext.Context,req*discoveryenginepb.UpdateControlRequest,opts...gax.CallOption)(*discoveryenginepb.Control,error)UpdateControl updates a Control.
Control action type cannot bechanged. If the Control toupdate does not exist, a NOT_FOUND error is returned.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewControlClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.UpdateControlRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#UpdateControlRequest.}resp,err:=c.UpdateControl(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}ControlIterator
typeControlIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*discoveryenginepb.Control,nextPageTokenstring,errerror)// contains filtered or unexported fields}ControlIterator manages a stream of *discoveryenginepb.Control.
func (*ControlIterator) All
func(it*ControlIterator)All()iter.Seq2[*discoveryenginepb.Control,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*ControlIterator) Next
func(it*ControlIterator)Next()(*discoveryenginepb.Control,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*ControlIterator) PageInfo
func(it*ControlIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ConversationIterator
typeConversationIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*discoveryenginepb.Conversation,nextPageTokenstring,errerror)// contains filtered or unexported fields}ConversationIterator manages a stream of *discoveryenginepb.Conversation.
func (*ConversationIterator) All
func(it*ConversationIterator)All()iter.Seq2[*discoveryenginepb.Conversation,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*ConversationIterator) Next
func(it*ConversationIterator)Next()(*discoveryenginepb.Conversation,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*ConversationIterator) PageInfo
func(it*ConversationIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ConversationalSearchCallOptions
typeConversationalSearchCallOptionsstruct{ConverseConversation[]gax.CallOptionCreateConversation[]gax.CallOptionDeleteConversation[]gax.CallOptionUpdateConversation[]gax.CallOptionGetConversation[]gax.CallOptionListConversations[]gax.CallOptionAnswerQuery[]gax.CallOptionStreamAnswerQuery[]gax.CallOptionGetAnswer[]gax.CallOptionCreateSession[]gax.CallOptionDeleteSession[]gax.CallOptionUpdateSession[]gax.CallOptionGetSession[]gax.CallOptionListSessions[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}ConversationalSearchCallOptions contains the retry settings for each method of ConversationalSearchClient.
ConversationalSearchClient
typeConversationalSearchClientstruct{// The call options for this service.CallOptions*ConversationalSearchCallOptions// contains filtered or unexported fields}ConversationalSearchClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for conversational search.
func NewConversationalSearchClient
funcNewConversationalSearchClient(ctxcontext.Context,opts...option.ClientOption)(*ConversationalSearchClient,error)NewConversationalSearchClient creates a new conversational search service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for conversational search.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewConversationalSearchRESTClient
funcNewConversationalSearchRESTClient(ctxcontext.Context,opts...option.ClientOption)(*ConversationalSearchClient,error)NewConversationalSearchRESTClient creates a new conversational search service rest client.
Service for conversational search.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*ConversationalSearchClient) AnswerQuery
func(c*ConversationalSearchClient)AnswerQuery(ctxcontext.Context,req*discoveryenginepb.AnswerQueryRequest,opts...gax.CallOption)(*discoveryenginepb.AnswerQueryResponse,error)AnswerQuery answer query method.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.AnswerQueryRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#AnswerQueryRequest.}resp,err:=c.AnswerQuery(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ConversationalSearchClient) CancelOperation
func(c*ConversationalSearchClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*ConversationalSearchClient) Close
func(c*ConversationalSearchClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*ConversationalSearchClient) Connection (deprecated)
func(c*ConversationalSearchClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*ConversationalSearchClient) ConverseConversation
func(c*ConversationalSearchClient)ConverseConversation(ctxcontext.Context,req*discoveryenginepb.ConverseConversationRequest,opts...gax.CallOption)(*discoveryenginepb.ConverseConversationResponse,error)ConverseConversation converses a conversation.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ConverseConversationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ConverseConversationRequest.}resp,err:=c.ConverseConversation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ConversationalSearchClient) CreateConversation
func(c*ConversationalSearchClient)CreateConversation(ctxcontext.Context,req*discoveryenginepb.CreateConversationRequest,opts...gax.CallOption)(*discoveryenginepb.Conversation,error)CreateConversation creates a Conversation.
If the Conversation tocreate already exists, an ALREADY_EXISTS error is returned.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.CreateConversationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#CreateConversationRequest.}resp,err:=c.CreateConversation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ConversationalSearchClient) CreateSession
func(c*ConversationalSearchClient)CreateSession(ctxcontext.Context,req*discoveryenginepb.CreateSessionRequest,opts...gax.CallOption)(*discoveryenginepb.Session,error)CreateSession creates a Session.
If the Session to create alreadyexists, an ALREADY_EXISTS error is returned.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.CreateSessionRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#CreateSessionRequest.}resp,err:=c.CreateSession(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ConversationalSearchClient) DeleteConversation
func(c*ConversationalSearchClient)DeleteConversation(ctxcontext.Context,req*discoveryenginepb.DeleteConversationRequest,opts...gax.CallOption)errorDeleteConversation deletes a Conversation.
If the Conversation todelete does not exist, a NOT_FOUND error is returned.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.DeleteConversationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#DeleteConversationRequest.}err=c.DeleteConversation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*ConversationalSearchClient) DeleteSession
func(c*ConversationalSearchClient)DeleteSession(ctxcontext.Context,req*discoveryenginepb.DeleteSessionRequest,opts...gax.CallOption)errorDeleteSession deletes a Session.
If the Session to delete doesnot exist, a NOT_FOUND error is returned.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.DeleteSessionRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#DeleteSessionRequest.}err=c.DeleteSession(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*ConversationalSearchClient) GetAnswer
func(c*ConversationalSearchClient)GetAnswer(ctxcontext.Context,req*discoveryenginepb.GetAnswerRequest,opts...gax.CallOption)(*discoveryenginepb.Answer,error)GetAnswer gets a Answer.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.GetAnswerRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#GetAnswerRequest.}resp,err:=c.GetAnswer(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ConversationalSearchClient) GetConversation
func(c*ConversationalSearchClient)GetConversation(ctxcontext.Context,req*discoveryenginepb.GetConversationRequest,opts...gax.CallOption)(*discoveryenginepb.Conversation,error)GetConversation gets a Conversation.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.GetConversationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#GetConversationRequest.}resp,err:=c.GetConversation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ConversationalSearchClient) GetOperation
func(c*ConversationalSearchClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ConversationalSearchClient) GetSession
func(c*ConversationalSearchClient)GetSession(ctxcontext.Context,req*discoveryenginepb.GetSessionRequest,opts...gax.CallOption)(*discoveryenginepb.Session,error)GetSession gets a Session.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.GetSessionRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#GetSessionRequest.}resp,err:=c.GetSession(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ConversationalSearchClient) ListConversations
func(c*ConversationalSearchClient)ListConversations(ctxcontext.Context,req*discoveryenginepb.ListConversationsRequest,opts...gax.CallOption)*ConversationIteratorListConversations lists all Conversations by their parentDataStore.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListConversationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListConversationsRequest.}it:=c.ListConversations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*discoveryenginepb.ListConversationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListConversationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListConversationsRequest.}forresp,err:=rangec.ListConversations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*ConversationalSearchClient) ListOperations
func(c*ConversationalSearchClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*ConversationalSearchClient) ListSessions
func(c*ConversationalSearchClient)ListSessions(ctxcontext.Context,req*discoveryenginepb.ListSessionsRequest,opts...gax.CallOption)*SessionIteratorListSessions lists all Sessions by their parentDataStore.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListSessionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListSessionsRequest.}it:=c.ListSessions(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*discoveryenginepb.ListSessionsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListSessionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListSessionsRequest.}forresp,err:=rangec.ListSessions(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*ConversationalSearchClient) StreamAnswerQuery
func(c*ConversationalSearchClient)StreamAnswerQuery(ctxcontext.Context,req*discoveryenginepb.AnswerQueryRequest,opts...gax.CallOption)(discoveryenginepb.ConversationalSearchService_StreamAnswerQueryClient,error)StreamAnswerQuery answer query method (streaming).
It takes oneAnswerQueryRequestand returns multipleAnswerQueryResponsemessages in a stream.
func (*ConversationalSearchClient) UpdateConversation
func(c*ConversationalSearchClient)UpdateConversation(ctxcontext.Context,req*discoveryenginepb.UpdateConversationRequest,opts...gax.CallOption)(*discoveryenginepb.Conversation,error)UpdateConversation updates a Conversation.
Conversation action typecannot be changed. If theConversation to update doesnot exist, a NOT_FOUND error is returned.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.UpdateConversationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#UpdateConversationRequest.}resp,err:=c.UpdateConversation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ConversationalSearchClient) UpdateSession
func(c*ConversationalSearchClient)UpdateSession(ctxcontext.Context,req*discoveryenginepb.UpdateSessionRequest,opts...gax.CallOption)(*discoveryenginepb.Session,error)UpdateSession updates a Session.
Session action type cannot bechanged. If the Session toupdate does not exist, a NOT_FOUND error is returned.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewConversationalSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.UpdateSessionRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#UpdateSessionRequest.}resp,err:=c.UpdateSession(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}CreateDataStoreOperation
typeCreateDataStoreOperationstruct{// contains filtered or unexported fields}CreateDataStoreOperation manages a long-running operation from CreateDataStore.
func (*CreateDataStoreOperation) Done
func(op*CreateDataStoreOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateDataStoreOperation) Metadata
func(op*CreateDataStoreOperation)Metadata()(*discoveryenginepb.CreateDataStoreMetadata,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 (*CreateDataStoreOperation) Name
func(op*CreateDataStoreOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateDataStoreOperation) Poll
func(op*CreateDataStoreOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.DataStore,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 andthe 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 (*CreateDataStoreOperation) Wait
func(op*CreateDataStoreOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.DataStore,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.
CreateEngineOperation
typeCreateEngineOperationstruct{// contains filtered or unexported fields}CreateEngineOperation manages a long-running operation from CreateEngine.
func (*CreateEngineOperation) Done
func(op*CreateEngineOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateEngineOperation) Metadata
func(op*CreateEngineOperation)Metadata()(*discoveryenginepb.CreateEngineMetadata,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 (*CreateEngineOperation) Name
func(op*CreateEngineOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateEngineOperation) Poll
func(op*CreateEngineOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.Engine,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 andthe 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 (*CreateEngineOperation) Wait
func(op*CreateEngineOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.Engine,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.
CreateSchemaOperation
typeCreateSchemaOperationstruct{// contains filtered or unexported fields}CreateSchemaOperation manages a long-running operation from CreateSchema.
func (*CreateSchemaOperation) Done
func(op*CreateSchemaOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateSchemaOperation) Metadata
func(op*CreateSchemaOperation)Metadata()(*discoveryenginepb.CreateSchemaMetadata,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 (*CreateSchemaOperation) Name
func(op*CreateSchemaOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateSchemaOperation) Poll
func(op*CreateSchemaOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.Schema,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 andthe 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 (*CreateSchemaOperation) Wait
func(op*CreateSchemaOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.Schema,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.
CreateSitemapOperation
typeCreateSitemapOperationstruct{// contains filtered or unexported fields}CreateSitemapOperation manages a long-running operation from CreateSitemap.
func (*CreateSitemapOperation) Done
func(op*CreateSitemapOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateSitemapOperation) Metadata
func(op*CreateSitemapOperation)Metadata()(*discoveryenginepb.CreateSitemapMetadata,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 (*CreateSitemapOperation) Name
func(op*CreateSitemapOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateSitemapOperation) Poll
func(op*CreateSitemapOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.Sitemap,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 andthe 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 (*CreateSitemapOperation) Wait
func(op*CreateSitemapOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.Sitemap,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.
CreateTargetSiteOperation
typeCreateTargetSiteOperationstruct{// contains filtered or unexported fields}CreateTargetSiteOperation manages a long-running operation from CreateTargetSite.
func (*CreateTargetSiteOperation) Done
func(op*CreateTargetSiteOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateTargetSiteOperation) Metadata
func(op*CreateTargetSiteOperation)Metadata()(*discoveryenginepb.CreateTargetSiteMetadata,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 (*CreateTargetSiteOperation) Name
func(op*CreateTargetSiteOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateTargetSiteOperation) Poll
func(op*CreateTargetSiteOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.TargetSite,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 andthe 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 (*CreateTargetSiteOperation) Wait
func(op*CreateTargetSiteOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.TargetSite,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.
DataStoreCallOptions
typeDataStoreCallOptionsstruct{CreateDataStore[]gax.CallOptionGetDataStore[]gax.CallOptionListDataStores[]gax.CallOptionDeleteDataStore[]gax.CallOptionUpdateDataStore[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}DataStoreCallOptions contains the retry settings for each method of DataStoreClient.
DataStoreClient
typeDataStoreClientstruct{// The call options for this service.CallOptions*DataStoreCallOptions// 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}DataStoreClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing DataStoreconfiguration.
func NewDataStoreClient
funcNewDataStoreClient(ctxcontext.Context,opts...option.ClientOption)(*DataStoreClient,error)NewDataStoreClient creates a new data store service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing DataStoreconfiguration.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDataStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewDataStoreRESTClient
funcNewDataStoreRESTClient(ctxcontext.Context,opts...option.ClientOption)(*DataStoreClient,error)NewDataStoreRESTClient creates a new data store service rest client.
Service for managing DataStoreconfiguration.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDataStoreRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*DataStoreClient) CancelOperation
func(c*DataStoreClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDataStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*DataStoreClient) Close
func(c*DataStoreClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*DataStoreClient) Connection (deprecated)
func(c*DataStoreClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*DataStoreClient) CreateDataStore
func(c*DataStoreClient)CreateDataStore(ctxcontext.Context,req*discoveryenginepb.CreateDataStoreRequest,opts...gax.CallOption)(*CreateDataStoreOperation,error)CreateDataStore creates a DataStore.
DataStore is for storingDocuments. To serve thesedocuments for Search, or Recommendation use case, anEngine needs to be createdseparately.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDataStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.CreateDataStoreRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#CreateDataStoreRequest.}op,err:=c.CreateDataStore(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DataStoreClient) CreateDataStoreOperation
func(c*DataStoreClient)CreateDataStoreOperation(namestring)*CreateDataStoreOperationCreateDataStoreOperation returns a new CreateDataStoreOperation from a given name.The name must be that of a previously created CreateDataStoreOperation, possibly from a different process.
func (*DataStoreClient) DeleteDataStore
func(c*DataStoreClient)DeleteDataStore(ctxcontext.Context,req*discoveryenginepb.DeleteDataStoreRequest,opts...gax.CallOption)(*DeleteDataStoreOperation,error)DeleteDataStore deletes a DataStore.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDataStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.DeleteDataStoreRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#DeleteDataStoreRequest.}op,err:=c.DeleteDataStore(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*DataStoreClient) DeleteDataStoreOperation
func(c*DataStoreClient)DeleteDataStoreOperation(namestring)*DeleteDataStoreOperationDeleteDataStoreOperation returns a new DeleteDataStoreOperation from a given name.The name must be that of a previously created DeleteDataStoreOperation, possibly from a different process.
func (*DataStoreClient) GetDataStore
func(c*DataStoreClient)GetDataStore(ctxcontext.Context,req*discoveryenginepb.GetDataStoreRequest,opts...gax.CallOption)(*discoveryenginepb.DataStore,error)GetDataStore gets a DataStore.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDataStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.GetDataStoreRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#GetDataStoreRequest.}resp,err:=c.GetDataStore(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DataStoreClient) GetOperation
func(c*DataStoreClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDataStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DataStoreClient) ListDataStores
func(c*DataStoreClient)ListDataStores(ctxcontext.Context,req*discoveryenginepb.ListDataStoresRequest,opts...gax.CallOption)*DataStoreIteratorListDataStores lists all the DataStoresassociated with the project.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDataStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListDataStoresRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListDataStoresRequest.}it:=c.ListDataStores(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*discoveryenginepb.ListDataStoresResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDataStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListDataStoresRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListDataStoresRequest.}forresp,err:=rangec.ListDataStores(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*DataStoreClient) ListOperations
func(c*DataStoreClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDataStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDataStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*DataStoreClient) UpdateDataStore
func(c*DataStoreClient)UpdateDataStore(ctxcontext.Context,req*discoveryenginepb.UpdateDataStoreRequest,opts...gax.CallOption)(*discoveryenginepb.DataStore,error)UpdateDataStore updates a DataStore
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDataStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.UpdateDataStoreRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#UpdateDataStoreRequest.}resp,err:=c.UpdateDataStore(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}DataStoreIterator
typeDataStoreIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*discoveryenginepb.DataStore,nextPageTokenstring,errerror)// contains filtered or unexported fields}DataStoreIterator manages a stream of *discoveryenginepb.DataStore.
func (*DataStoreIterator) All
func(it*DataStoreIterator)All()iter.Seq2[*discoveryenginepb.DataStore,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*DataStoreIterator) Next
func(it*DataStoreIterator)Next()(*discoveryenginepb.DataStore,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*DataStoreIterator) PageInfo
func(it*DataStoreIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
DeleteCmekConfigOperation
typeDeleteCmekConfigOperationstruct{// contains filtered or unexported fields}DeleteCmekConfigOperation manages a long-running operation from DeleteCmekConfig.
func (*DeleteCmekConfigOperation) Done
func(op*DeleteCmekConfigOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteCmekConfigOperation) Metadata
func(op*DeleteCmekConfigOperation)Metadata()(*discoveryenginepb.DeleteCmekConfigMetadata,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 (*DeleteCmekConfigOperation) Name
func(op*DeleteCmekConfigOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteCmekConfigOperation) Poll
func(op*DeleteCmekConfigOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe 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 (*DeleteCmekConfigOperation) Wait
func(op*DeleteCmekConfigOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteDataStoreOperation
typeDeleteDataStoreOperationstruct{// contains filtered or unexported fields}DeleteDataStoreOperation manages a long-running operation from DeleteDataStore.
func (*DeleteDataStoreOperation) Done
func(op*DeleteDataStoreOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteDataStoreOperation) Metadata
func(op*DeleteDataStoreOperation)Metadata()(*discoveryenginepb.DeleteDataStoreMetadata,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 (*DeleteDataStoreOperation) Name
func(op*DeleteDataStoreOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteDataStoreOperation) Poll
func(op*DeleteDataStoreOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe 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 (*DeleteDataStoreOperation) Wait
func(op*DeleteDataStoreOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteEngineOperation
typeDeleteEngineOperationstruct{// contains filtered or unexported fields}DeleteEngineOperation manages a long-running operation from DeleteEngine.
func (*DeleteEngineOperation) Done
func(op*DeleteEngineOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteEngineOperation) Metadata
func(op*DeleteEngineOperation)Metadata()(*discoveryenginepb.DeleteEngineMetadata,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 (*DeleteEngineOperation) Name
func(op*DeleteEngineOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteEngineOperation) Poll
func(op*DeleteEngineOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe 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 (*DeleteEngineOperation) Wait
func(op*DeleteEngineOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteIdentityMappingStoreOperation
typeDeleteIdentityMappingStoreOperationstruct{// contains filtered or unexported fields}DeleteIdentityMappingStoreOperation manages a long-running operation from DeleteIdentityMappingStore.
func (*DeleteIdentityMappingStoreOperation) Done
func(op*DeleteIdentityMappingStoreOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteIdentityMappingStoreOperation) Metadata
func(op*DeleteIdentityMappingStoreOperation)Metadata()(*discoveryenginepb.DeleteIdentityMappingStoreMetadata,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 (*DeleteIdentityMappingStoreOperation) Name
func(op*DeleteIdentityMappingStoreOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteIdentityMappingStoreOperation) Poll
func(op*DeleteIdentityMappingStoreOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe 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 (*DeleteIdentityMappingStoreOperation) Wait
func(op*DeleteIdentityMappingStoreOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteSchemaOperation
typeDeleteSchemaOperationstruct{// contains filtered or unexported fields}DeleteSchemaOperation manages a long-running operation from DeleteSchema.
func (*DeleteSchemaOperation) Done
func(op*DeleteSchemaOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteSchemaOperation) Metadata
func(op*DeleteSchemaOperation)Metadata()(*discoveryenginepb.DeleteSchemaMetadata,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 (*DeleteSchemaOperation) Name
func(op*DeleteSchemaOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteSchemaOperation) Poll
func(op*DeleteSchemaOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe 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 (*DeleteSchemaOperation) Wait
func(op*DeleteSchemaOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteSitemapOperation
typeDeleteSitemapOperationstruct{// contains filtered or unexported fields}DeleteSitemapOperation manages a long-running operation from DeleteSitemap.
func (*DeleteSitemapOperation) Done
func(op*DeleteSitemapOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteSitemapOperation) Metadata
func(op*DeleteSitemapOperation)Metadata()(*discoveryenginepb.DeleteSitemapMetadata,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 (*DeleteSitemapOperation) Name
func(op*DeleteSitemapOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteSitemapOperation) Poll
func(op*DeleteSitemapOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe 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 (*DeleteSitemapOperation) Wait
func(op*DeleteSitemapOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteTargetSiteOperation
typeDeleteTargetSiteOperationstruct{// contains filtered or unexported fields}DeleteTargetSiteOperation manages a long-running operation from DeleteTargetSite.
func (*DeleteTargetSiteOperation) Done
func(op*DeleteTargetSiteOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteTargetSiteOperation) Metadata
func(op*DeleteTargetSiteOperation)Metadata()(*discoveryenginepb.DeleteTargetSiteMetadata,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 (*DeleteTargetSiteOperation) Name
func(op*DeleteTargetSiteOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteTargetSiteOperation) Poll
func(op*DeleteTargetSiteOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe 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 (*DeleteTargetSiteOperation) Wait
func(op*DeleteTargetSiteOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DisableAdvancedSiteSearchOperation
typeDisableAdvancedSiteSearchOperationstruct{// contains filtered or unexported fields}DisableAdvancedSiteSearchOperation manages a long-running operation from DisableAdvancedSiteSearch.
func (*DisableAdvancedSiteSearchOperation) Done
func(op*DisableAdvancedSiteSearchOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DisableAdvancedSiteSearchOperation) Metadata
func(op*DisableAdvancedSiteSearchOperation)Metadata()(*discoveryenginepb.DisableAdvancedSiteSearchMetadata,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 (*DisableAdvancedSiteSearchOperation) Name
func(op*DisableAdvancedSiteSearchOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*DisableAdvancedSiteSearchOperation) Poll
func(op*DisableAdvancedSiteSearchOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.DisableAdvancedSiteSearchResponse,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 andthe 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 (*DisableAdvancedSiteSearchOperation) Wait
func(op*DisableAdvancedSiteSearchOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.DisableAdvancedSiteSearchResponse,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.
DocumentCallOptions
typeDocumentCallOptionsstruct{GetDocument[]gax.CallOptionListDocuments[]gax.CallOptionCreateDocument[]gax.CallOptionUpdateDocument[]gax.CallOptionDeleteDocument[]gax.CallOptionImportDocuments[]gax.CallOptionPurgeDocuments[]gax.CallOptionBatchGetDocumentsMetadata[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}DocumentCallOptions contains the retry settings for each method of DocumentClient.
DocumentClient
typeDocumentClientstruct{// The call options for this service.CallOptions*DocumentCallOptions// 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}DocumentClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for ingesting Documentinformation of the customer’s website.
func NewDocumentClient
funcNewDocumentClient(ctxcontext.Context,opts...option.ClientOption)(*DocumentClient,error)NewDocumentClient creates a new document service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for ingesting Documentinformation of the customer’s website.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDocumentClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewDocumentRESTClient
funcNewDocumentRESTClient(ctxcontext.Context,opts...option.ClientOption)(*DocumentClient,error)NewDocumentRESTClient creates a new document service rest client.
Service for ingesting Documentinformation of the customer’s website.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDocumentRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*DocumentClient) BatchGetDocumentsMetadata
func(c*DocumentClient)BatchGetDocumentsMetadata(ctxcontext.Context,req*discoveryenginepb.BatchGetDocumentsMetadataRequest,opts...gax.CallOption)(*discoveryenginepb.BatchGetDocumentsMetadataResponse,error)BatchGetDocumentsMetadata gets index freshness metadata forDocuments. Supported forwebsite search only.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDocumentClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.BatchGetDocumentsMetadataRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#BatchGetDocumentsMetadataRequest.}resp,err:=c.BatchGetDocumentsMetadata(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DocumentClient) CancelOperation
func(c*DocumentClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDocumentClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*DocumentClient) Close
func(c*DocumentClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*DocumentClient) Connection (deprecated)
func(c*DocumentClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*DocumentClient) CreateDocument
func(c*DocumentClient)CreateDocument(ctxcontext.Context,req*discoveryenginepb.CreateDocumentRequest,opts...gax.CallOption)(*discoveryenginepb.Document,error)CreateDocument creates a Document.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDocumentClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.CreateDocumentRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#CreateDocumentRequest.}resp,err:=c.CreateDocument(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DocumentClient) DeleteDocument
func(c*DocumentClient)DeleteDocument(ctxcontext.Context,req*discoveryenginepb.DeleteDocumentRequest,opts...gax.CallOption)errorDeleteDocument deletes a Document.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDocumentClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.DeleteDocumentRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#DeleteDocumentRequest.}err=c.DeleteDocument(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*DocumentClient) GetDocument
func(c*DocumentClient)GetDocument(ctxcontext.Context,req*discoveryenginepb.GetDocumentRequest,opts...gax.CallOption)(*discoveryenginepb.Document,error)GetDocument gets a Document.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDocumentClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.GetDocumentRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#GetDocumentRequest.}resp,err:=c.GetDocument(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DocumentClient) GetOperation
func(c*DocumentClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDocumentClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DocumentClient) ImportDocuments
func(c*DocumentClient)ImportDocuments(ctxcontext.Context,req*discoveryenginepb.ImportDocumentsRequest,opts...gax.CallOption)(*ImportDocumentsOperation,error)ImportDocuments bulk import of multipleDocuments. Request processingmay be synchronous. Non-existing items are created.
Note: It is possible for a subset of theDocuments to be successfullyupdated.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDocumentClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ImportDocumentsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ImportDocumentsRequest.}op,err:=c.ImportDocuments(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DocumentClient) ImportDocumentsOperation
func(c*DocumentClient)ImportDocumentsOperation(namestring)*ImportDocumentsOperationImportDocumentsOperation returns a new ImportDocumentsOperation from a given name.The name must be that of a previously created ImportDocumentsOperation, possibly from a different process.
func (*DocumentClient) ListDocuments
func(c*DocumentClient)ListDocuments(ctxcontext.Context,req*discoveryenginepb.ListDocumentsRequest,opts...gax.CallOption)*DocumentIteratorListDocuments gets a list of Documents.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDocumentClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListDocumentsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListDocumentsRequest.}it:=c.ListDocuments(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*discoveryenginepb.ListDocumentsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDocumentClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListDocumentsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListDocumentsRequest.}forresp,err:=rangec.ListDocuments(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*DocumentClient) ListOperations
func(c*DocumentClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDocumentClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDocumentClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*DocumentClient) PurgeDocuments
func(c*DocumentClient)PurgeDocuments(ctxcontext.Context,req*discoveryenginepb.PurgeDocumentsRequest,opts...gax.CallOption)(*PurgeDocumentsOperation,error)PurgeDocuments permanently deletes all selectedDocuments in a branch.
This process is asynchronous. Depending on the number ofDocuments to be deleted, thisoperation can take hours to complete. Before the delete operationcompletes, some Documents mightstill be returned byDocumentService.GetDocumentorDocumentService.ListDocuments.
To get a list of the Documentsto be deleted, setPurgeDocumentsRequest.forceto false.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDocumentClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.PurgeDocumentsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#PurgeDocumentsRequest.}op,err:=c.PurgeDocuments(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DocumentClient) PurgeDocumentsOperation
func(c*DocumentClient)PurgeDocumentsOperation(namestring)*PurgeDocumentsOperationPurgeDocumentsOperation returns a new PurgeDocumentsOperation from a given name.The name must be that of a previously created PurgeDocumentsOperation, possibly from a different process.
func (*DocumentClient) UpdateDocument
func(c*DocumentClient)UpdateDocument(ctxcontext.Context,req*discoveryenginepb.UpdateDocumentRequest,opts...gax.CallOption)(*discoveryenginepb.Document,error)UpdateDocument updates a Document.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewDocumentClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.UpdateDocumentRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#UpdateDocumentRequest.}resp,err:=c.UpdateDocument(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}DocumentIterator
typeDocumentIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*discoveryenginepb.Document,nextPageTokenstring,errerror)// contains filtered or unexported fields}DocumentIterator manages a stream of *discoveryenginepb.Document.
func (*DocumentIterator) All
func(it*DocumentIterator)All()iter.Seq2[*discoveryenginepb.Document,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*DocumentIterator) Next
func(it*DocumentIterator)Next()(*discoveryenginepb.Document,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*DocumentIterator) PageInfo
func(it*DocumentIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
EnableAdvancedSiteSearchOperation
typeEnableAdvancedSiteSearchOperationstruct{// contains filtered or unexported fields}EnableAdvancedSiteSearchOperation manages a long-running operation from EnableAdvancedSiteSearch.
func (*EnableAdvancedSiteSearchOperation) Done
func(op*EnableAdvancedSiteSearchOperation)Done()boolDone reports whether the long-running operation has completed.
func (*EnableAdvancedSiteSearchOperation) Metadata
func(op*EnableAdvancedSiteSearchOperation)Metadata()(*discoveryenginepb.EnableAdvancedSiteSearchMetadata,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 (*EnableAdvancedSiteSearchOperation) Name
func(op*EnableAdvancedSiteSearchOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*EnableAdvancedSiteSearchOperation) Poll
func(op*EnableAdvancedSiteSearchOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.EnableAdvancedSiteSearchResponse,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 andthe 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 (*EnableAdvancedSiteSearchOperation) Wait
func(op*EnableAdvancedSiteSearchOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.EnableAdvancedSiteSearchResponse,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.
EngineCallOptions
typeEngineCallOptionsstruct{CreateEngine[]gax.CallOptionDeleteEngine[]gax.CallOptionUpdateEngine[]gax.CallOptionGetEngine[]gax.CallOptionListEngines[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}EngineCallOptions contains the retry settings for each method of EngineClient.
EngineClient
typeEngineClientstruct{// The call options for this service.CallOptions*EngineCallOptions// 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}EngineClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing Engineconfiguration.
func NewEngineClient
funcNewEngineClient(ctxcontext.Context,opts...option.ClientOption)(*EngineClient,error)NewEngineClient creates a new engine service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing Engineconfiguration.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewEngineRESTClient
funcNewEngineRESTClient(ctxcontext.Context,opts...option.ClientOption)(*EngineClient,error)NewEngineRESTClient creates a new engine service rest client.
Service for managing Engineconfiguration.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewEngineRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*EngineClient) CancelOperation
func(c*EngineClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*EngineClient) Close
func(c*EngineClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*EngineClient) Connection (deprecated)
func(c*EngineClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*EngineClient) CreateEngine
func(c*EngineClient)CreateEngine(ctxcontext.Context,req*discoveryenginepb.CreateEngineRequest,opts...gax.CallOption)(*CreateEngineOperation,error)CreateEngine creates a Engine.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.CreateEngineRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#CreateEngineRequest.}op,err:=c.CreateEngine(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*EngineClient) CreateEngineOperation
func(c*EngineClient)CreateEngineOperation(namestring)*CreateEngineOperationCreateEngineOperation returns a new CreateEngineOperation from a given name.The name must be that of a previously created CreateEngineOperation, possibly from a different process.
func (*EngineClient) DeleteEngine
func(c*EngineClient)DeleteEngine(ctxcontext.Context,req*discoveryenginepb.DeleteEngineRequest,opts...gax.CallOption)(*DeleteEngineOperation,error)DeleteEngine deletes a Engine.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.DeleteEngineRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#DeleteEngineRequest.}op,err:=c.DeleteEngine(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*EngineClient) DeleteEngineOperation
func(c*EngineClient)DeleteEngineOperation(namestring)*DeleteEngineOperationDeleteEngineOperation returns a new DeleteEngineOperation from a given name.The name must be that of a previously created DeleteEngineOperation, possibly from a different process.
func (*EngineClient) GetEngine
func(c*EngineClient)GetEngine(ctxcontext.Context,req*discoveryenginepb.GetEngineRequest,opts...gax.CallOption)(*discoveryenginepb.Engine,error)GetEngine gets a Engine.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.GetEngineRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#GetEngineRequest.}resp,err:=c.GetEngine(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*EngineClient) GetOperation
func(c*EngineClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*EngineClient) ListEngines
func(c*EngineClient)ListEngines(ctxcontext.Context,req*discoveryenginepb.ListEnginesRequest,opts...gax.CallOption)*EngineIteratorListEngines lists all the Engines associatedwith the project.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListEnginesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListEnginesRequest.}it:=c.ListEngines(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*discoveryenginepb.ListEnginesResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListEnginesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListEnginesRequest.}forresp,err:=rangec.ListEngines(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*EngineClient) ListOperations
func(c*EngineClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*EngineClient) UpdateEngine
func(c*EngineClient)UpdateEngine(ctxcontext.Context,req*discoveryenginepb.UpdateEngineRequest,opts...gax.CallOption)(*discoveryenginepb.Engine,error)UpdateEngine updates an Engine
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.UpdateEngineRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#UpdateEngineRequest.}resp,err:=c.UpdateEngine(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}EngineIterator
typeEngineIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*discoveryenginepb.Engine,nextPageTokenstring,errerror)// contains filtered or unexported fields}EngineIterator manages a stream of *discoveryenginepb.Engine.
func (*EngineIterator) All
func(it*EngineIterator)All()iter.Seq2[*discoveryenginepb.Engine,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*EngineIterator) Next
func(it*EngineIterator)Next()(*discoveryenginepb.Engine,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*EngineIterator) PageInfo
func(it*EngineIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
GroundedGenerationCallOptions
typeGroundedGenerationCallOptionsstruct{StreamGenerateGroundedContent[]gax.CallOptionGenerateGroundedContent[]gax.CallOptionCheckGrounding[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}GroundedGenerationCallOptions contains the retry settings for each method of GroundedGenerationClient.
GroundedGenerationClient
typeGroundedGenerationClientstruct{// The call options for this service.CallOptions*GroundedGenerationCallOptions// contains filtered or unexported fields}GroundedGenerationClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for grounded generation.
func NewGroundedGenerationClient
funcNewGroundedGenerationClient(ctxcontext.Context,opts...option.ClientOption)(*GroundedGenerationClient,error)NewGroundedGenerationClient creates a new grounded generation service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for grounded generation.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewGroundedGenerationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewGroundedGenerationRESTClient
funcNewGroundedGenerationRESTClient(ctxcontext.Context,opts...option.ClientOption)(*GroundedGenerationClient,error)NewGroundedGenerationRESTClient creates a new grounded generation service rest client.
Service for grounded generation.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewGroundedGenerationRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*GroundedGenerationClient) CancelOperation
func(c*GroundedGenerationClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewGroundedGenerationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*GroundedGenerationClient) CheckGrounding
func(c*GroundedGenerationClient)CheckGrounding(ctxcontext.Context,req*discoveryenginepb.CheckGroundingRequest,opts...gax.CallOption)(*discoveryenginepb.CheckGroundingResponse,error)CheckGrounding performs a grounding check.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewGroundedGenerationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.CheckGroundingRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#CheckGroundingRequest.}resp,err:=c.CheckGrounding(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*GroundedGenerationClient) Close
func(c*GroundedGenerationClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*GroundedGenerationClient) Connection (deprecated)
func(c*GroundedGenerationClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*GroundedGenerationClient) GenerateGroundedContent
func(c*GroundedGenerationClient)GenerateGroundedContent(ctxcontext.Context,req*discoveryenginepb.GenerateGroundedContentRequest,opts...gax.CallOption)(*discoveryenginepb.GenerateGroundedContentResponse,error)GenerateGroundedContent generates grounded content.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewGroundedGenerationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.GenerateGroundedContentRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#GenerateGroundedContentRequest.}resp,err:=c.GenerateGroundedContent(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*GroundedGenerationClient) GetOperation
func(c*GroundedGenerationClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewGroundedGenerationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*GroundedGenerationClient) ListOperations
func(c*GroundedGenerationClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewGroundedGenerationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewGroundedGenerationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*GroundedGenerationClient) StreamGenerateGroundedContent
func(c*GroundedGenerationClient)StreamGenerateGroundedContent(ctxcontext.Context,opts...gax.CallOption)(discoveryenginepb.GroundedGenerationService_StreamGenerateGroundedContentClient,error)StreamGenerateGroundedContent generates grounded content in a streaming fashion.
This method is not supported for the REST transport.
Example
packagemainimport("context""io"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewGroundedGenerationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()stream,err:=c.StreamGenerateGroundedContent(ctx)iferr!=nil{// TODO: Handle error.}gofunc(){reqs:=[]*discoveryenginepb.GenerateGroundedContentRequest{// TODO: Create requests.}for_,req:=rangereqs{iferr:=stream.Send(req);err!=nil{// TODO: Handle error.}}stream.CloseSend()}()for{resp,err:=stream.Recv()iferr==io.EOF{break}iferr!=nil{// TODO: handle error.}// TODO: Use resp._=resp}}IdentityMappingEntryIterator
typeIdentityMappingEntryIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*discoveryenginepb.IdentityMappingEntry,nextPageTokenstring,errerror)// contains filtered or unexported fields}IdentityMappingEntryIterator manages a stream of *discoveryenginepb.IdentityMappingEntry.
func (*IdentityMappingEntryIterator) All
func(it*IdentityMappingEntryIterator)All()iter.Seq2[*discoveryenginepb.IdentityMappingEntry,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*IdentityMappingEntryIterator) Next
func(it*IdentityMappingEntryIterator)Next()(*discoveryenginepb.IdentityMappingEntry,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*IdentityMappingEntryIterator) PageInfo
func(it*IdentityMappingEntryIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
IdentityMappingStoreCallOptions
typeIdentityMappingStoreCallOptionsstruct{CreateIdentityMappingStore[]gax.CallOptionGetIdentityMappingStore[]gax.CallOptionDeleteIdentityMappingStore[]gax.CallOptionImportIdentityMappings[]gax.CallOptionPurgeIdentityMappings[]gax.CallOptionListIdentityMappings[]gax.CallOptionListIdentityMappingStores[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}IdentityMappingStoreCallOptions contains the retry settings for each method of IdentityMappingStoreClient.
IdentityMappingStoreClient
typeIdentityMappingStoreClientstruct{// The call options for this service.CallOptions*IdentityMappingStoreCallOptions// 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}IdentityMappingStoreClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing Identity Mapping Stores.
func NewIdentityMappingStoreClient
funcNewIdentityMappingStoreClient(ctxcontext.Context,opts...option.ClientOption)(*IdentityMappingStoreClient,error)NewIdentityMappingStoreClient creates a new identity mapping store service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing Identity Mapping Stores.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewIdentityMappingStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewIdentityMappingStoreRESTClient
funcNewIdentityMappingStoreRESTClient(ctxcontext.Context,opts...option.ClientOption)(*IdentityMappingStoreClient,error)NewIdentityMappingStoreRESTClient creates a new identity mapping store service rest client.
Service for managing Identity Mapping Stores.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewIdentityMappingStoreRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*IdentityMappingStoreClient) CancelOperation
func(c*IdentityMappingStoreClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewIdentityMappingStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*IdentityMappingStoreClient) Close
func(c*IdentityMappingStoreClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*IdentityMappingStoreClient) Connection (deprecated)
func(c*IdentityMappingStoreClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*IdentityMappingStoreClient) CreateIdentityMappingStore
func(c*IdentityMappingStoreClient)CreateIdentityMappingStore(ctxcontext.Context,req*discoveryenginepb.CreateIdentityMappingStoreRequest,opts...gax.CallOption)(*discoveryenginepb.IdentityMappingStore,error)CreateIdentityMappingStore creates a new Identity Mapping Store.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewIdentityMappingStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.CreateIdentityMappingStoreRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#CreateIdentityMappingStoreRequest.}resp,err:=c.CreateIdentityMappingStore(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*IdentityMappingStoreClient) DeleteIdentityMappingStore
func(c*IdentityMappingStoreClient)DeleteIdentityMappingStore(ctxcontext.Context,req*discoveryenginepb.DeleteIdentityMappingStoreRequest,opts...gax.CallOption)(*DeleteIdentityMappingStoreOperation,error)DeleteIdentityMappingStore deletes the Identity Mapping Store.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewIdentityMappingStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.DeleteIdentityMappingStoreRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#DeleteIdentityMappingStoreRequest.}op,err:=c.DeleteIdentityMappingStore(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*IdentityMappingStoreClient) DeleteIdentityMappingStoreOperation
func(c*IdentityMappingStoreClient)DeleteIdentityMappingStoreOperation(namestring)*DeleteIdentityMappingStoreOperationDeleteIdentityMappingStoreOperation returns a new DeleteIdentityMappingStoreOperation from a given name.The name must be that of a previously created DeleteIdentityMappingStoreOperation, possibly from a different process.
func (*IdentityMappingStoreClient) GetIdentityMappingStore
func(c*IdentityMappingStoreClient)GetIdentityMappingStore(ctxcontext.Context,req*discoveryenginepb.GetIdentityMappingStoreRequest,opts...gax.CallOption)(*discoveryenginepb.IdentityMappingStore,error)GetIdentityMappingStore gets the Identity Mapping Store.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewIdentityMappingStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.GetIdentityMappingStoreRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#GetIdentityMappingStoreRequest.}resp,err:=c.GetIdentityMappingStore(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*IdentityMappingStoreClient) GetOperation
func(c*IdentityMappingStoreClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewIdentityMappingStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*IdentityMappingStoreClient) ImportIdentityMappings
func(c*IdentityMappingStoreClient)ImportIdentityMappings(ctxcontext.Context,req*discoveryenginepb.ImportIdentityMappingsRequest,opts...gax.CallOption)(*ImportIdentityMappingsOperation,error)ImportIdentityMappings imports a list of Identity Mapping Entries to an Identity Mapping Store.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewIdentityMappingStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ImportIdentityMappingsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ImportIdentityMappingsRequest.}op,err:=c.ImportIdentityMappings(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*IdentityMappingStoreClient) ImportIdentityMappingsOperation
func(c*IdentityMappingStoreClient)ImportIdentityMappingsOperation(namestring)*ImportIdentityMappingsOperationImportIdentityMappingsOperation returns a new ImportIdentityMappingsOperation from a given name.The name must be that of a previously created ImportIdentityMappingsOperation, possibly from a different process.
func (*IdentityMappingStoreClient) ListIdentityMappingStores
func(c*IdentityMappingStoreClient)ListIdentityMappingStores(ctxcontext.Context,req*discoveryenginepb.ListIdentityMappingStoresRequest,opts...gax.CallOption)*IdentityMappingStoreIteratorListIdentityMappingStores lists all Identity Mapping Stores.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewIdentityMappingStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListIdentityMappingStoresRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListIdentityMappingStoresRequest.}it:=c.ListIdentityMappingStores(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*discoveryenginepb.ListIdentityMappingStoresResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewIdentityMappingStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListIdentityMappingStoresRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListIdentityMappingStoresRequest.}forresp,err:=rangec.ListIdentityMappingStores(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*IdentityMappingStoreClient) ListIdentityMappings
func(c*IdentityMappingStoreClient)ListIdentityMappings(ctxcontext.Context,req*discoveryenginepb.ListIdentityMappingsRequest,opts...gax.CallOption)*IdentityMappingEntryIteratorListIdentityMappings lists Identity Mappings in an Identity Mapping Store.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewIdentityMappingStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListIdentityMappingsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListIdentityMappingsRequest.}it:=c.ListIdentityMappings(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*discoveryenginepb.ListIdentityMappingsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewIdentityMappingStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListIdentityMappingsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListIdentityMappingsRequest.}forresp,err:=rangec.ListIdentityMappings(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*IdentityMappingStoreClient) ListOperations
func(c*IdentityMappingStoreClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewIdentityMappingStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewIdentityMappingStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*IdentityMappingStoreClient) PurgeIdentityMappings
func(c*IdentityMappingStoreClient)PurgeIdentityMappings(ctxcontext.Context,req*discoveryenginepb.PurgeIdentityMappingsRequest,opts...gax.CallOption)(*PurgeIdentityMappingsOperation,error)PurgeIdentityMappings purges specified or all Identity Mapping Entries from an Identity MappingStore.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewIdentityMappingStoreClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.PurgeIdentityMappingsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#PurgeIdentityMappingsRequest.}op,err:=c.PurgeIdentityMappings(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*IdentityMappingStoreClient) PurgeIdentityMappingsOperation
func(c*IdentityMappingStoreClient)PurgeIdentityMappingsOperation(namestring)*PurgeIdentityMappingsOperationPurgeIdentityMappingsOperation returns a new PurgeIdentityMappingsOperation from a given name.The name must be that of a previously created PurgeIdentityMappingsOperation, possibly from a different process.
IdentityMappingStoreIterator
typeIdentityMappingStoreIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*discoveryenginepb.IdentityMappingStore,nextPageTokenstring,errerror)// contains filtered or unexported fields}IdentityMappingStoreIterator manages a stream of *discoveryenginepb.IdentityMappingStore.
func (*IdentityMappingStoreIterator) All
func(it*IdentityMappingStoreIterator)All()iter.Seq2[*discoveryenginepb.IdentityMappingStore,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*IdentityMappingStoreIterator) Next
func(it*IdentityMappingStoreIterator)Next()(*discoveryenginepb.IdentityMappingStore,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*IdentityMappingStoreIterator) PageInfo
func(it*IdentityMappingStoreIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ImportCompletionSuggestionsOperation
typeImportCompletionSuggestionsOperationstruct{// contains filtered or unexported fields}ImportCompletionSuggestionsOperation manages a long-running operation from ImportCompletionSuggestions.
func (*ImportCompletionSuggestionsOperation) Done
func(op*ImportCompletionSuggestionsOperation)Done()boolDone reports whether the long-running operation has completed.
func (*ImportCompletionSuggestionsOperation) Metadata
func(op*ImportCompletionSuggestionsOperation)Metadata()(*discoveryenginepb.ImportCompletionSuggestionsMetadata,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 (*ImportCompletionSuggestionsOperation) Name
func(op*ImportCompletionSuggestionsOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*ImportCompletionSuggestionsOperation) Poll
func(op*ImportCompletionSuggestionsOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.ImportCompletionSuggestionsResponse,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 andthe 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 (*ImportCompletionSuggestionsOperation) Wait
func(op*ImportCompletionSuggestionsOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.ImportCompletionSuggestionsResponse,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.
ImportDocumentsOperation
typeImportDocumentsOperationstruct{// contains filtered or unexported fields}ImportDocumentsOperation manages a long-running operation from ImportDocuments.
func (*ImportDocumentsOperation) Done
func(op*ImportDocumentsOperation)Done()boolDone reports whether the long-running operation has completed.
func (*ImportDocumentsOperation) Metadata
func(op*ImportDocumentsOperation)Metadata()(*discoveryenginepb.ImportDocumentsMetadata,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 (*ImportDocumentsOperation) Name
func(op*ImportDocumentsOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*ImportDocumentsOperation) Poll
func(op*ImportDocumentsOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.ImportDocumentsResponse,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 andthe 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 (*ImportDocumentsOperation) Wait
func(op*ImportDocumentsOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.ImportDocumentsResponse,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.
ImportIdentityMappingsOperation
typeImportIdentityMappingsOperationstruct{// contains filtered or unexported fields}ImportIdentityMappingsOperation manages a long-running operation from ImportIdentityMappings.
func (*ImportIdentityMappingsOperation) Done
func(op*ImportIdentityMappingsOperation)Done()boolDone reports whether the long-running operation has completed.
func (*ImportIdentityMappingsOperation) Metadata
func(op*ImportIdentityMappingsOperation)Metadata()(*discoveryenginepb.IdentityMappingEntryOperationMetadata,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 (*ImportIdentityMappingsOperation) Name
func(op*ImportIdentityMappingsOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*ImportIdentityMappingsOperation) Poll
func(op*ImportIdentityMappingsOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.ImportIdentityMappingsResponse,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 andthe 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 (*ImportIdentityMappingsOperation) Wait
func(op*ImportIdentityMappingsOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.ImportIdentityMappingsResponse,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.
ImportSuggestionDenyListEntriesOperation
typeImportSuggestionDenyListEntriesOperationstruct{// contains filtered or unexported fields}ImportSuggestionDenyListEntriesOperation manages a long-running operation from ImportSuggestionDenyListEntries.
func (*ImportSuggestionDenyListEntriesOperation) Done
func(op*ImportSuggestionDenyListEntriesOperation)Done()boolDone reports whether the long-running operation has completed.
func (*ImportSuggestionDenyListEntriesOperation) Metadata
func(op*ImportSuggestionDenyListEntriesOperation)Metadata()(*discoveryenginepb.ImportSuggestionDenyListEntriesMetadata,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 (*ImportSuggestionDenyListEntriesOperation) Name
func(op*ImportSuggestionDenyListEntriesOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*ImportSuggestionDenyListEntriesOperation) Poll
func(op*ImportSuggestionDenyListEntriesOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.ImportSuggestionDenyListEntriesResponse,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 andthe 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 (*ImportSuggestionDenyListEntriesOperation) Wait
func(op*ImportSuggestionDenyListEntriesOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.ImportSuggestionDenyListEntriesResponse,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.
ImportUserEventsOperation
typeImportUserEventsOperationstruct{// contains filtered or unexported fields}ImportUserEventsOperation manages a long-running operation from ImportUserEvents.
func (*ImportUserEventsOperation) Done
func(op*ImportUserEventsOperation)Done()boolDone reports whether the long-running operation has completed.
func (*ImportUserEventsOperation) Metadata
func(op*ImportUserEventsOperation)Metadata()(*discoveryenginepb.ImportUserEventsMetadata,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 (*ImportUserEventsOperation) Name
func(op*ImportUserEventsOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*ImportUserEventsOperation) Poll
func(op*ImportUserEventsOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.ImportUserEventsResponse,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 andthe 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 (*ImportUserEventsOperation) Wait
func(op*ImportUserEventsOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.ImportUserEventsResponse,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.
OperationIterator
typeOperationIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*longrunningpb.Operation,nextPageTokenstring,errerror)// 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, theiterator 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 moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo
func(it*OperationIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ProjectCallOptions
typeProjectCallOptionsstruct{ProvisionProject[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}ProjectCallOptions contains the retry settings for each method of ProjectClient.
ProjectClient
typeProjectClientstruct{// The call options for this service.CallOptions*ProjectCallOptions// 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}ProjectClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for operations on theProject.
func NewProjectClient
funcNewProjectClient(ctxcontext.Context,opts...option.ClientOption)(*ProjectClient,error)NewProjectClient creates a new project service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for operations on theProject.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewProjectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewProjectRESTClient
funcNewProjectRESTClient(ctxcontext.Context,opts...option.ClientOption)(*ProjectClient,error)NewProjectRESTClient creates a new project service rest client.
Service for operations on theProject.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewProjectRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*ProjectClient) CancelOperation
func(c*ProjectClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewProjectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*ProjectClient) Close
func(c*ProjectClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*ProjectClient) Connection (deprecated)
func(c*ProjectClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*ProjectClient) GetOperation
func(c*ProjectClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewProjectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ProjectClient) ListOperations
func(c*ProjectClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewProjectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewProjectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*ProjectClient) ProvisionProject
func(c*ProjectClient)ProvisionProject(ctxcontext.Context,req*discoveryenginepb.ProvisionProjectRequest,opts...gax.CallOption)(*ProvisionProjectOperation,error)ProvisionProject provisions the project resource. During theprocess, related systems will get prepared and initialized.
Caller must read the Terms for datause (athttps://cloud.google.com/retail/data-use-terms), and optionallyspecify in request to provide consent to that service terms.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewProjectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ProvisionProjectRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ProvisionProjectRequest.}op,err:=c.ProvisionProject(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ProjectClient) ProvisionProjectOperation
func(c*ProjectClient)ProvisionProjectOperation(namestring)*ProvisionProjectOperationProvisionProjectOperation returns a new ProvisionProjectOperation from a given name.The name must be that of a previously created ProvisionProjectOperation, possibly from a different process.
ProvisionProjectOperation
typeProvisionProjectOperationstruct{// contains filtered or unexported fields}ProvisionProjectOperation manages a long-running operation from ProvisionProject.
func (*ProvisionProjectOperation) Done
func(op*ProvisionProjectOperation)Done()boolDone reports whether the long-running operation has completed.
func (*ProvisionProjectOperation) Metadata
func(op*ProvisionProjectOperation)Metadata()(*discoveryenginepb.ProvisionProjectMetadata,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 (*ProvisionProjectOperation) Name
func(op*ProvisionProjectOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*ProvisionProjectOperation) Poll
func(op*ProvisionProjectOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.Project,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 andthe 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 (*ProvisionProjectOperation) Wait
func(op*ProvisionProjectOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.Project,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.
PurgeCompletionSuggestionsOperation
typePurgeCompletionSuggestionsOperationstruct{// contains filtered or unexported fields}PurgeCompletionSuggestionsOperation manages a long-running operation from PurgeCompletionSuggestions.
func (*PurgeCompletionSuggestionsOperation) Done
func(op*PurgeCompletionSuggestionsOperation)Done()boolDone reports whether the long-running operation has completed.
func (*PurgeCompletionSuggestionsOperation) Metadata
func(op*PurgeCompletionSuggestionsOperation)Metadata()(*discoveryenginepb.PurgeCompletionSuggestionsMetadata,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 (*PurgeCompletionSuggestionsOperation) Name
func(op*PurgeCompletionSuggestionsOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*PurgeCompletionSuggestionsOperation) Poll
func(op*PurgeCompletionSuggestionsOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.PurgeCompletionSuggestionsResponse,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 andthe 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 (*PurgeCompletionSuggestionsOperation) Wait
func(op*PurgeCompletionSuggestionsOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.PurgeCompletionSuggestionsResponse,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.
PurgeDocumentsOperation
typePurgeDocumentsOperationstruct{// contains filtered or unexported fields}PurgeDocumentsOperation manages a long-running operation from PurgeDocuments.
func (*PurgeDocumentsOperation) Done
func(op*PurgeDocumentsOperation)Done()boolDone reports whether the long-running operation has completed.
func (*PurgeDocumentsOperation) Metadata
func(op*PurgeDocumentsOperation)Metadata()(*discoveryenginepb.PurgeDocumentsMetadata,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 (*PurgeDocumentsOperation) Name
func(op*PurgeDocumentsOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*PurgeDocumentsOperation) Poll
func(op*PurgeDocumentsOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.PurgeDocumentsResponse,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 andthe 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 (*PurgeDocumentsOperation) Wait
func(op*PurgeDocumentsOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.PurgeDocumentsResponse,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.
PurgeIdentityMappingsOperation
typePurgeIdentityMappingsOperationstruct{// contains filtered or unexported fields}PurgeIdentityMappingsOperation manages a long-running operation from PurgeIdentityMappings.
func (*PurgeIdentityMappingsOperation) Done
func(op*PurgeIdentityMappingsOperation)Done()boolDone reports whether the long-running operation has completed.
func (*PurgeIdentityMappingsOperation) Metadata
func(op*PurgeIdentityMappingsOperation)Metadata()(*discoveryenginepb.IdentityMappingEntryOperationMetadata,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 (*PurgeIdentityMappingsOperation) Name
func(op*PurgeIdentityMappingsOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*PurgeIdentityMappingsOperation) Poll
func(op*PurgeIdentityMappingsOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe 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 (*PurgeIdentityMappingsOperation) Wait
func(op*PurgeIdentityMappingsOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
PurgeSuggestionDenyListEntriesOperation
typePurgeSuggestionDenyListEntriesOperationstruct{// contains filtered or unexported fields}PurgeSuggestionDenyListEntriesOperation manages a long-running operation from PurgeSuggestionDenyListEntries.
func (*PurgeSuggestionDenyListEntriesOperation) Done
func(op*PurgeSuggestionDenyListEntriesOperation)Done()boolDone reports whether the long-running operation has completed.
func (*PurgeSuggestionDenyListEntriesOperation) Metadata
func(op*PurgeSuggestionDenyListEntriesOperation)Metadata()(*discoveryenginepb.PurgeSuggestionDenyListEntriesMetadata,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 (*PurgeSuggestionDenyListEntriesOperation) Name
func(op*PurgeSuggestionDenyListEntriesOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*PurgeSuggestionDenyListEntriesOperation) Poll
func(op*PurgeSuggestionDenyListEntriesOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.PurgeSuggestionDenyListEntriesResponse,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 andthe 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 (*PurgeSuggestionDenyListEntriesOperation) Wait
func(op*PurgeSuggestionDenyListEntriesOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.PurgeSuggestionDenyListEntriesResponse,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.
PurgeUserEventsOperation
typePurgeUserEventsOperationstruct{// contains filtered or unexported fields}PurgeUserEventsOperation manages a long-running operation from PurgeUserEvents.
func (*PurgeUserEventsOperation) Done
func(op*PurgeUserEventsOperation)Done()boolDone reports whether the long-running operation has completed.
func (*PurgeUserEventsOperation) Metadata
func(op*PurgeUserEventsOperation)Metadata()(*discoveryenginepb.PurgeUserEventsMetadata,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 (*PurgeUserEventsOperation) Name
func(op*PurgeUserEventsOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*PurgeUserEventsOperation) Poll
func(op*PurgeUserEventsOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.PurgeUserEventsResponse,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 andthe 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 (*PurgeUserEventsOperation) Wait
func(op*PurgeUserEventsOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.PurgeUserEventsResponse,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.
RankCallOptions
typeRankCallOptionsstruct{Rank[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}RankCallOptions contains the retry settings for each method of RankClient.
RankClient
typeRankClientstruct{// The call options for this service.CallOptions*RankCallOptions// contains filtered or unexported fields}RankClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for ranking text records.
func NewRankClient
funcNewRankClient(ctxcontext.Context,opts...option.ClientOption)(*RankClient,error)NewRankClient creates a new rank service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for ranking text records.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewRankClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewRankRESTClient
funcNewRankRESTClient(ctxcontext.Context,opts...option.ClientOption)(*RankClient,error)NewRankRESTClient creates a new rank service rest client.
Service for ranking text records.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewRankRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*RankClient) CancelOperation
func(c*RankClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewRankClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*RankClient) Close
func(c*RankClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*RankClient) Connection (deprecated)
func(c*RankClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*RankClient) GetOperation
func(c*RankClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewRankClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*RankClient) ListOperations
func(c*RankClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewRankClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewRankClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*RankClient) Rank
func(c*RankClient)Rank(ctxcontext.Context,req*discoveryenginepb.RankRequest,opts...gax.CallOption)(*discoveryenginepb.RankResponse,error)Rank ranks a list of text records based on the given input query.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewRankClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.RankRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#RankRequest.}resp,err:=c.Rank(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}RecommendationCallOptions
typeRecommendationCallOptionsstruct{Recommend[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}RecommendationCallOptions contains the retry settings for each method of RecommendationClient.
RecommendationClient
typeRecommendationClientstruct{// The call options for this service.CallOptions*RecommendationCallOptions// contains filtered or unexported fields}RecommendationClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for making recommendations.
func NewRecommendationClient
funcNewRecommendationClient(ctxcontext.Context,opts...option.ClientOption)(*RecommendationClient,error)NewRecommendationClient creates a new recommendation service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for making recommendations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewRecommendationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewRecommendationRESTClient
funcNewRecommendationRESTClient(ctxcontext.Context,opts...option.ClientOption)(*RecommendationClient,error)NewRecommendationRESTClient creates a new recommendation service rest client.
Service for making recommendations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewRecommendationRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*RecommendationClient) CancelOperation
func(c*RecommendationClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewRecommendationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*RecommendationClient) Close
func(c*RecommendationClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*RecommendationClient) Connection (deprecated)
func(c*RecommendationClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*RecommendationClient) GetOperation
func(c*RecommendationClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewRecommendationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*RecommendationClient) ListOperations
func(c*RecommendationClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewRecommendationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewRecommendationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*RecommendationClient) Recommend
func(c*RecommendationClient)Recommend(ctxcontext.Context,req*discoveryenginepb.RecommendRequest,opts...gax.CallOption)(*discoveryenginepb.RecommendResponse,error)Recommend makes a recommendation, which requires a contextual user event.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewRecommendationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.RecommendRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#RecommendRequest.}resp,err:=c.Recommend(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}RecrawlUrisOperation
typeRecrawlUrisOperationstruct{// contains filtered or unexported fields}RecrawlUrisOperation manages a long-running operation from RecrawlUris.
func (*RecrawlUrisOperation) Done
func(op*RecrawlUrisOperation)Done()boolDone reports whether the long-running operation has completed.
func (*RecrawlUrisOperation) Metadata
func(op*RecrawlUrisOperation)Metadata()(*discoveryenginepb.RecrawlUrisMetadata,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 (*RecrawlUrisOperation) Name
func(op*RecrawlUrisOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*RecrawlUrisOperation) Poll
func(op*RecrawlUrisOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.RecrawlUrisResponse,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 andthe 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 (*RecrawlUrisOperation) Wait
func(op*RecrawlUrisOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.RecrawlUrisResponse,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.
SchemaCallOptions
typeSchemaCallOptionsstruct{GetSchema[]gax.CallOptionListSchemas[]gax.CallOptionCreateSchema[]gax.CallOptionUpdateSchema[]gax.CallOptionDeleteSchema[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}SchemaCallOptions contains the retry settings for each method of SchemaClient.
SchemaClient
typeSchemaClientstruct{// The call options for this service.CallOptions*SchemaCallOptions// 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}SchemaClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing Schemas.
func NewSchemaClient
funcNewSchemaClient(ctxcontext.Context,opts...option.ClientOption)(*SchemaClient,error)NewSchemaClient creates a new schema service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing Schemas.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSchemaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewSchemaRESTClient
funcNewSchemaRESTClient(ctxcontext.Context,opts...option.ClientOption)(*SchemaClient,error)NewSchemaRESTClient creates a new schema service rest client.
Service for managing Schemas.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSchemaRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*SchemaClient) CancelOperation
func(c*SchemaClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSchemaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*SchemaClient) Close
func(c*SchemaClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*SchemaClient) Connection (deprecated)
func(c*SchemaClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*SchemaClient) CreateSchema
func(c*SchemaClient)CreateSchema(ctxcontext.Context,req*discoveryenginepb.CreateSchemaRequest,opts...gax.CallOption)(*CreateSchemaOperation,error)CreateSchema creates a Schema.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSchemaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.CreateSchemaRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#CreateSchemaRequest.}op,err:=c.CreateSchema(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SchemaClient) CreateSchemaOperation
func(c*SchemaClient)CreateSchemaOperation(namestring)*CreateSchemaOperationCreateSchemaOperation returns a new CreateSchemaOperation from a given name.The name must be that of a previously created CreateSchemaOperation, possibly from a different process.
func (*SchemaClient) DeleteSchema
func(c*SchemaClient)DeleteSchema(ctxcontext.Context,req*discoveryenginepb.DeleteSchemaRequest,opts...gax.CallOption)(*DeleteSchemaOperation,error)DeleteSchema deletes a Schema.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSchemaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.DeleteSchemaRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#DeleteSchemaRequest.}op,err:=c.DeleteSchema(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*SchemaClient) DeleteSchemaOperation
func(c*SchemaClient)DeleteSchemaOperation(namestring)*DeleteSchemaOperationDeleteSchemaOperation returns a new DeleteSchemaOperation from a given name.The name must be that of a previously created DeleteSchemaOperation, possibly from a different process.
func (*SchemaClient) GetOperation
func(c*SchemaClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSchemaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SchemaClient) GetSchema
func(c*SchemaClient)GetSchema(ctxcontext.Context,req*discoveryenginepb.GetSchemaRequest,opts...gax.CallOption)(*discoveryenginepb.Schema,error)GetSchema gets a Schema.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSchemaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.GetSchemaRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#GetSchemaRequest.}resp,err:=c.GetSchema(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SchemaClient) ListOperations
func(c*SchemaClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSchemaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSchemaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*SchemaClient) ListSchemas
func(c*SchemaClient)ListSchemas(ctxcontext.Context,req*discoveryenginepb.ListSchemasRequest,opts...gax.CallOption)*SchemaIteratorListSchemas gets a list of Schemas.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSchemaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListSchemasRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListSchemasRequest.}it:=c.ListSchemas(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*discoveryenginepb.ListSchemasResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSchemaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListSchemasRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListSchemasRequest.}forresp,err:=rangec.ListSchemas(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*SchemaClient) UpdateSchema
func(c*SchemaClient)UpdateSchema(ctxcontext.Context,req*discoveryenginepb.UpdateSchemaRequest,opts...gax.CallOption)(*UpdateSchemaOperation,error)UpdateSchema updates a Schema.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSchemaClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.UpdateSchemaRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#UpdateSchemaRequest.}op,err:=c.UpdateSchema(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SchemaClient) UpdateSchemaOperation
func(c*SchemaClient)UpdateSchemaOperation(namestring)*UpdateSchemaOperationUpdateSchemaOperation returns a new UpdateSchemaOperation from a given name.The name must be that of a previously created UpdateSchemaOperation, possibly from a different process.
SchemaIterator
typeSchemaIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*discoveryenginepb.Schema,nextPageTokenstring,errerror)// contains filtered or unexported fields}SchemaIterator manages a stream of *discoveryenginepb.Schema.
func (*SchemaIterator) All
func(it*SchemaIterator)All()iter.Seq2[*discoveryenginepb.Schema,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*SchemaIterator) Next
func(it*SchemaIterator)Next()(*discoveryenginepb.Schema,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*SchemaIterator) PageInfo
func(it*SchemaIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
SearchCallOptions
typeSearchCallOptionsstruct{Search[]gax.CallOptionSearchLite[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}SearchCallOptions contains the retry settings for each method of SearchClient.
SearchClient
typeSearchClientstruct{// The call options for this service.CallOptions*SearchCallOptions// contains filtered or unexported fields}SearchClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for search.
func NewSearchClient
funcNewSearchClient(ctxcontext.Context,opts...option.ClientOption)(*SearchClient,error)NewSearchClient creates a new search service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for search.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewSearchRESTClient
funcNewSearchRESTClient(ctxcontext.Context,opts...option.ClientOption)(*SearchClient,error)NewSearchRESTClient creates a new search service rest client.
Service for search.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*SearchClient) CancelOperation
func(c*SearchClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*SearchClient) Close
func(c*SearchClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*SearchClient) Connection (deprecated)
func(c*SearchClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*SearchClient) GetOperation
func(c*SearchClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SearchClient) ListOperations
func(c*SearchClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*SearchClient) Search
func(c*SearchClient)Search(ctxcontext.Context,req*discoveryenginepb.SearchRequest,opts...gax.CallOption)*SearchResponse_SearchResultIteratorSearch performs a search.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.SearchRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#SearchRequest.}it:=c.Search(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*discoveryenginepb.SearchResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.SearchRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#SearchRequest.}forresp,err:=rangec.Search(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*SearchClient) SearchLite
func(c*SearchClient)SearchLite(ctxcontext.Context,req*discoveryenginepb.SearchRequest,opts...gax.CallOption)*SearchResponse_SearchResultIteratorSearchLite performs a search. Similar to theSearchService.Searchmethod, but a lite version that allows API key for authentication, whereOAuth and IAM checks are not required.
Only public website search is supported by this method. If data stores andengines not associated with public website search are specified, aFAILED_PRECONDITION error is returned.
This method can be used for easy onboarding without having to implement anauthentication backend. However, it is strongly recommended to useSearchService.Searchinstead with required OAuth and IAM checks to provide better data security.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.SearchRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#SearchRequest.}it:=c.SearchLite(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*discoveryenginepb.SearchResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.SearchRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#SearchRequest.}forresp,err:=rangec.SearchLite(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}SearchResponse_SearchResultIterator
typeSearchResponse_SearchResultIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*discoveryenginepb.SearchResponse_SearchResult,nextPageTokenstring,errerror)// contains filtered or unexported fields}SearchResponse_SearchResultIterator manages a stream of *discoveryenginepb.SearchResponse_SearchResult.
func (*SearchResponse_SearchResultIterator) All
func(it*SearchResponse_SearchResultIterator)All()iter.Seq2[*discoveryenginepb.SearchResponse_SearchResult,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*SearchResponse_SearchResultIterator) Next
func(it*SearchResponse_SearchResultIterator)Next()(*discoveryenginepb.SearchResponse_SearchResult,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*SearchResponse_SearchResultIterator) PageInfo
func(it*SearchResponse_SearchResultIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
SearchTuningCallOptions
typeSearchTuningCallOptionsstruct{TrainCustomModel[]gax.CallOptionListCustomModels[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}SearchTuningCallOptions contains the retry settings for each method of SearchTuningClient.
SearchTuningClient
typeSearchTuningClientstruct{// The call options for this service.CallOptions*SearchTuningCallOptions// 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}SearchTuningClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for search tuning.
func NewSearchTuningClient
funcNewSearchTuningClient(ctxcontext.Context,opts...option.ClientOption)(*SearchTuningClient,error)NewSearchTuningClient creates a new search tuning service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for search tuning.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchTuningClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewSearchTuningRESTClient
funcNewSearchTuningRESTClient(ctxcontext.Context,opts...option.ClientOption)(*SearchTuningClient,error)NewSearchTuningRESTClient creates a new search tuning service rest client.
Service for search tuning.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchTuningRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*SearchTuningClient) CancelOperation
func(c*SearchTuningClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchTuningClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*SearchTuningClient) Close
func(c*SearchTuningClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*SearchTuningClient) Connection (deprecated)
func(c*SearchTuningClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*SearchTuningClient) GetOperation
func(c*SearchTuningClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchTuningClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SearchTuningClient) ListCustomModels
func(c*SearchTuningClient)ListCustomModels(ctxcontext.Context,req*discoveryenginepb.ListCustomModelsRequest,opts...gax.CallOption)(*discoveryenginepb.ListCustomModelsResponse,error)ListCustomModels gets a list of all the custom models.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchTuningClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListCustomModelsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListCustomModelsRequest.}resp,err:=c.ListCustomModels(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SearchTuningClient) ListOperations
func(c*SearchTuningClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchTuningClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchTuningClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*SearchTuningClient) TrainCustomModel
func(c*SearchTuningClient)TrainCustomModel(ctxcontext.Context,req*discoveryenginepb.TrainCustomModelRequest,opts...gax.CallOption)(*TrainCustomModelOperation,error)TrainCustomModel trains a custom model.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSearchTuningClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.TrainCustomModelRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#TrainCustomModelRequest.}op,err:=c.TrainCustomModel(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SearchTuningClient) TrainCustomModelOperation
func(c*SearchTuningClient)TrainCustomModelOperation(namestring)*TrainCustomModelOperationTrainCustomModelOperation returns a new TrainCustomModelOperation from a given name.The name must be that of a previously created TrainCustomModelOperation, possibly from a different process.
ServingConfigCallOptions
typeServingConfigCallOptionsstruct{UpdateServingConfig[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}ServingConfigCallOptions contains the retry settings for each method of ServingConfigClient.
ServingConfigClient
typeServingConfigClientstruct{// The call options for this service.CallOptions*ServingConfigCallOptions// contains filtered or unexported fields}ServingConfigClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for operations related toServingConfig.
func NewServingConfigClient
funcNewServingConfigClient(ctxcontext.Context,opts...option.ClientOption)(*ServingConfigClient,error)NewServingConfigClient creates a new serving config service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for operations related toServingConfig.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewServingConfigClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewServingConfigRESTClient
funcNewServingConfigRESTClient(ctxcontext.Context,opts...option.ClientOption)(*ServingConfigClient,error)NewServingConfigRESTClient creates a new serving config service rest client.
Service for operations related toServingConfig.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewServingConfigRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*ServingConfigClient) CancelOperation
func(c*ServingConfigClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewServingConfigClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*ServingConfigClient) Close
func(c*ServingConfigClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*ServingConfigClient) Connection (deprecated)
func(c*ServingConfigClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*ServingConfigClient) GetOperation
func(c*ServingConfigClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewServingConfigClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ServingConfigClient) ListOperations
func(c*ServingConfigClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewServingConfigClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewServingConfigClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*ServingConfigClient) UpdateServingConfig
func(c*ServingConfigClient)UpdateServingConfig(ctxcontext.Context,req*discoveryenginepb.UpdateServingConfigRequest,opts...gax.CallOption)(*discoveryenginepb.ServingConfig,error)UpdateServingConfig updates a ServingConfig.
Returns a NOT_FOUND error if the ServingConfig does not exist.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewServingConfigClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.UpdateServingConfigRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#UpdateServingConfigRequest.}resp,err:=c.UpdateServingConfig(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}SessionCallOptions
typeSessionCallOptionsstruct{CreateSession[]gax.CallOptionDeleteSession[]gax.CallOptionUpdateSession[]gax.CallOptionGetSession[]gax.CallOptionListSessions[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}SessionCallOptions contains the retry settings for each method of SessionClient.
SessionClient
typeSessionClientstruct{// The call options for this service.CallOptions*SessionCallOptions// contains filtered or unexported fields}SessionClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing Sessions and Session-related resources.
func NewSessionClient
funcNewSessionClient(ctxcontext.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.
Service for managing Sessions and Session-related resources.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSessionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewSessionRESTClient
funcNewSessionRESTClient(ctxcontext.Context,opts...option.ClientOption)(*SessionClient,error)NewSessionRESTClient creates a new session service rest client.
Service for managing Sessions and Session-related resources.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSessionRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*SessionClient) CancelOperation
func(c*SessionClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSessionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*SessionClient) Close
func(c*SessionClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*SessionClient) Connection (deprecated)
func(c*SessionClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*SessionClient) CreateSession
func(c*SessionClient)CreateSession(ctxcontext.Context,req*discoveryenginepb.CreateSessionRequest,opts...gax.CallOption)(*discoveryenginepb.Session,error)CreateSession creates a Session.
If the Session to create alreadyexists, an ALREADY_EXISTS error is returned.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSessionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.CreateSessionRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#CreateSessionRequest.}resp,err:=c.CreateSession(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SessionClient) DeleteSession
func(c*SessionClient)DeleteSession(ctxcontext.Context,req*discoveryenginepb.DeleteSessionRequest,opts...gax.CallOption)errorDeleteSession deletes a Session.
If the Session to delete doesnot exist, a NOT_FOUND error is returned.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSessionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.DeleteSessionRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#DeleteSessionRequest.}err=c.DeleteSession(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*SessionClient) GetOperation
func(c*SessionClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSessionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SessionClient) GetSession
func(c*SessionClient)GetSession(ctxcontext.Context,req*discoveryenginepb.GetSessionRequest,opts...gax.CallOption)(*discoveryenginepb.Session,error)GetSession gets a Session.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSessionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.GetSessionRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#GetSessionRequest.}resp,err:=c.GetSession(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SessionClient) ListOperations
func(c*SessionClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSessionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSessionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*SessionClient) ListSessions
func(c*SessionClient)ListSessions(ctxcontext.Context,req*discoveryenginepb.ListSessionsRequest,opts...gax.CallOption)*SessionIteratorListSessions lists all Sessions by their parentDataStore.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSessionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListSessionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListSessionsRequest.}it:=c.ListSessions(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*discoveryenginepb.ListSessionsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSessionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListSessionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListSessionsRequest.}forresp,err:=rangec.ListSessions(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*SessionClient) UpdateSession
func(c*SessionClient)UpdateSession(ctxcontext.Context,req*discoveryenginepb.UpdateSessionRequest,opts...gax.CallOption)(*discoveryenginepb.Session,error)UpdateSession updates a Session.
Session action type cannot bechanged. If the Session toupdate does not exist, a NOT_FOUND error is returned.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSessionClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.UpdateSessionRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#UpdateSessionRequest.}resp,err:=c.UpdateSession(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}SessionIterator
typeSessionIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*discoveryenginepb.Session,nextPageTokenstring,errerror)// contains filtered or unexported fields}SessionIterator manages a stream of *discoveryenginepb.Session.
func (*SessionIterator) All
func(it*SessionIterator)All()iter.Seq2[*discoveryenginepb.Session,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*SessionIterator) Next
func(it*SessionIterator)Next()(*discoveryenginepb.Session,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*SessionIterator) PageInfo
func(it*SessionIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
SiteSearchEngineCallOptions
typeSiteSearchEngineCallOptionsstruct{GetSiteSearchEngine[]gax.CallOptionCreateTargetSite[]gax.CallOptionBatchCreateTargetSites[]gax.CallOptionGetTargetSite[]gax.CallOptionUpdateTargetSite[]gax.CallOptionDeleteTargetSite[]gax.CallOptionListTargetSites[]gax.CallOptionCreateSitemap[]gax.CallOptionDeleteSitemap[]gax.CallOptionFetchSitemaps[]gax.CallOptionEnableAdvancedSiteSearch[]gax.CallOptionDisableAdvancedSiteSearch[]gax.CallOptionRecrawlUris[]gax.CallOptionBatchVerifyTargetSites[]gax.CallOptionFetchDomainVerificationStatus[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}SiteSearchEngineCallOptions contains the retry settings for each method of SiteSearchEngineClient.
SiteSearchEngineClient
typeSiteSearchEngineClientstruct{// The call options for this service.CallOptions*SiteSearchEngineCallOptions// 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}SiteSearchEngineClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing site search related resources.
func NewSiteSearchEngineClient
funcNewSiteSearchEngineClient(ctxcontext.Context,opts...option.ClientOption)(*SiteSearchEngineClient,error)NewSiteSearchEngineClient creates a new site search engine service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing site search related resources.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewSiteSearchEngineRESTClient
funcNewSiteSearchEngineRESTClient(ctxcontext.Context,opts...option.ClientOption)(*SiteSearchEngineClient,error)NewSiteSearchEngineRESTClient creates a new site search engine service rest client.
Service for managing site search related resources.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*SiteSearchEngineClient) BatchCreateTargetSites
func(c*SiteSearchEngineClient)BatchCreateTargetSites(ctxcontext.Context,req*discoveryenginepb.BatchCreateTargetSitesRequest,opts...gax.CallOption)(*BatchCreateTargetSitesOperation,error)BatchCreateTargetSites creates TargetSite in abatch.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.BatchCreateTargetSitesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#BatchCreateTargetSitesRequest.}op,err:=c.BatchCreateTargetSites(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SiteSearchEngineClient) BatchCreateTargetSitesOperation
func(c*SiteSearchEngineClient)BatchCreateTargetSitesOperation(namestring)*BatchCreateTargetSitesOperationBatchCreateTargetSitesOperation returns a new BatchCreateTargetSitesOperation from a given name.The name must be that of a previously created BatchCreateTargetSitesOperation, possibly from a different process.
func (*SiteSearchEngineClient) BatchVerifyTargetSites
func(c*SiteSearchEngineClient)BatchVerifyTargetSites(ctxcontext.Context,req*discoveryenginepb.BatchVerifyTargetSitesRequest,opts...gax.CallOption)(*BatchVerifyTargetSitesOperation,error)BatchVerifyTargetSites verify target sites’ ownership and validity.This API sends all the target sites under site search engine forverification.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.BatchVerifyTargetSitesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#BatchVerifyTargetSitesRequest.}op,err:=c.BatchVerifyTargetSites(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SiteSearchEngineClient) BatchVerifyTargetSitesOperation
func(c*SiteSearchEngineClient)BatchVerifyTargetSitesOperation(namestring)*BatchVerifyTargetSitesOperationBatchVerifyTargetSitesOperation returns a new BatchVerifyTargetSitesOperation from a given name.The name must be that of a previously created BatchVerifyTargetSitesOperation, possibly from a different process.
func (*SiteSearchEngineClient) CancelOperation
func(c*SiteSearchEngineClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*SiteSearchEngineClient) Close
func(c*SiteSearchEngineClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*SiteSearchEngineClient) Connection (deprecated)
func(c*SiteSearchEngineClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*SiteSearchEngineClient) CreateSitemap
func(c*SiteSearchEngineClient)CreateSitemap(ctxcontext.Context,req*discoveryenginepb.CreateSitemapRequest,opts...gax.CallOption)(*CreateSitemapOperation,error)CreateSitemap creates a Sitemap.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.CreateSitemapRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#CreateSitemapRequest.}op,err:=c.CreateSitemap(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SiteSearchEngineClient) CreateSitemapOperation
func(c*SiteSearchEngineClient)CreateSitemapOperation(namestring)*CreateSitemapOperationCreateSitemapOperation returns a new CreateSitemapOperation from a given name.The name must be that of a previously created CreateSitemapOperation, possibly from a different process.
func (*SiteSearchEngineClient) CreateTargetSite
func(c*SiteSearchEngineClient)CreateTargetSite(ctxcontext.Context,req*discoveryenginepb.CreateTargetSiteRequest,opts...gax.CallOption)(*CreateTargetSiteOperation,error)CreateTargetSite creates a TargetSite.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.CreateTargetSiteRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#CreateTargetSiteRequest.}op,err:=c.CreateTargetSite(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SiteSearchEngineClient) CreateTargetSiteOperation
func(c*SiteSearchEngineClient)CreateTargetSiteOperation(namestring)*CreateTargetSiteOperationCreateTargetSiteOperation returns a new CreateTargetSiteOperation from a given name.The name must be that of a previously created CreateTargetSiteOperation, possibly from a different process.
func (*SiteSearchEngineClient) DeleteSitemap
func(c*SiteSearchEngineClient)DeleteSitemap(ctxcontext.Context,req*discoveryenginepb.DeleteSitemapRequest,opts...gax.CallOption)(*DeleteSitemapOperation,error)DeleteSitemap deletes a Sitemap.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.DeleteSitemapRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#DeleteSitemapRequest.}op,err:=c.DeleteSitemap(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*SiteSearchEngineClient) DeleteSitemapOperation
func(c*SiteSearchEngineClient)DeleteSitemapOperation(namestring)*DeleteSitemapOperationDeleteSitemapOperation returns a new DeleteSitemapOperation from a given name.The name must be that of a previously created DeleteSitemapOperation, possibly from a different process.
func (*SiteSearchEngineClient) DeleteTargetSite
func(c*SiteSearchEngineClient)DeleteTargetSite(ctxcontext.Context,req*discoveryenginepb.DeleteTargetSiteRequest,opts...gax.CallOption)(*DeleteTargetSiteOperation,error)DeleteTargetSite deletes a TargetSite.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.DeleteTargetSiteRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#DeleteTargetSiteRequest.}op,err:=c.DeleteTargetSite(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*SiteSearchEngineClient) DeleteTargetSiteOperation
func(c*SiteSearchEngineClient)DeleteTargetSiteOperation(namestring)*DeleteTargetSiteOperationDeleteTargetSiteOperation returns a new DeleteTargetSiteOperation from a given name.The name must be that of a previously created DeleteTargetSiteOperation, possibly from a different process.
func (*SiteSearchEngineClient) DisableAdvancedSiteSearch
func(c*SiteSearchEngineClient)DisableAdvancedSiteSearch(ctxcontext.Context,req*discoveryenginepb.DisableAdvancedSiteSearchRequest,opts...gax.CallOption)(*DisableAdvancedSiteSearchOperation,error)DisableAdvancedSiteSearch downgrade from advanced site search to basic site search.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.DisableAdvancedSiteSearchRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#DisableAdvancedSiteSearchRequest.}op,err:=c.DisableAdvancedSiteSearch(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SiteSearchEngineClient) DisableAdvancedSiteSearchOperation
func(c*SiteSearchEngineClient)DisableAdvancedSiteSearchOperation(namestring)*DisableAdvancedSiteSearchOperationDisableAdvancedSiteSearchOperation returns a new DisableAdvancedSiteSearchOperation from a given name.The name must be that of a previously created DisableAdvancedSiteSearchOperation, possibly from a different process.
func (*SiteSearchEngineClient) EnableAdvancedSiteSearch
func(c*SiteSearchEngineClient)EnableAdvancedSiteSearch(ctxcontext.Context,req*discoveryenginepb.EnableAdvancedSiteSearchRequest,opts...gax.CallOption)(*EnableAdvancedSiteSearchOperation,error)EnableAdvancedSiteSearch upgrade from basic site search to advanced site search.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.EnableAdvancedSiteSearchRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#EnableAdvancedSiteSearchRequest.}op,err:=c.EnableAdvancedSiteSearch(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SiteSearchEngineClient) EnableAdvancedSiteSearchOperation
func(c*SiteSearchEngineClient)EnableAdvancedSiteSearchOperation(namestring)*EnableAdvancedSiteSearchOperationEnableAdvancedSiteSearchOperation returns a new EnableAdvancedSiteSearchOperation from a given name.The name must be that of a previously created EnableAdvancedSiteSearchOperation, possibly from a different process.
func (*SiteSearchEngineClient) FetchDomainVerificationStatus
func(c*SiteSearchEngineClient)FetchDomainVerificationStatus(ctxcontext.Context,req*discoveryenginepb.FetchDomainVerificationStatusRequest,opts...gax.CallOption)*TargetSiteIteratorFetchDomainVerificationStatus returns list of target sites with its domain verification status.This method can only be called under data store with BASIC_SITE_SEARCHstate at the moment.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.FetchDomainVerificationStatusRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#FetchDomainVerificationStatusRequest.}it:=c.FetchDomainVerificationStatus(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*discoveryenginepb.FetchDomainVerificationStatusResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.FetchDomainVerificationStatusRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#FetchDomainVerificationStatusRequest.}forresp,err:=rangec.FetchDomainVerificationStatus(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*SiteSearchEngineClient) FetchSitemaps
func(c*SiteSearchEngineClient)FetchSitemaps(ctxcontext.Context,req*discoveryenginepb.FetchSitemapsRequest,opts...gax.CallOption)(*discoveryenginepb.FetchSitemapsResponse,error)FetchSitemaps fetch Sitemaps in aDataStore.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.FetchSitemapsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#FetchSitemapsRequest.}resp,err:=c.FetchSitemaps(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SiteSearchEngineClient) GetOperation
func(c*SiteSearchEngineClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SiteSearchEngineClient) GetSiteSearchEngine
func(c*SiteSearchEngineClient)GetSiteSearchEngine(ctxcontext.Context,req*discoveryenginepb.GetSiteSearchEngineRequest,opts...gax.CallOption)(*discoveryenginepb.SiteSearchEngine,error)GetSiteSearchEngine gets theSiteSearchEngine.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.GetSiteSearchEngineRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#GetSiteSearchEngineRequest.}resp,err:=c.GetSiteSearchEngine(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SiteSearchEngineClient) GetTargetSite
func(c*SiteSearchEngineClient)GetTargetSite(ctxcontext.Context,req*discoveryenginepb.GetTargetSiteRequest,opts...gax.CallOption)(*discoveryenginepb.TargetSite,error)GetTargetSite gets a TargetSite.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.GetTargetSiteRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#GetTargetSiteRequest.}resp,err:=c.GetTargetSite(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SiteSearchEngineClient) ListOperations
func(c*SiteSearchEngineClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*SiteSearchEngineClient) ListTargetSites
func(c*SiteSearchEngineClient)ListTargetSites(ctxcontext.Context,req*discoveryenginepb.ListTargetSitesRequest,opts...gax.CallOption)*TargetSiteIteratorListTargetSites gets a list of TargetSites.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListTargetSitesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListTargetSitesRequest.}it:=c.ListTargetSites(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*discoveryenginepb.ListTargetSitesResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListTargetSitesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListTargetSitesRequest.}forresp,err:=rangec.ListTargetSites(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*SiteSearchEngineClient) RecrawlUris
func(c*SiteSearchEngineClient)RecrawlUris(ctxcontext.Context,req*discoveryenginepb.RecrawlUrisRequest,opts...gax.CallOption)(*RecrawlUrisOperation,error)RecrawlUris request on-demand recrawl for a list of URIs.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.RecrawlUrisRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#RecrawlUrisRequest.}op,err:=c.RecrawlUris(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SiteSearchEngineClient) RecrawlUrisOperation
func(c*SiteSearchEngineClient)RecrawlUrisOperation(namestring)*RecrawlUrisOperationRecrawlUrisOperation returns a new RecrawlUrisOperation from a given name.The name must be that of a previously created RecrawlUrisOperation, possibly from a different process.
func (*SiteSearchEngineClient) UpdateTargetSite
func(c*SiteSearchEngineClient)UpdateTargetSite(ctxcontext.Context,req*discoveryenginepb.UpdateTargetSiteRequest,opts...gax.CallOption)(*UpdateTargetSiteOperation,error)UpdateTargetSite updates a TargetSite.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewSiteSearchEngineClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.UpdateTargetSiteRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#UpdateTargetSiteRequest.}op,err:=c.UpdateTargetSite(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SiteSearchEngineClient) UpdateTargetSiteOperation
func(c*SiteSearchEngineClient)UpdateTargetSiteOperation(namestring)*UpdateTargetSiteOperationUpdateTargetSiteOperation returns a new UpdateTargetSiteOperation from a given name.The name must be that of a previously created UpdateTargetSiteOperation, possibly from a different process.
TargetSiteIterator
typeTargetSiteIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*discoveryenginepb.TargetSite,nextPageTokenstring,errerror)// contains filtered or unexported fields}TargetSiteIterator manages a stream of *discoveryenginepb.TargetSite.
func (*TargetSiteIterator) All
func(it*TargetSiteIterator)All()iter.Seq2[*discoveryenginepb.TargetSite,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*TargetSiteIterator) Next
func(it*TargetSiteIterator)Next()(*discoveryenginepb.TargetSite,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*TargetSiteIterator) PageInfo
func(it*TargetSiteIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
TrainCustomModelOperation
typeTrainCustomModelOperationstruct{// contains filtered or unexported fields}TrainCustomModelOperation manages a long-running operation from TrainCustomModel.
func (*TrainCustomModelOperation) Done
func(op*TrainCustomModelOperation)Done()boolDone reports whether the long-running operation has completed.
func (*TrainCustomModelOperation) Metadata
func(op*TrainCustomModelOperation)Metadata()(*discoveryenginepb.TrainCustomModelMetadata,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 (*TrainCustomModelOperation) Name
func(op*TrainCustomModelOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*TrainCustomModelOperation) Poll
func(op*TrainCustomModelOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.TrainCustomModelResponse,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 andthe 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 (*TrainCustomModelOperation) Wait
func(op*TrainCustomModelOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.TrainCustomModelResponse,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.
UpdateCmekConfigOperation
typeUpdateCmekConfigOperationstruct{// contains filtered or unexported fields}UpdateCmekConfigOperation manages a long-running operation from UpdateCmekConfig.
func (*UpdateCmekConfigOperation) Done
func(op*UpdateCmekConfigOperation)Done()boolDone reports whether the long-running operation has completed.
func (*UpdateCmekConfigOperation) Metadata
func(op*UpdateCmekConfigOperation)Metadata()(*discoveryenginepb.UpdateCmekConfigMetadata,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 (*UpdateCmekConfigOperation) Name
func(op*UpdateCmekConfigOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateCmekConfigOperation) Poll
func(op*UpdateCmekConfigOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.CmekConfig,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 andthe 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 (*UpdateCmekConfigOperation) Wait
func(op*UpdateCmekConfigOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.CmekConfig,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.
UpdateSchemaOperation
typeUpdateSchemaOperationstruct{// contains filtered or unexported fields}UpdateSchemaOperation manages a long-running operation from UpdateSchema.
func (*UpdateSchemaOperation) Done
func(op*UpdateSchemaOperation)Done()boolDone reports whether the long-running operation has completed.
func (*UpdateSchemaOperation) Metadata
func(op*UpdateSchemaOperation)Metadata()(*discoveryenginepb.UpdateSchemaMetadata,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 (*UpdateSchemaOperation) Name
func(op*UpdateSchemaOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateSchemaOperation) Poll
func(op*UpdateSchemaOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.Schema,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 andthe 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 (*UpdateSchemaOperation) Wait
func(op*UpdateSchemaOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.Schema,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.
UpdateTargetSiteOperation
typeUpdateTargetSiteOperationstruct{// contains filtered or unexported fields}UpdateTargetSiteOperation manages a long-running operation from UpdateTargetSite.
func (*UpdateTargetSiteOperation) Done
func(op*UpdateTargetSiteOperation)Done()boolDone reports whether the long-running operation has completed.
func (*UpdateTargetSiteOperation) Metadata
func(op*UpdateTargetSiteOperation)Metadata()(*discoveryenginepb.UpdateTargetSiteMetadata,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 (*UpdateTargetSiteOperation) Name
func(op*UpdateTargetSiteOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateTargetSiteOperation) Poll
func(op*UpdateTargetSiteOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.TargetSite,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 andthe 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 (*UpdateTargetSiteOperation) Wait
func(op*UpdateTargetSiteOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*discoveryenginepb.TargetSite,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.
UserEventCallOptions
typeUserEventCallOptionsstruct{WriteUserEvent[]gax.CallOptionCollectUserEvent[]gax.CallOptionPurgeUserEvents[]gax.CallOptionImportUserEvents[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}UserEventCallOptions contains the retry settings for each method of UserEventClient.
UserEventClient
typeUserEventClientstruct{// The call options for this service.CallOptions*UserEventCallOptions// 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}UserEventClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for ingesting end user actions on a website to Discovery Engine API.
func NewUserEventClient
funcNewUserEventClient(ctxcontext.Context,opts...option.ClientOption)(*UserEventClient,error)NewUserEventClient creates a new user event service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for ingesting end user actions on a website to Discovery Engine API.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserEventClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewUserEventRESTClient
funcNewUserEventRESTClient(ctxcontext.Context,opts...option.ClientOption)(*UserEventClient,error)NewUserEventRESTClient creates a new user event service rest client.
Service for ingesting end user actions on a website to Discovery Engine API.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserEventRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*UserEventClient) CancelOperation
func(c*UserEventClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserEventClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*UserEventClient) Close
func(c*UserEventClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*UserEventClient) CollectUserEvent
func(c*UserEventClient)CollectUserEvent(ctxcontext.Context,req*discoveryenginepb.CollectUserEventRequest,opts...gax.CallOption)(*httpbodypb.HttpBody,error)CollectUserEvent writes a single user event from the browser. This uses a GET request todue to browser restriction of POST-ing to a third-party domain.
This method is used only by the Discovery Engine API JavaScript pixel andGoogle Tag Manager. Users should not call this method directly.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserEventClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.CollectUserEventRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#CollectUserEventRequest.}resp,err:=c.CollectUserEvent(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*UserEventClient) Connection (deprecated)
func(c*UserEventClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*UserEventClient) GetOperation
func(c*UserEventClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserEventClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*UserEventClient) ImportUserEvents
func(c*UserEventClient)ImportUserEvents(ctxcontext.Context,req*discoveryenginepb.ImportUserEventsRequest,opts...gax.CallOption)(*ImportUserEventsOperation,error)ImportUserEvents bulk import of user events. Request processing might besynchronous. Events that already exist are skipped.Use this method for backfilling historical user events.
Operation.response is of type ImportResponse. Note that it ispossible for a subset of the items to be successfully inserted.Operation.metadata is of type ImportMetadata.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserEventClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ImportUserEventsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ImportUserEventsRequest.}op,err:=c.ImportUserEvents(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*UserEventClient) ImportUserEventsOperation
func(c*UserEventClient)ImportUserEventsOperation(namestring)*ImportUserEventsOperationImportUserEventsOperation returns a new ImportUserEventsOperation from a given name.The name must be that of a previously created ImportUserEventsOperation, possibly from a different process.
func (*UserEventClient) ListOperations
func(c*UserEventClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserEventClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserEventClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*UserEventClient) PurgeUserEvents
func(c*UserEventClient)PurgeUserEvents(ctxcontext.Context,req*discoveryenginepb.PurgeUserEventsRequest,opts...gax.CallOption)(*PurgeUserEventsOperation,error)PurgeUserEvents deletes permanently all user events specified by the filter provided.Depending on the number of events specified by the filter, this operationcould take hours or days to complete. To test a filter, use the listcommand first.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserEventClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.PurgeUserEventsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#PurgeUserEventsRequest.}op,err:=c.PurgeUserEvents(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*UserEventClient) PurgeUserEventsOperation
func(c*UserEventClient)PurgeUserEventsOperation(namestring)*PurgeUserEventsOperationPurgeUserEventsOperation returns a new PurgeUserEventsOperation from a given name.The name must be that of a previously created PurgeUserEventsOperation, possibly from a different process.
func (*UserEventClient) WriteUserEvent
func(c*UserEventClient)WriteUserEvent(ctxcontext.Context,req*discoveryenginepb.WriteUserEventRequest,opts...gax.CallOption)(*discoveryenginepb.UserEvent,error)WriteUserEvent writes a single user event.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserEventClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.WriteUserEventRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#WriteUserEventRequest.}resp,err:=c.WriteUserEvent(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}UserLicenseCallOptions
typeUserLicenseCallOptionsstruct{ListUserLicenses[]gax.CallOptionBatchUpdateUserLicenses[]gax.CallOptionCancelOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}UserLicenseCallOptions contains the retry settings for each method of UserLicenseClient.
UserLicenseClient
typeUserLicenseClientstruct{// The call options for this service.CallOptions*UserLicenseCallOptions// 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}UserLicenseClient is a client for interacting with Discovery Engine API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for managing User Licenses.
func NewUserLicenseClient
funcNewUserLicenseClient(ctxcontext.Context,opts...option.ClientOption)(*UserLicenseClient,error)NewUserLicenseClient creates a new user license service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for managing User Licenses.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserLicenseClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewUserLicenseRESTClient
funcNewUserLicenseRESTClient(ctxcontext.Context,opts...option.ClientOption)(*UserLicenseClient,error)NewUserLicenseRESTClient creates a new user license service rest client.
Service for managing User Licenses.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserLicenseRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*UserLicenseClient) BatchUpdateUserLicenses
func(c*UserLicenseClient)BatchUpdateUserLicenses(ctxcontext.Context,req*discoveryenginepb.BatchUpdateUserLicensesRequest,opts...gax.CallOption)(*BatchUpdateUserLicensesOperation,error)BatchUpdateUserLicenses updates the User License.This method is used for batch assign/unassign licenses to users.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserLicenseClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.BatchUpdateUserLicensesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#BatchUpdateUserLicensesRequest.}op,err:=c.BatchUpdateUserLicenses(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*UserLicenseClient) BatchUpdateUserLicensesOperation
func(c*UserLicenseClient)BatchUpdateUserLicensesOperation(namestring)*BatchUpdateUserLicensesOperationBatchUpdateUserLicensesOperation returns a new BatchUpdateUserLicensesOperation from a given name.The name must be that of a previously created BatchUpdateUserLicensesOperation, possibly from a different process.
func (*UserLicenseClient) CancelOperation
func(c*UserLicenseClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserLicenseClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*UserLicenseClient) Close
func(c*UserLicenseClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*UserLicenseClient) Connection (deprecated)
func(c*UserLicenseClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*UserLicenseClient) GetOperation
func(c*UserLicenseClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserLicenseClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*UserLicenseClient) ListOperations
func(c*UserLicenseClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserLicenseClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserLicenseClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*UserLicenseClient) ListUserLicenses
func(c*UserLicenseClient)ListUserLicenses(ctxcontext.Context,req*discoveryenginepb.ListUserLicensesRequest,opts...gax.CallOption)*UserLicenseIteratorListUserLicenses lists the User Licenses.
Examples
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserLicenseClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListUserLicensesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListUserLicensesRequest.}it:=c.ListUserLicenses(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*discoveryenginepb.ListUserLicensesResponse)}}all
packagemainimport("context"discoveryengine"cloud.google.com/go/discoveryengine/apiv1"discoveryenginepb"cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=discoveryengine.NewUserLicenseClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&discoveryenginepb.ListUserLicensesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ListUserLicensesRequest.}forresp,err:=rangec.ListUserLicenses(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}UserLicenseIterator
typeUserLicenseIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*discoveryenginepb.UserLicense,nextPageTokenstring,errerror)// contains filtered or unexported fields}UserLicenseIterator manages a stream of *discoveryenginepb.UserLicense.
func (*UserLicenseIterator) All
func(it*UserLicenseIterator)All()iter.Seq2[*discoveryenginepb.UserLicense,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*UserLicenseIterator) Next
func(it*UserLicenseIterator)Next()(*discoveryenginepb.UserLicense,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*UserLicenseIterator) PageInfo
func(it*UserLicenseIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.