Data Analytics API with Gemini v1beta - Package cloud.google.com/go/geminidataanalytics/apiv1beta (v0.2.0)

Package geminidataanalytics is an auto-generated package for the Data Analytics API with Gemini.

NOTE: This package is in beta. It is not stable, and may be subject to changes.

General documentation

For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:

Example usage

To get started with this package, create a client.

// go get cloud.google.com/go/geminidataanalytics/apiv1beta@latest
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := geminidataanalytics.NewDataAgentClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.

Using the Client

The following is an example of making an API call with the newly created client, mentioned above.

req := &geminidataanalyticspb.CreateDataAgentRequest{
    // TODO: Fill request struct fields.
    // See https://pkg.go.dev/cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb#CreateDataAgentRequest.
}
op, err := c.CreateDataAgent(ctx, req)
if err != nil {
    // TODO: Handle error.
}

resp, err := op.Wait(ctx)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

Use of Context

The ctx passed to NewDataAgentClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.

To close the open connection, use the Close() method.

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

ConversationIterator

type ConversationIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*geminidataanalyticspb.Conversation, nextPageToken string, err error)
	// contains filtered or unexported fields
}

ConversationIterator manages a stream of *geminidataanalyticspb.Conversation.

func (*ConversationIterator) All

func (it *ConversationIterator) All() iter.Seq2[*geminidataanalyticspb.Conversation, error]

All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.

func (*ConversationIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*ConversationIterator) PageInfo

func (it *ConversationIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

CreateDataAgentOperation

type CreateDataAgentOperation struct {
	// contains filtered or unexported fields
}

CreateDataAgentOperation manages a long-running operation from CreateDataAgent.

func (*CreateDataAgentOperation) Done

func (op *CreateDataAgentOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*CreateDataAgentOperation) Metadata

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 (*CreateDataAgentOperation) Name

func (op *CreateDataAgentOperation) Name() string

Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.

func (*CreateDataAgentOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*CreateDataAgentOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

DataAgentCallOptions

type DataAgentCallOptions struct {
	ListDataAgents           []gax.CallOption
	ListAccessibleDataAgents []gax.CallOption
	GetDataAgent             []gax.CallOption
	CreateDataAgent          []gax.CallOption
	UpdateDataAgent          []gax.CallOption
	DeleteDataAgent          []gax.CallOption
	GetIamPolicy             []gax.CallOption
	SetIamPolicy             []gax.CallOption
	GetLocation              []gax.CallOption
	ListLocations            []gax.CallOption
	CancelOperation          []gax.CallOption
	DeleteOperation          []gax.CallOption
	GetOperation             []gax.CallOption
	ListOperations           []gax.CallOption
}

DataAgentCallOptions contains the retry settings for each method of DataAgentClient.

DataAgentClient

type DataAgentClient struct {

	// The call options for this service.
	CallOptions *DataAgentCallOptions

	// 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
}

DataAgentClient is a client for interacting with Data Analytics API with Gemini. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service describing handlers for resources.

func NewDataAgentClient

func NewDataAgentClient(ctx context.Context, opts ...option.ClientOption) (*DataAgentClient, error)

NewDataAgentClient creates a new data agent service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service describing handlers for resources.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewDataAgentRESTClient

func NewDataAgentRESTClient(ctx context.Context, opts ...option.ClientOption) (*DataAgentClient, error)

NewDataAgentRESTClient creates a new data agent service rest client.

Service describing handlers for resources.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*DataAgentClient) CancelOperation

func (c *DataAgentClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error

CancelOperation is a utility method from google.longrunning.Operations.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &longrunningpb.CancelOperationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
	}
	err = c.CancelOperation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*DataAgentClient) Close

func (c *DataAgentClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*DataAgentClient) Connection (deprecated)

func (c *DataAgentClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not always return the same resource.

func (*DataAgentClient) CreateDataAgent

CreateDataAgent creates a new DataAgent in a given project and location.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
	geminidataanalyticspb "cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &geminidataanalyticspb.CreateDataAgentRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb#CreateDataAgentRequest.
	}
	op, err := c.CreateDataAgent(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DataAgentClient) CreateDataAgentOperation

func (c *DataAgentClient) CreateDataAgentOperation(name string) *CreateDataAgentOperation

CreateDataAgentOperation returns a new CreateDataAgentOperation from a given name. The name must be that of a previously created CreateDataAgentOperation, possibly from a different process.

func (*DataAgentClient) DeleteDataAgent

DeleteDataAgent deletes a single DataAgent.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
	geminidataanalyticspb "cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &geminidataanalyticspb.DeleteDataAgentRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb#DeleteDataAgentRequest.
	}
	op, err := c.DeleteDataAgent(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	err = op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*DataAgentClient) DeleteDataAgentOperation

