Cloud Translation API v3 - Package cloud.google.com/go/translate/apiv3 (v1.12.6)

Package translate is an auto-generated package for the Cloud Translation API.

Integrates text translation into your website or application.

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/translate/apiv3@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 := translate.NewTranslationClient(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 := &translatepb.AdaptiveMtTranslateRequest{
    // TODO: Fill request struct fields.
    // See https://pkg.go.dev/cloud.google.com/go/translate/apiv3/translatepb#AdaptiveMtTranslateRequest.
}
resp, err := c.AdaptiveMtTranslate(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

Use of Context

The ctx passed to NewTranslationClient 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.

AdaptiveMtDatasetIterator

type AdaptiveMtDatasetIterator 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 []*translatepb.AdaptiveMtDataset, nextPageToken string, err error)
	// contains filtered or unexported fields
}

AdaptiveMtDatasetIterator manages a stream of *translatepb.AdaptiveMtDataset.

func (*AdaptiveMtDatasetIterator) All

func (it *AdaptiveMtDatasetIterator) All() iter.Seq2[*translatepb.AdaptiveMtDataset, error]

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

func (*AdaptiveMtDatasetIterator) 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 (*AdaptiveMtDatasetIterator) PageInfo

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

AdaptiveMtFileIterator

type AdaptiveMtFileIterator 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 []*translatepb.AdaptiveMtFile, nextPageToken string, err error)
	// contains filtered or unexported fields
}

AdaptiveMtFileIterator manages a stream of *translatepb.AdaptiveMtFile.

func (*AdaptiveMtFileIterator) All

func (it *AdaptiveMtFileIterator) All() iter.Seq2[*translatepb.AdaptiveMtFile, error]

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

func (*AdaptiveMtFileIterator) 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 (*AdaptiveMtFileIterator) PageInfo

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

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

AdaptiveMtSentenceIterator

type AdaptiveMtSentenceIterator 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 []*translatepb.AdaptiveMtSentence, nextPageToken string, err error)
	// contains filtered or unexported fields
}

AdaptiveMtSentenceIterator manages a stream of *translatepb.AdaptiveMtSentence.

func (*AdaptiveMtSentenceIterator) All

func (it *AdaptiveMtSentenceIterator) All() iter.Seq2[*translatepb.AdaptiveMtSentence, error]

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

func (*AdaptiveMtSentenceIterator) 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 (*AdaptiveMtSentenceIterator) PageInfo

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

BatchTranslateDocumentOperation

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

BatchTranslateDocumentOperation manages a long-running operation from BatchTranslateDocument.

func (*BatchTranslateDocumentOperation) Done

Done reports whether the long-running operation has completed.

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

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 (*BatchTranslateDocumentOperation) 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 (*BatchTranslateDocumentOperation) 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.

BatchTranslateTextOperation

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

BatchTranslateTextOperation manages a long-running operation from BatchTranslateText.

func (*BatchTranslateTextOperation) Done

func (op *BatchTranslateTextOperation) Done() bool

Done reports whether the long-running operation has completed.

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

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 (*BatchTranslateTextOperation) 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 (*BatchTranslateTextOperation) 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.

CreateDatasetOperation

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

CreateDatasetOperation manages a long-running operation from CreateDataset.

func (*CreateDatasetOperation) Done

func (op *CreateDatasetOperation) Done() bool

Done reports whether the long-running operation has completed.

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

func (op *CreateDatasetOperation) 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 (*CreateDatasetOperation) 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 (*CreateDatasetOperation) 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.

CreateGlossaryOperation

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

CreateGlossaryOperation manages a long-running operation from CreateGlossary.

func (*CreateGlossaryOperation) Done

func (op *CreateGlossaryOperation) Done() bool

Done reports whether the long-running operation has completed.

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

func (op *CreateGlossaryOperation) 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 (*CreateGlossaryOperation) 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 (*CreateGlossaryOperation) 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.

CreateModelOperation

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

CreateModelOperation manages a long-running operation from CreateModel.

func (*CreateModelOperation) Done

func (op *CreateModelOperation) Done() bool

Done reports whether the long-running operation has completed.

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

func (op *CreateModelOperation) 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 (*CreateModelOperation) 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 (*CreateModelOperation) 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.

DatasetIterator

type DatasetIterator 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 []*translatepb.Dataset, nextPageToken string, err error)
	// contains filtered or unexported fields
}

DatasetIterator manages a stream of *translatepb.Dataset.

func (*DatasetIterator) All

func (it *DatasetIterator) All() iter.Seq2[*translatepb.Dataset, error]

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

