Vision AI API v1 - Package cloud.google.com/go/visionai/apiv1 (v0.4.5)

Package visionai is an auto-generated package for the Vision AI API.

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/visionai/apiv1@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 := visionai.NewLiveVideoAnalyticsClient(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 := &visionaipb.BatchRunProcessRequest{
    // TODO: Fill request struct fields.
    // See https://pkg.go.dev/cloud.google.com/go/visionai/apiv1/visionaipb#BatchRunProcessRequest.
}
op, err := c.BatchRunProcess(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 NewLiveVideoAnalyticsClient 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.

AddApplicationStreamInputOperation

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

AddApplicationStreamInputOperation manages a long-running operation from AddApplicationStreamInput.

func (*AddApplicationStreamInputOperation) Done

Done reports whether the long-running operation has completed.

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

AnalysisIterator

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

AnalysisIterator manages a stream of *visionaipb.Analysis.

func (*AnalysisIterator) All

func (it *AnalysisIterator) All() iter.Seq2[*visionaipb.Analysis, error]

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

func (*AnalysisIterator) Next

func (it *AnalysisIterator) Next() (*visionaipb.Analysis, 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 (*AnalysisIterator) PageInfo

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

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

AnalyzeAssetOperation

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

AnalyzeAssetOperation manages a long-running operation from AnalyzeAsset.

func (*AnalyzeAssetOperation) Done

func (op *AnalyzeAssetOperation) Done() bool

Done reports whether the long-running operation has completed.

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

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

AnalyzeCorpusOperation

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

AnalyzeCorpusOperation manages a long-running operation from AnalyzeCorpus.

func (*AnalyzeCorpusOperation) Done

func (op *AnalyzeCorpusOperation) Done() bool

Done reports whether the long-running operation has completed.

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

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

AnnotationIterator

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

AnnotationIterator manages a stream of *visionaipb.Annotation.

func (*AnnotationIterator) All

func (it *AnnotationIterator) All() iter.Seq2[*visionaipb.Annotation, error]

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

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

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

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

AppPlatformCallOptions

type AppPlatformCallOptions struct {
	ListApplications             []gax.CallOption
	GetApplication               []gax.CallOption
	CreateApplication            []gax.CallOption
	UpdateApplication            []gax.CallOption
	DeleteApplication            []gax.CallOption
	DeployApplication            []gax.CallOption
	UndeployApplication          []gax.CallOption
	AddApplicationStreamInput    []gax.CallOption
	RemoveApplicationStreamInput []gax.CallOption
	UpdateApplicationStreamInput []gax.CallOption
	ListInstances                []gax.CallOption
	GetInstance                  []gax.CallOption
	CreateApplicationInstances   []gax.CallOption
	DeleteApplicationInstances   []gax.CallOption
	UpdateApplicationInstances   []gax.CallOption
	ListDrafts                   []gax.CallOption
	GetDraft                     []