func (c *DataAgentClient) DeleteDataAgentOperation(name string) *DeleteDataAgentOperation

DeleteDataAgentOperation returns a new DeleteDataAgentOperation from a given name. The name must be that of a previously created DeleteDataAgentOperation, possibly from a different process.

func (*DataAgentClient) DeleteOperation

func (c *DataAgentClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error

DeleteOperation is a utility method from google.longrunning.Operations.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &longrunningpb.DeleteOperationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
	}
	err = c.DeleteOperation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*DataAgentClient) GetDataAgent

GetDataAgent gets details of a single DataAgent.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
	geminidataanalyticspb "cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &geminidataanalyticspb.GetDataAgentRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb#GetDataAgentRequest.
	}
	resp, err := c.GetDataAgent(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DataAgentClient) GetIamPolicy

func (c *DataAgentClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)

GetIamPolicy gets the IAM policy for DataAgent

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"

	iampb "cloud.google.com/go/iam/apiv1/iampb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &iampb.GetIamPolicyRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.
	}
	resp, err := c.GetIamPolicy(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DataAgentClient) GetLocation

GetLocation gets information about a location.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"

	locationpb "google.golang.org/genproto/googleapis/cloud/location"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &locationpb.GetLocationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
	}
	resp, err := c.GetLocation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DataAgentClient) GetOperation

GetOperation is a utility method from google.longrunning.Operations.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &longrunningpb.GetOperationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
	}
	resp, err := c.GetOperation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DataAgentClient) ListAccessibleDataAgents

ListAccessibleDataAgents lists DataAgents that are accessible to the caller in a given project and location.

Examples

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
	geminidataanalyticspb "cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &geminidataanalyticspb.ListAccessibleDataAgentsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb#ListAccessibleDataAgentsRequest.
	}
	it := c.ListAccessibleDataAgents(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp

		// If you need to access the underlying RPC response,
		// you can do so by casting the `Response` as below.
		// Otherwise, remove this line. Only populated after
		// first call to Next(). Not safe for concurrent access.
		_ = it.Response.(*geminidataanalyticspb.ListAccessibleDataAgentsResponse)
	}
}
all
package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
	geminidataanalyticspb "cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &geminidataanalyticspb.ListAccessibleDataAgentsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb#ListAccessibleDataAgentsRequest.
	}
	for resp, err := range c.ListAccessibleDataAgents(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*DataAgentClient) ListDataAgents

ListDataAgents lists DataAgents in a given project and location.

Examples

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
	geminidataanalyticspb "cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &geminidataanalyticspb.ListDataAgentsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb#ListDataAgentsRequest.
	}
	it := c.ListDataAgents(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp

		// If you need to access the underlying RPC response,
		// you can do so by casting the `Response` as below.
		// Otherwise, remove this line. Only populated after
		// first call to Next(). Not safe for concurrent access.
		_ = it.Response.(*geminidataanalyticspb.ListDataAgentsResponse)
	}
}
all
package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
	geminidataanalyticspb "cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &geminidataanalyticspb.ListDataAgentsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb#ListDataAgentsRequest.
	}
	for resp, err := range c.ListDataAgents(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*DataAgentClient) ListLocations

ListLocations lists information about the supported locations for this service.

Examples

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
	"google.golang.org/api/iterator"

	locationpb "google.golang.org/genproto/googleapis/cloud/location"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &locationpb.ListLocationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
	}
	it := c.ListLocations(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp

		// If you need to access the underlying RPC response,
		// you can do so by casting the `Response` as below.
		// Otherwise, remove this line. Only populated after
		// first call to Next(). Not safe for concurrent access.
		_ = it.Response.(*locationpb.ListLocationsResponse)
	}
}
all
package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"

	locationpb "google.golang.org/genproto/googleapis/cloud/location"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &locationpb.ListLocationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
	}
	for resp, err := range c.ListLocations(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*DataAgentClient) ListOperations

ListOperations is a utility method from google.longrunning.Operations.

Examples

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &longrunningpb.ListOperationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
	}
	it := c.ListOperations(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp

		// If you need to access the underlying RPC response,
		// you can do so by casting the `Response` as below.
		// Otherwise, remove this line. Only populated after
		// first call to Next(). Not safe for concurrent access.
		_ = it.Response.(*longrunningpb.ListOperationsResponse)
	}
}
all
package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &longrunningpb.ListOperationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
	}
	for resp, err := range c.ListOperations(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*DataAgentClient) SetIamPolicy

func (c *DataAgentClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)

SetIamPolicy sets the IAM policy for a DataAgent.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"

	iampb "cloud.google.com/go/iam/apiv1/iampb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &iampb.SetIamPolicyRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.
	}
	resp, err := c.SetIamPolicy(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DataAgentClient) UpdateDataAgent

