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:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
// go get cloud.google.com/go/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
func (op *AddApplicationStreamInputOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*AddApplicationStreamInputOperation) Metadata
func (op *AddApplicationStreamInputOperation) Metadata() (*visionaipb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*AddApplicationStreamInputOperation) Name
func (op *AddApplicationStreamInputOperation) 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 (*AddApplicationStreamInputOperation) Poll
func (op *AddApplicationStreamInputOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*visionaipb.AddApplicationStreamInputResponse, 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 (*AddApplicationStreamInputOperation) Wait
func (op *AddApplicationStreamInputOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*visionaipb.AddApplicationStreamInputResponse, 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.
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
func (op *AnalyzeAssetOperation) Metadata() (*visionaipb.AnalyzeAssetMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*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
func (op *AnalyzeAssetOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*visionaipb.AnalyzeAssetResponse, 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 (*AnalyzeAssetOperation) Wait
func (op *AnalyzeAssetOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*visionaipb.AnalyzeAssetResponse, 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.
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
func (op *AnalyzeCorpusOperation) Metadata() (*visionaipb.AnalyzeCorpusMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*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
func (op *AnalyzeCorpusOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*visionaipb.AnalyzeCorpusResponse, 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 (*AnalyzeCorpusOperation) Wait
func (op *AnalyzeCorpusOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*visionaipb.AnalyzeCorpusResponse, 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.
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
func (it *AnnotationIterator) Next() (*visionaipb.Annotation, 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 (*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 []