func (*DatasetIterator) Next

func (it *DatasetIterator) Next() (*translatepb.Dataset, 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 (*DatasetIterator) PageInfo

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

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

DeleteDatasetOperation

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

DeleteDatasetOperation manages a long-running operation from DeleteDataset.

func (*DeleteDatasetOperation) Done

func (op *DeleteDatasetOperation) Done() bool

Done reports whether the long-running operation has completed.

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

func (op *DeleteDatasetOperation) 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 (*DeleteDatasetOperation) Poll

func (op *DeleteDatasetOperation) Poll(ctx context.Context, opts ...gax.CallOption) error

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

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

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

func (*DeleteDatasetOperation) Wait

func (op *DeleteDatasetOperation) Wait(ctx context.Context, opts ...gax.CallOption) error

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

See documentation of Poll for error-handling information.

DeleteGlossaryOperation

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

DeleteGlossaryOperation manages a long-running operation from DeleteGlossary.

func (*DeleteGlossaryOperation) Done

func (op *DeleteGlossaryOperation) Done() bool

Done reports whether the long-running operation has completed.

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

func (op *DeleteGlossaryOperation) 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 (*DeleteGlossaryOperation) 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 (*DeleteGlossaryOperation) 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.

DeleteModelOperation

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

DeleteModelOperation manages a long-running operation from DeleteModel.

func (*DeleteModelOperation) Done

func (op *DeleteModelOperation) Done() bool

Done reports whether the long-running operation has completed.

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

func (op *DeleteModelOperation) 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 (*DeleteModelOperation) Poll

func (op *DeleteModelOperation) Poll(ctx context.Context, opts ...gax.CallOption) error

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

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

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

func (*DeleteModelOperation) Wait

func (op *DeleteModelOperation) Wait(ctx context.Context, opts ...gax.CallOption) error

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

See documentation of Poll for error-handling information.

ExampleIterator

type ExampleIterator struct {

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

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

ExampleIterator manages a stream of *translatepb.Example.

func (*ExampleIterator) All

func (it *ExampleIterator) All() iter.Seq2[*translatepb.Example, error]

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

func (*ExampleIterator) Next

func (it *ExampleIterator) Next() (*translatepb.Example, error)

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

func (*ExampleIterator) PageInfo

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

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

ExportDataOperation

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

ExportDataOperation manages a long-running operation from ExportData.

func (*ExportDataOperation) Done

func (op *ExportDataOperation) Done() bool

Done reports whether the long-running operation has completed.

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

func (op *ExportDataOperation) 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 (*ExportDataOperation) Poll

func (op *ExportDataOperation) Poll(ctx context.Context, opts ...gax.CallOption) error

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

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

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

func (*ExportDataOperation) Wait

func (op *ExportDataOperation) Wait(ctx context.Context, opts ...gax.CallOption) error

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

See documentation of Poll for error-handling information.

GlossaryEntryIterator

type GlossaryEntryIterator 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 []*translatepb.GlossaryEntry, nextPageToken string, err error)
	// contains filtered or unexported fields
}

GlossaryEntryIterator manages a stream of *translatepb.GlossaryEntry.

func (*GlossaryEntryIterator) All

func (it *GlossaryEntryIterator) All() iter.Seq2[*translatepb.GlossaryEntry, error]

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

func (*GlossaryEntryIterator) 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 (*GlossaryEntryIterator) PageInfo

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

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

GlossaryIterator

type GlossaryIterator 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 []*translatepb.Glossary, nextPageToken string, err error)
	// contains filtered or unexported fields
}

GlossaryIterator manages a stream of *translatepb.Glossary.

func (*GlossaryIterator) All

func (it *GlossaryIterator) All() iter.Seq2[*translatepb.Glossary, error]

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

func (*GlossaryIterator) Next

func (it *GlossaryIterator) Next() (*translatepb.Glossary, 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 (*GlossaryIterator) PageInfo

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

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

ImportDataOperation

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

ImportDataOperation manages a long-running operation from ImportData.

func (*ImportDataOperation) Done

func (op *ImportDataOperation) Done() bool

Done reports whether the long-running operation has completed.

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

func (op *ImportDataOperation) 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 (*ImportDataOperation) Poll

func (op *ImportDataOperation) Poll(ctx context.Context, opts ...gax.CallOption) error

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

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

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

func (*ImportDataOperation) Wait

func (op *ImportDataOperation) Wait(ctx context.Context, opts ...gax.CallOption) error

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

See documentation of Poll for error-handling information.

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,