UpdateDataAgent updates the parameters of a single DataAgent.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
	geminidataanalyticspb "cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataAgentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &geminidataanalyticspb.UpdateDataAgentRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb#UpdateDataAgentRequest.
	}
	op, err := c.UpdateDataAgent(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DataAgentClient) UpdateDataAgentOperation

func (c *DataAgentClient) UpdateDataAgentOperation(name string) *UpdateDataAgentOperation

UpdateDataAgentOperation returns a new UpdateDataAgentOperation from a given name. The name must be that of a previously created UpdateDataAgentOperation, possibly from a different process.

DataAgentIterator

type DataAgentIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*geminidataanalyticspb.DataAgent, nextPageToken string, err error)
	// contains filtered or unexported fields
}

DataAgentIterator manages a stream of *geminidataanalyticspb.DataAgent.

func (*DataAgentIterator) All

func (it *DataAgentIterator) All() iter.Seq2[*geminidataanalyticspb.DataAgent, error]

All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.

func (*DataAgentIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*DataAgentIterator) PageInfo

func (it *DataAgentIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

DataChatCallOptions

type DataChatCallOptions struct {
	Chat               []gax.CallOption
	CreateConversation []gax.CallOption
	GetConversation    []gax.CallOption
	ListConversations  []gax.CallOption
	ListMessages       []gax.CallOption
	GetLocation        []gax.CallOption
	ListLocations      []gax.CallOption
	CancelOperation    []gax.CallOption
	DeleteOperation    []gax.CallOption
	GetOperation       []gax.CallOption
	ListOperations     []gax.CallOption
}

DataChatCallOptions contains the retry settings for each method of DataChatClient.

DataChatClient

type DataChatClient struct {

	// The call options for this service.
	CallOptions *DataChatCallOptions
	// contains filtered or unexported fields
}

DataChatClient is a client for interacting with Data Analytics API with Gemini. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Service to ask a natural language question on top of BigQuery and Looker Studio datasources to get back streamed responses of various kinds to help provide a rich conversational answer.

func NewDataChatClient

func NewDataChatClient(ctx context.Context, opts ...option.ClientOption) (*DataChatClient, error)

NewDataChatClient creates a new data chat service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Service to ask a natural language question on top of BigQuery and Looker Studio datasources to get back streamed responses of various kinds to help provide a rich conversational answer.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataChatClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewDataChatRESTClient

func NewDataChatRESTClient(ctx context.Context, opts ...option.ClientOption) (*DataChatClient, error)

NewDataChatRESTClient creates a new data chat service rest client.

Service to ask a natural language question on top of BigQuery and Looker Studio datasources to get back streamed responses of various kinds to help provide a rich conversational answer.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataChatRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*DataChatClient) CancelOperation

func (c *DataChatClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error

CancelOperation is a utility method from google.longrunning.Operations.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataChatClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &longrunningpb.CancelOperationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
	}
	err = c.CancelOperation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*DataChatClient) Chat

Chat answers a data question by generating a stream of Message objects.

func (*DataChatClient) Close

func (c *DataChatClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*DataChatClient) Connection (deprecated)

func (c *DataChatClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not always return the same resource.

func (*DataChatClient) CreateConversation

CreateConversation creates a new conversation to persist the conversation history. Each conversation will have multiple messages associated with it.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
	geminidataanalyticspb "cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataChatClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &geminidataanalyticspb.CreateConversationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb#CreateConversationRequest.
	}
	resp, err := c.CreateConversation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DataChatClient) DeleteOperation

func (c *DataChatClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error

DeleteOperation is a utility method from google.longrunning.Operations.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataChatClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &longrunningpb.DeleteOperationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
	}
	err = c.DeleteOperation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*DataChatClient) GetConversation

GetConversation gets details of a single conversation by using conversation id and parent.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
	geminidataanalyticspb "cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataChatClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &geminidataanalyticspb.GetConversationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb#GetConversationRequest.
	}
	resp, err := c.GetConversation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DataChatClient) GetLocation

GetLocation gets information about a location.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"

	locationpb "google.golang.org/genproto/googleapis/cloud/location"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataChatClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &locationpb.GetLocationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
	}
	resp, err := c.GetLocation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DataChatClient) GetOperation

GetOperation is a utility method from google.longrunning.Operations.

Example

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataChatClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &longrunningpb.GetOperationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
	}
	resp, err := c.GetOperation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DataChatClient) ListConversations

ListConversations lists all conversations for a given parent.

Examples

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
	geminidataanalyticspb "cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataChatClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &geminidataanalyticspb.ListConversationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb#ListConversationsRequest.
	}
	it := c.ListConversations(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp

		// If you need to access the underlying RPC response,
		// you can do so by casting the `Response` as below.
		// Otherwise, remove this line. Only populated after
		// first call to Next(). Not safe for concurrent access.
		_ = it.Response.(*geminidataanalyticspb.ListConversationsResponse)
	}
}
all
package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
	geminidataanalyticspb "cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataChatClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &geminidataanalyticspb.ListConversationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb#ListConversationsRequest.
	}
	for resp, err := range c.ListConversations(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*DataChatClient) ListLocations

ListLocations lists information about the supported locations for this service.

Examples

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
	"google.golang.org/api/iterator"

	locationpb "google.golang.org/genproto/googleapis/cloud/location"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataChatClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &locationpb.ListLocationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
	}
	it := c.ListLocations(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp

		// If you need to access the underlying RPC response,
		// you can do so by casting the `Response` as below.
		// Otherwise, remove this line. Only populated after
		// first call to Next(). Not safe for concurrent access.
		_ = it.Response.(*locationpb.ListLocationsResponse)
	}
}
all
package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"

	locationpb "google.golang.org/genproto/googleapis/cloud/location"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataChatClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &locationpb.ListLocationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
	}
	for resp, err := range c.ListLocations(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*DataChatClient) ListMessages

ListMessages lists all messages for a given conversation.

Examples

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
	geminidataanalyticspb "cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataChatClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &geminidataanalyticspb.ListMessagesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb#ListMessagesRequest.
	}
	it := c.ListMessages(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp

		// If you need to access the underlying RPC response,
		// you can do so by casting the `Response` as below.
		// Otherwise, remove this line. Only populated after
		// first call to Next(). Not safe for concurrent access.
		_ = it.Response.(*geminidataanalyticspb.ListMessagesResponse)
	}
}
all
package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"
	geminidataanalyticspb "cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataChatClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &geminidataanalyticspb.ListMessagesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/geminidataanalytics/apiv1beta/geminidataanalyticspb#ListMessagesRequest.
	}
	for resp, err := range c.ListMessages(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*DataChatClient) ListOperations

ListOperations is a utility method from google.longrunning.Operations.

Examples

package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataChatClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &longrunningpb.ListOperationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
	}
	it := c.ListOperations(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp

		// If you need to access the underlying RPC response,
		// you can do so by casting the `Response` as below.
		// Otherwise, remove this line. Only populated after
		// first call to Next(). Not safe for concurrent access.
		_ = it.Response.(*longrunningpb.ListOperationsResponse)
	}
}
all
package main

import (
	"context"

	geminidataanalytics "cloud.google.com/go/geminidataanalytics/apiv1beta"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := geminidataanalytics.NewDataChatClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &longrunningpb.ListOperationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
	}
	for resp, err := range c.ListOperations(ctx, req).All() {
		if err != nil {
			// TODO: Handle error and break/return/continue. Iteration will stop after any error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

DeleteDataAgentOperation

type DeleteDataAgentOperation struct {
	// contains filtered or unexported fields
}

DeleteDataAgentOperation manages a long-running operation from DeleteDataAgent.

func (*DeleteDataAgentOperation) Done

func (op *DeleteDataAgentOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*DeleteDataAgentOperation) Metadata

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 (*DeleteDataAgentOperation) Name

func (op *DeleteDataAgentOperation) Name() string

Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.

func (*DeleteDataAgentOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*DeleteDataAgentOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

LocationIterator

type LocationIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error)
	// contains filtered or unexported fields
}

LocationIterator manages a stream of *locationpb.Location.

func (*LocationIterator) All

func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]

All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.

func (*LocationIterator) Next

func (it *LocationIterator) Next() (*locationpb.Location, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*LocationIterator) PageInfo

func (it *LocationIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

OperationIterator

type OperationIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error)
	// contains filtered or unexported fields
}

OperationIterator manages a stream of *longrunningpb.Operation.

func (*OperationIterator) All

func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]

All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.

func (*OperationIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*OperationIterator) PageInfo

func (it *OperationIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

StorageMessageIterator

type StorageMessageIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*geminidataanalyticspb.StorageMessage, nextPageToken string, err error)
	// contains filtered or unexported fields
}

StorageMessageIterator manages a stream of *geminidataanalyticspb.StorageMessage.

func (*StorageMessageIterator) All

func (it *StorageMessageIterator) All() iter.Seq2[*geminidataanalyticspb.StorageMessage, error]

All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.

func (*StorageMessageIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*StorageMessageIterator) PageInfo

func (it *StorageMessageIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

UpdateDataAgentOperation

type UpdateDataAgentOperation struct {
	// contains filtered or unexported fields
}

UpdateDataAgentOperation manages a long-running operation from UpdateDataAgent.

func (*UpdateDataAgentOperation) Done

func (op *UpdateDataAgentOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*UpdateDataAgentOperation) Metadata

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 (*UpdateDataAgentOperation) Name

func (op *UpdateDataAgentOperation) Name() string

Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.

func (*UpdateDataAgentOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*UpdateDataAgentOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.