package documentai
import "cloud.google.com/go/documentai/apiv1"
Package documentai is an auto-generated package for the Cloud Document AI API.
Service to parse structured information from unstructured or semi-structured documents using state-of-the-art Google AI such as natural language, computer vision, translation, and AutoML.
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/documentai/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 := documentai.NewDocumentProcessorClient(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 := &documentaipb.BatchProcessRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#BatchProcessRequest. } op, err := c.BatchProcessDocuments(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 NewDocumentProcessorClient 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.
Index ¶
- func DefaultAuthScopes() []string
- type BatchProcessDocumentsOperation
- func (op *BatchProcessDocumentsOperation) Done() bool
- func (op *BatchProcessDocumentsOperation) Metadata() (*documentaipb.BatchProcessMetadata, error)
- func (op *BatchProcessDocumentsOperation) Name() string
- func (op *BatchProcessDocumentsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*documentaipb.BatchProcessResponse, error)
- func (op *BatchProcessDocumentsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*documentaipb.BatchProcessResponse, error)
- type DeleteProcessorOperation
- func (op *DeleteProcessorOperation) Done() bool
- func (op *DeleteProcessorOperation) Metadata() (*documentaipb.DeleteProcessorMetadata, error)
- func (op *DeleteProcessorOperation) Name() string
- func (op *DeleteProcessorOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteProcessorOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DeleteProcessorVersionOperation
- func (op *DeleteProcessorVersionOperation) Done() bool
- func (op *DeleteProcessorVersionOperation) Metadata() (*documentaipb.DeleteProcessorVersionMetadata, error)
- func (op *DeleteProcessorVersionOperation) Name() string
- func (op *DeleteProcessorVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteProcessorVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DeployProcessorVersionOperation
- func (op *DeployProcessorVersionOperation) Done() bool
- func (op *DeployProcessorVersionOperation) Metadata() (*documentaipb.DeployProcessorVersionMetadata, error)
- func (op *DeployProcessorVersionOperation) Name() string
- func (op *DeployProcessorVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*documentaipb.DeployProcessorVersionResponse, error)
- func (op *DeployProcessorVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*documentaipb.DeployProcessorVersionResponse, error)
- type DisableProcessorOperation
- func (op *DisableProcessorOperation) Done() bool
- func (op *DisableProcessorOperation) Metadata() (*documentaipb.DisableProcessorMetadata, error)
- func (op *DisableProcessorOperation) Name() string
- func (op *DisableProcessorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*documentaipb.DisableProcessorResponse, error)
- func (op *DisableProcessorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*documentaipb.DisableProcessorResponse, error)
- type DocumentProcessorCallOptions
- type DocumentProcessorClient
- func NewDocumentProcessorClient(ctx context.Context, opts ...option.ClientOption) (*DocumentProcessorClient, error)
- func NewDocumentProcessorRESTClient(ctx context.Context, opts ...option.ClientOption) (*DocumentProcessorClient, error)
- func (c *DocumentProcessorClient) BatchProcessDocuments(ctx context.Context, req *documentaipb.BatchProcessRequest, opts ...gax.CallOption) (*BatchProcessDocumentsOperation, error)
- func (c *DocumentProcessorClient) BatchProcessDocumentsOperation(name string) *BatchProcessDocumentsOperation
- func (c *DocumentProcessorClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *DocumentProcessorClient) Close() error
- func (c *DocumentProcessorClient) Connection() *grpc.ClientConn
- func (c *DocumentProcessorClient) CreateProcessor(ctx context.Context, req *documentaipb.CreateProcessorRequest, opts ...gax.CallOption) (*documentaipb.Processor, error)
- func (c *DocumentProcessorClient) DeleteProcessor(ctx context.Context, req *documentaipb.DeleteProcessorRequest, opts ...gax.CallOption) (*DeleteProcessorOperation, error)
- func (c *DocumentProcessorClient) DeleteProcessorOperation(name string) *DeleteProcessorOperation
- func (c *DocumentProcessorClient) DeleteProcessorVersion(ctx context.Context, req *documentaipb.DeleteProcessorVersionRequest, opts ...gax.CallOption) (*DeleteProcessorVersionOperation, error)
- func (c *DocumentProcessorClient) DeleteProcessorVersionOperation(name string) *DeleteProcessorVersionOperation
- func (c *DocumentProcessorClient) DeployProcessorVersion(ctx context.Context, req *documentaipb.DeployProcessorVersionRequest, opts ...gax.CallOption) (*DeployProcessorVersionOperation, error)
- func (c *DocumentProcessorClient) DeployProcessorVersionOperation(name string) *DeployProcessorVersionOperation
- func (c *DocumentProcessorClient) DisableProcessor(ctx context.Context, req *documentaipb.DisableProcessorRequest, opts ...gax.CallOption) (*DisableProcessorOperation, error)
- func (c *DocumentProcessorClient) DisableProcessorOperation(name string) *DisableProcessorOperation
- func (c *DocumentProcessorClient) EnableProcessor(ctx context.Context, req *documentaipb.EnableProcessorRequest, opts ...gax.CallOption) (*EnableProcessorOperation, error)
- func (c *DocumentProcessorClient) EnableProcessorOperation(name string) *EnableProcessorOperation
- func (c *DocumentProcessorClient) EvaluateProcessorVersion(ctx context.Context, req *documentaipb.EvaluateProcessorVersionRequest, opts ...gax.CallOption) (*EvaluateProcessorVersionOperation, error)
- func (c *DocumentProcessorClient) EvaluateProcessorVersionOperation(name string) *EvaluateProcessorVersionOperation
- func (c *DocumentProcessorClient) FetchProcessorTypes(ctx context.Context, req *documentaipb.FetchProcessorTypesRequest, opts ...gax.CallOption) (*documentaipb.FetchProcessorTypesResponse, error)
- func (c *DocumentProcessorClient) GetEvaluation(ctx context.Context, req *documentaipb.GetEvaluationRequest, opts ...gax.CallOption) (*documentaipb.Evaluation, error)
- func (c *DocumentProcessorClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *DocumentProcessorClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *DocumentProcessorClient) GetProcessor(ctx context.Context, req *documentaipb.GetProcessorRequest, opts ...gax.CallOption) (*documentaipb.Processor, error)
- func (c *DocumentProcessorClient) GetProcessorType(ctx context.Context, req *documentaipb.GetProcessorTypeRequest, opts ...gax.CallOption) (*documentaipb.ProcessorType, error)
- func (c *DocumentProcessorClient) GetProcessorVersion(ctx context.Context, req *documentaipb.GetProcessorVersionRequest, opts ...gax.CallOption) (*documentaipb.ProcessorVersion, error)
- func (c *DocumentProcessorClient) ListEvaluations(ctx context.Context, req *documentaipb.ListEvaluationsRequest, opts ...gax.CallOption) *EvaluationIterator
- func (c *DocumentProcessorClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *DocumentProcessorClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *DocumentProcessorClient) ListProcessorTypes(ctx context.Context, req *documentaipb.ListProcessorTypesRequest, opts ...gax.CallOption) *ProcessorTypeIterator
- func (c *DocumentProcessorClient) ListProcessorVersions(ctx context.Context, req *documentaipb.ListProcessorVersionsRequest, opts ...gax.CallOption) *ProcessorVersionIterator
- func (c *DocumentProcessorClient) ListProcessors(ctx context.Context, req *documentaipb.ListProcessorsRequest, opts ...gax.CallOption) *ProcessorIterator
- func (c *DocumentProcessorClient) ProcessDocument(ctx context.Context, req *documentaipb.ProcessRequest, opts ...gax.CallOption) (*documentaipb.ProcessResponse, error)
- func (c *DocumentProcessorClient) ReviewDocument(ctx context.Context, req *documentaipb.ReviewDocumentRequest, opts ...gax.CallOption) (*ReviewDocumentOperation, error)
- func (c *DocumentProcessorClient) ReviewDocumentOperation(name string) *ReviewDocumentOperation
- func (c *DocumentProcessorClient) SetDefaultProcessorVersion(ctx context.Context, req *documentaipb.SetDefaultProcessorVersionRequest, opts ...gax.CallOption) (*SetDefaultProcessorVersionOperation, error)
- func (c *DocumentProcessorClient) SetDefaultProcessorVersionOperation(name string) *SetDefaultProcessorVersionOperation
- func (c *DocumentProcessorClient) TrainProcessorVersion(ctx context.Context, req *documentaipb.TrainProcessorVersionRequest, opts ...gax.CallOption) (*TrainProcessorVersionOperation, error)
- func (c *DocumentProcessorClient) TrainProcessorVersionOperation(name string) *TrainProcessorVersionOperation
- func (c *DocumentProcessorClient) UndeployProcessorVersion(ctx context.Context, req *documentaipb.UndeployProcessorVersionRequest, opts ...gax.CallOption) (*UndeployProcessorVersionOperation, error)
- func (c *DocumentProcessorClient) UndeployProcessorVersionOperation(name string) *UndeployProcessorVersionOperation
- type EnableProcessorOperation
- func (op *EnableProcessorOperation) Done() bool
- func (op *EnableProcessorOperation) Metadata() (*documentaipb.EnableProcessorMetadata, error)
- func (op *EnableProcessorOperation) Name() string
- func (op *EnableProcessorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*documentaipb.EnableProcessorResponse, error)
- func (op *EnableProcessorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*documentaipb.EnableProcessorResponse, error)
- type EvaluateProcessorVersionOperation
- func (op *EvaluateProcessorVersionOperation) Done() bool
- func (op *EvaluateProcessorVersionOperation) Metadata() (*documentaipb.EvaluateProcessorVersionMetadata, error)
- func (op *EvaluateProcessorVersionOperation) Name() string
- func (op *EvaluateProcessorVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*documentaipb.EvaluateProcessorVersionResponse, error)
- func (op *EvaluateProcessorVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*documentaipb.EvaluateProcessorVersionResponse, error)
- type EvaluationIterator
- func (it *EvaluationIterator) All() iter.Seq2[*documentaipb.Evaluation, error]
- func (it *EvaluationIterator) Next() (*documentaipb.Evaluation, error)
- func (it *EvaluationIterator) PageInfo() *iterator.PageInfo
- type LocationIterator
- func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]
- func (it *LocationIterator) Next() (*locationpb.Location, error)
- func (it *LocationIterator) PageInfo() *iterator.PageInfo
- type OperationIterator
- func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]
- func (it *OperationIterator) Next() (*longrunningpb.Operation, error)
- func (it *OperationIterator) PageInfo() *iterator.PageInfo
- type ProcessorIterator
- func (it *ProcessorIterator) All() iter.Seq2[*documentaipb.Processor, error]
- func (it *ProcessorIterator) Next() (*documentaipb.Processor, error)
- func (it *ProcessorIterator) PageInfo() *iterator.PageInfo
- type ProcessorTypeIterator
- func (it *ProcessorTypeIterator) All() iter.Seq2[*documentaipb.ProcessorType, error]
- func (it *ProcessorTypeIterator) Next() (*documentaipb.ProcessorType, error)
- func (it *ProcessorTypeIterator) PageInfo() *iterator.PageInfo
- type ProcessorVersionIterator
- func (it *ProcessorVersionIterator) All() iter.Seq2[*documentaipb.ProcessorVersion, error]
- func (it *ProcessorVersionIterator) Next() (*documentaipb.ProcessorVersion, error)
- func (it *ProcessorVersionIterator) PageInfo() *iterator.PageInfo
- type ReviewDocumentOperation
- func (op *ReviewDocumentOperation) Done() bool
- func (op *ReviewDocumentOperation) Metadata() (*documentaipb.ReviewDocumentOperationMetadata, error)
- func (op *ReviewDocumentOperation) Name() string
- func (op *ReviewDocumentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*documentaipb.ReviewDocumentResponse, error)
- func (op *ReviewDocumentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*documentaipb.ReviewDocumentResponse, error)
- type SetDefaultProcessorVersionOperation
- func (op *SetDefaultProcessorVersionOperation) Done() bool
- func (op *SetDefaultProcessorVersionOperation) Metadata() (*documentaipb.SetDefaultProcessorVersionMetadata, error)
- func (op *SetDefaultProcessorVersionOperation) Name() string
- func (op *SetDefaultProcessorVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*documentaipb.SetDefaultProcessorVersionResponse, error)
- func (op *SetDefaultProcessorVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*documentaipb.SetDefaultProcessorVersionResponse, error)
- type TrainProcessorVersionOperation
- func (op *TrainProcessorVersionOperation) Done() bool
- func (op *TrainProcessorVersionOperation) Metadata() (*documentaipb.TrainProcessorVersionMetadata, error)
- func (op *TrainProcessorVersionOperation) Name() string
- func (op *TrainProcessorVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*documentaipb.TrainProcessorVersionResponse, error)
- func (op *TrainProcessorVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*documentaipb.TrainProcessorVersionResponse, error)
- type UndeployProcessorVersionOperation
- func (op *UndeployProcessorVersionOperation) Done() bool
- func (op *UndeployProcessorVersionOperation) Metadata() (*documentaipb.UndeployProcessorVersionMetadata, error)
- func (op *UndeployProcessorVersionOperation) Name() string
- func (op *UndeployProcessorVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*documentaipb.UndeployProcessorVersionResponse, error)
- func (op *UndeployProcessorVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*documentaipb.UndeployProcessorVersionResponse, error)
Examples ¶
- DocumentProcessorClient.BatchProcessDocuments
- DocumentProcessorClient.CancelOperation
- DocumentProcessorClient.CreateProcessor
- DocumentProcessorClient.DeleteProcessor
- DocumentProcessorClient.DeleteProcessorVersion
- DocumentProcessorClient.DeployProcessorVersion
- DocumentProcessorClient.DisableProcessor
- DocumentProcessorClient.EnableProcessor
- DocumentProcessorClient.EvaluateProcessorVersion
- DocumentProcessorClient.FetchProcessorTypes
- DocumentProcessorClient.GetEvaluation
- DocumentProcessorClient.GetLocation
- DocumentProcessorClient.GetOperation
- DocumentProcessorClient.GetProcessor
- DocumentProcessorClient.GetProcessorType
- DocumentProcessorClient.GetProcessorVersion
- DocumentProcessorClient.ListEvaluations
- DocumentProcessorClient.ListEvaluations (All)
- DocumentProcessorClient.ListLocations
- DocumentProcessorClient.ListLocations (All)
- DocumentProcessorClient.ListOperations
- DocumentProcessorClient.ListOperations (All)
- DocumentProcessorClient.ListProcessorTypes
- DocumentProcessorClient.ListProcessorTypes (All)
- DocumentProcessorClient.ListProcessorVersions
- DocumentProcessorClient.ListProcessorVersions (All)
- DocumentProcessorClient.ListProcessors
- DocumentProcessorClient.ListProcessors (All)
- DocumentProcessorClient.ProcessDocument
- DocumentProcessorClient.ReviewDocument
- DocumentProcessorClient.SetDefaultProcessorVersion
- DocumentProcessorClient.TrainProcessorVersion
- DocumentProcessorClient.UndeployProcessorVersion
- NewDocumentProcessorClient
- NewDocumentProcessorRESTClient
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type BatchProcessDocumentsOperation ¶
type BatchProcessDocumentsOperation struct {
// contains filtered or unexported fields
}
BatchProcessDocumentsOperation manages a long-running operation from BatchProcessDocuments.
func (*BatchProcessDocumentsOperation) Done ¶
func (op *BatchProcessDocumentsOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*BatchProcessDocumentsOperation) Metadata ¶
func (op *BatchProcessDocumentsOperation) Metadata() (*documentaipb.BatchProcessMetadata, 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 (*BatchProcessDocumentsOperation) Name ¶
func (op *BatchProcessDocumentsOperation) 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 (*BatchProcessDocumentsOperation) Poll ¶
func (op *BatchProcessDocumentsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*documentaipb.BatchProcessResponse, 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 (*BatchProcessDocumentsOperation) Wait ¶
func (op *BatchProcessDocumentsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*documentaipb.BatchProcessResponse, 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.
type DeleteProcessorOperation ¶
type DeleteProcessorOperation struct {
// contains filtered or unexported fields
}
DeleteProcessorOperation manages a long-running operation from DeleteProcessor.
func (*DeleteProcessorOperation) Done ¶
func (op *DeleteProcessorOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteProcessorOperation) Metadata ¶
func (op *DeleteProcessorOperation) Metadata() (*documentaipb.DeleteProcessorMetadata, 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 (*DeleteProcessorOperation) Name ¶
func (op *DeleteProcessorOperation) 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 (*DeleteProcessorOperation) Poll ¶
func (op *DeleteProcessorOperation) 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 (*DeleteProcessorOperation) Wait ¶
func (op *DeleteProcessorOperation) 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.
type DeleteProcessorVersionOperation ¶
type DeleteProcessorVersionOperation struct {
// contains filtered or unexported fields
}
DeleteProcessorVersionOperation manages a long-running operation from DeleteProcessorVersion.
func (*DeleteProcessorVersionOperation) Done ¶
func (op *DeleteProcessorVersionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteProcessorVersionOperation) Metadata ¶
func (op *DeleteProcessorVersionOperation) Metadata() (*documentaipb.DeleteProcessorVersionMetadata, 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 (*DeleteProcessorVersionOperation) Name ¶
func (op *DeleteProcessorVersionOperation) 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 (*DeleteProcessorVersionOperation) Poll ¶
func (op *DeleteProcessorVersionOperation) 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 (*DeleteProcessorVersionOperation) Wait ¶
func (op *DeleteProcessorVersionOperation) 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.
type DeployProcessorVersionOperation ¶
type DeployProcessorVersionOperation struct {
// contains filtered or unexported fields
}
DeployProcessorVersionOperation manages a long-running operation from DeployProcessorVersion.
func (*DeployProcessorVersionOperation) Done ¶
func (op *DeployProcessorVersionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeployProcessorVersionOperation) Metadata ¶
func (op *DeployProcessorVersionOperation) Metadata() (*documentaipb.DeployProcessorVersionMetadata, 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 (*DeployProcessorVersionOperation) Name ¶
func (op *DeployProcessorVersionOperation) 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 (*DeployProcessorVersionOperation) Poll ¶
func (op *DeployProcessorVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*documentaipb.DeployProcessorVersionResponse, 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 (*DeployProcessorVersionOperation) Wait ¶
func (op *DeployProcessorVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*documentaipb.DeployProcessorVersionResponse, 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.
type DisableProcessorOperation ¶
type DisableProcessorOperation struct {
// contains filtered or unexported fields
}
DisableProcessorOperation manages a long-running operation from DisableProcessor.
func (*DisableProcessorOperation) Done ¶
func (op *DisableProcessorOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DisableProcessorOperation) Metadata ¶
func (op *DisableProcessorOperation) Metadata() (*documentaipb.DisableProcessorMetadata, 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 (*DisableProcessorOperation) Name ¶
func (op *DisableProcessorOperation) 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 (*DisableProcessorOperation) Poll ¶
func (op *DisableProcessorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*documentaipb.DisableProcessorResponse, 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 (*DisableProcessorOperation) Wait ¶
func (op *DisableProcessorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*documentaipb.DisableProcessorResponse, 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.
type DocumentProcessorCallOptions ¶
type DocumentProcessorCallOptions struct { ProcessDocument []gax.CallOption BatchProcessDocuments []gax.CallOption FetchProcessorTypes []gax.CallOption ListProcessorTypes []gax.CallOption GetProcessorType []gax.CallOption ListProcessors []gax.CallOption GetProcessor []gax.CallOption TrainProcessorVersion []gax.CallOption GetProcessorVersion []gax.CallOption ListProcessorVersions []gax.CallOption DeleteProcessorVersion []gax.CallOption DeployProcessorVersion []gax.CallOption UndeployProcessorVersion []gax.CallOption CreateProcessor []gax.CallOption DeleteProcessor []gax.CallOption EnableProcessor []gax.CallOption DisableProcessor []gax.CallOption SetDefaultProcessorVersion []gax.CallOption ReviewDocument []gax.CallOption EvaluateProcessorVersion []gax.CallOption GetEvaluation []gax.CallOption ListEvaluations []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
DocumentProcessorCallOptions contains the retry settings for each method of DocumentProcessorClient.
type DocumentProcessorClient ¶
type DocumentProcessorClient struct { // The call options for this service. CallOptions *DocumentProcessorCallOptions // 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 }
DocumentProcessorClient is a client for interacting with Cloud Document AI API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service to call Document AI to process documents according to the processor’s definition. Processors are built using state-of-the-art Google AI such as natural language, computer vision, and translation to extract structured information from unstructured or semi-structured documents.
func NewDocumentProcessorClient ¶
func NewDocumentProcessorClient(ctx context.Context, opts ...option.ClientOption) (*DocumentProcessorClient, error)
NewDocumentProcessorClient creates a new document processor 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 call Document AI to process documents according to the
processor’s definition. Processors are built using state-of-the-art Google
AI such as natural language, computer vision, and translation to extract
structured information from unstructured or semi-structured documents.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewDocumentProcessorRESTClient ¶
func NewDocumentProcessorRESTClient(ctx context.Context, opts ...option.ClientOption) (*DocumentProcessorClient, error)
NewDocumentProcessorRESTClient creates a new document processor service rest client.
Service to call Document AI to process documents according to the
processor’s definition. Processors are built using state-of-the-art Google
AI such as natural language, computer vision, and translation to extract
structured information from unstructured or semi-structured documents.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
)
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 := documentai.NewDocumentProcessorRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*DocumentProcessorClient) BatchProcessDocuments ¶
func (c *DocumentProcessorClient) BatchProcessDocuments(ctx context.Context, req *documentaipb.BatchProcessRequest, opts ...gax.CallOption) (*BatchProcessDocumentsOperation, error)
BatchProcessDocuments lRO endpoint to batch process many documents. The output is written
to Cloud Storage as JSON in the [Document] format.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.BatchProcessRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#BatchProcessRequest.
}
op, err := c.BatchProcessDocuments(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DocumentProcessorClient) BatchProcessDocumentsOperation ¶
func (c *DocumentProcessorClient) BatchProcessDocumentsOperation(name string) *BatchProcessDocumentsOperation
BatchProcessDocumentsOperation returns a new BatchProcessDocumentsOperation from a given name. The name must be that of a previously created BatchProcessDocumentsOperation, possibly from a different process.
func (*DocumentProcessorClient) CancelOperation ¶
func (c *DocumentProcessorClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
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 := documentai.NewDocumentProcessorClient(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 (*DocumentProcessorClient) Close ¶
func (c *DocumentProcessorClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*DocumentProcessorClient) Connection ¶
func (c *DocumentProcessorClient) 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 (*DocumentProcessorClient) CreateProcessor ¶
func (c *DocumentProcessorClient) CreateProcessor(ctx context.Context, req *documentaipb.CreateProcessorRequest, opts ...gax.CallOption) (*documentaipb.Processor, error)
CreateProcessor creates a processor from the
ProcessorType provided. The
processor will be at ENABLED state by default after its creation. Note
that this method requires the documentai.processors.create permission on
the project, which is highly privileged. A user or service account with
this permission can create new processors that can interact with any gcs
bucket in your project.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.CreateProcessorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#CreateProcessorRequest.
}
resp, err := c.CreateProcessor(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DocumentProcessorClient) DeleteProcessor ¶
func (c *DocumentProcessorClient) DeleteProcessor(ctx context.Context, req *documentaipb.DeleteProcessorRequest, opts ...gax.CallOption) (*DeleteProcessorOperation, error)
DeleteProcessor deletes the processor, unloads all deployed model artifacts if it was
enabled and then deletes all artifacts associated with this processor.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.DeleteProcessorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#DeleteProcessorRequest.
}
op, err := c.DeleteProcessor(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DocumentProcessorClient) DeleteProcessorOperation ¶
func (c *DocumentProcessorClient) DeleteProcessorOperation(name string) *DeleteProcessorOperation
DeleteProcessorOperation returns a new DeleteProcessorOperation from a given name. The name must be that of a previously created DeleteProcessorOperation, possibly from a different process.
func (*DocumentProcessorClient) DeleteProcessorVersion ¶
func (c *DocumentProcessorClient) DeleteProcessorVersion(ctx context.Context, req *documentaipb.DeleteProcessorVersionRequest, opts ...gax.CallOption) (*DeleteProcessorVersionOperation, error)
DeleteProcessorVersion deletes the processor version, all artifacts under the processor version
will be deleted.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.DeleteProcessorVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#DeleteProcessorVersionRequest.
}
op, err := c.DeleteProcessorVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DocumentProcessorClient) DeleteProcessorVersionOperation ¶
func (c *DocumentProcessorClient) DeleteProcessorVersionOperation(name string) *DeleteProcessorVersionOperation
DeleteProcessorVersionOperation returns a new DeleteProcessorVersionOperation from a given name. The name must be that of a previously created DeleteProcessorVersionOperation, possibly from a different process.
func (*DocumentProcessorClient) DeployProcessorVersion ¶
func (c *DocumentProcessorClient) DeployProcessorVersion(ctx context.Context, req *documentaipb.DeployProcessorVersionRequest, opts ...gax.CallOption) (*DeployProcessorVersionOperation, error)
DeployProcessorVersion deploys the processor version.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.DeployProcessorVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#DeployProcessorVersionRequest.
}
op, err := c.DeployProcessorVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DocumentProcessorClient) DeployProcessorVersionOperation ¶
func (c *DocumentProcessorClient) DeployProcessorVersionOperation(name string) *DeployProcessorVersionOperation
DeployProcessorVersionOperation returns a new DeployProcessorVersionOperation from a given name. The name must be that of a previously created DeployProcessorVersionOperation, possibly from a different process.
func (*DocumentProcessorClient) DisableProcessor ¶
func (c *DocumentProcessorClient) DisableProcessor(ctx context.Context, req *documentaipb.DisableProcessorRequest, opts ...gax.CallOption) (*DisableProcessorOperation, error)
DisableProcessor disables a processor
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.DisableProcessorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#DisableProcessorRequest.
}
op, err := c.DisableProcessor(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DocumentProcessorClient) DisableProcessorOperation ¶
func (c *DocumentProcessorClient) DisableProcessorOperation(name string) *DisableProcessorOperation
DisableProcessorOperation returns a new DisableProcessorOperation from a given name. The name must be that of a previously created DisableProcessorOperation, possibly from a different process.
func (*DocumentProcessorClient) EnableProcessor ¶
func (c *DocumentProcessorClient) EnableProcessor(ctx context.Context, req *documentaipb.EnableProcessorRequest, opts ...gax.CallOption) (*EnableProcessorOperation, error)
EnableProcessor enables a processor
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.EnableProcessorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#EnableProcessorRequest.
}
op, err := c.EnableProcessor(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DocumentProcessorClient) EnableProcessorOperation ¶
func (c *DocumentProcessorClient) EnableProcessorOperation(name string) *EnableProcessorOperation
EnableProcessorOperation returns a new EnableProcessorOperation from a given name. The name must be that of a previously created EnableProcessorOperation, possibly from a different process.
func (*DocumentProcessorClient) EvaluateProcessorVersion ¶
func (c *DocumentProcessorClient) EvaluateProcessorVersion(ctx context.Context, req *documentaipb.EvaluateProcessorVersionRequest, opts ...gax.CallOption) (*EvaluateProcessorVersionOperation, error)
EvaluateProcessorVersion evaluates a ProcessorVersion against annotated documents, producing an
Evaluation.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.EvaluateProcessorVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#EvaluateProcessorVersionRequest.
}
op, err := c.EvaluateProcessorVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DocumentProcessorClient) EvaluateProcessorVersionOperation ¶
func (c *DocumentProcessorClient) EvaluateProcessorVersionOperation(name string) *EvaluateProcessorVersionOperation
EvaluateProcessorVersionOperation returns a new EvaluateProcessorVersionOperation from a given name. The name must be that of a previously created EvaluateProcessorVersionOperation, possibly from a different process.
func (*DocumentProcessorClient) FetchProcessorTypes ¶
func (c *DocumentProcessorClient) FetchProcessorTypes(ctx context.Context, req *documentaipb.FetchProcessorTypesRequest, opts ...gax.CallOption) (*documentaipb.FetchProcessorTypesResponse, error)
FetchProcessorTypes fetches processor types. Note that we don’t use
ListProcessorTypes
here, because it isn’t paginated.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.FetchProcessorTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#FetchProcessorTypesRequest.
}
resp, err := c.FetchProcessorTypes(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DocumentProcessorClient) GetEvaluation ¶
func (c *DocumentProcessorClient) GetEvaluation(ctx context.Context, req *documentaipb.GetEvaluationRequest, opts ...gax.CallOption) (*documentaipb.Evaluation, error)
GetEvaluation retrieves a specific evaluation.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.GetEvaluationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#GetEvaluationRequest.
}
resp, err := c.GetEvaluation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DocumentProcessorClient) GetLocation ¶
func (c *DocumentProcessorClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
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 := documentai.NewDocumentProcessorClient(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 (*DocumentProcessorClient) GetOperation ¶
func (c *DocumentProcessorClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
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 := documentai.NewDocumentProcessorClient(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 (*DocumentProcessorClient) GetProcessor ¶
func (c *DocumentProcessorClient) GetProcessor(ctx context.Context, req *documentaipb.GetProcessorRequest, opts ...gax.CallOption) (*documentaipb.Processor, error)
GetProcessor gets a processor detail.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.GetProcessorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#GetProcessorRequest.
}
resp, err := c.GetProcessor(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DocumentProcessorClient) GetProcessorType ¶
func (c *DocumentProcessorClient) GetProcessorType(ctx context.Context, req *documentaipb.GetProcessorTypeRequest, opts ...gax.CallOption) (*documentaipb.ProcessorType, error)
GetProcessorType gets a processor type detail.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.GetProcessorTypeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#GetProcessorTypeRequest.
}
resp, err := c.GetProcessorType(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DocumentProcessorClient) GetProcessorVersion ¶
func (c *DocumentProcessorClient) GetProcessorVersion(ctx context.Context, req *documentaipb.GetProcessorVersionRequest, opts ...gax.CallOption) (*documentaipb.ProcessorVersion, error)
GetProcessorVersion gets a processor version detail.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.GetProcessorVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#GetProcessorVersionRequest.
}
resp, err := c.GetProcessorVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DocumentProcessorClient) ListEvaluations ¶
func (c *DocumentProcessorClient) ListEvaluations(ctx context.Context, req *documentaipb.ListEvaluationsRequest, opts ...gax.CallOption) *EvaluationIterator
ListEvaluations retrieves a set of evaluations for a given processor version.
Code:play
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
"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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.ListEvaluationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#ListEvaluationsRequest.
}
it := c.ListEvaluations(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.(*documentaipb.ListEvaluationsResponse)
}
}
Example (All)¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.ListEvaluationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#ListEvaluationsRequest.
}
for resp, err := range c.ListEvaluations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DocumentProcessorClient) ListLocations ¶
func (c *DocumentProcessorClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
"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 := documentai.NewDocumentProcessorClient(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)
}
}
Example (All)¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
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 := documentai.NewDocumentProcessorClient(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 (*DocumentProcessorClient) ListOperations ¶
func (c *DocumentProcessorClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
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 := documentai.NewDocumentProcessorClient(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)
}
}
Example (All)¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
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 := documentai.NewDocumentProcessorClient(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 (*DocumentProcessorClient) ListProcessorTypes ¶
func (c *DocumentProcessorClient) ListProcessorTypes(ctx context.Context, req *documentaipb.ListProcessorTypesRequest, opts ...gax.CallOption) *ProcessorTypeIterator
ListProcessorTypes lists the processor types that exist.
Code:play
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
"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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.ListProcessorTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#ListProcessorTypesRequest.
}
it := c.ListProcessorTypes(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.(*documentaipb.ListProcessorTypesResponse)
}
}
Example (All)¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.ListProcessorTypesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#ListProcessorTypesRequest.
}
for resp, err := range c.ListProcessorTypes(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DocumentProcessorClient) ListProcessorVersions ¶
func (c *DocumentProcessorClient) ListProcessorVersions(ctx context.Context, req *documentaipb.ListProcessorVersionsRequest, opts ...gax.CallOption) *ProcessorVersionIterator
ListProcessorVersions lists all versions of a processor.
Code:play
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
"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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.ListProcessorVersionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#ListProcessorVersionsRequest.
}
it := c.ListProcessorVersions(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.(*documentaipb.ListProcessorVersionsResponse)
}
}
Example (All)¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.ListProcessorVersionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#ListProcessorVersionsRequest.
}
for resp, err := range c.ListProcessorVersions(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DocumentProcessorClient) ListProcessors ¶
func (c *DocumentProcessorClient) ListProcessors(ctx context.Context, req *documentaipb.ListProcessorsRequest, opts ...gax.CallOption) *ProcessorIterator
ListProcessors lists all processors which belong to this project.
Code:play
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
"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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.ListProcessorsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#ListProcessorsRequest.
}
it := c.ListProcessors(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.(*documentaipb.ListProcessorsResponse)
}
}
Example (All)¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.ListProcessorsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#ListProcessorsRequest.
}
for resp, err := range c.ListProcessors(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DocumentProcessorClient) ProcessDocument ¶
func (c *DocumentProcessorClient) ProcessDocument(ctx context.Context, req *documentaipb.ProcessRequest, opts ...gax.CallOption) (*documentaipb.ProcessResponse, error)
ProcessDocument processes a single document.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.ProcessRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#ProcessRequest.
}
resp, err := c.ProcessDocument(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DocumentProcessorClient) ReviewDocument ¶
func (c *DocumentProcessorClient) ReviewDocument(ctx context.Context, req *documentaipb.ReviewDocumentRequest, opts ...gax.CallOption) (*ReviewDocumentOperation, error)
ReviewDocument send a document for Human Review. The input document should be processed by
the specified processor.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.ReviewDocumentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#ReviewDocumentRequest.
}
op, err := c.ReviewDocument(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DocumentProcessorClient) ReviewDocumentOperation ¶
func (c *DocumentProcessorClient) ReviewDocumentOperation(name string) *ReviewDocumentOperation
ReviewDocumentOperation returns a new ReviewDocumentOperation from a given name. The name must be that of a previously created ReviewDocumentOperation, possibly from a different process.
func (*DocumentProcessorClient) SetDefaultProcessorVersion ¶
func (c *DocumentProcessorClient) SetDefaultProcessorVersion(ctx context.Context, req *documentaipb.SetDefaultProcessorVersionRequest, opts ...gax.CallOption) (*SetDefaultProcessorVersionOperation, error)
SetDefaultProcessorVersion set the default (active) version of a
Processor that will be used in
ProcessDocument
and
BatchProcessDocuments.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.SetDefaultProcessorVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#SetDefaultProcessorVersionRequest.
}
op, err := c.SetDefaultProcessorVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DocumentProcessorClient) SetDefaultProcessorVersionOperation ¶
func (c *DocumentProcessorClient) SetDefaultProcessorVersionOperation(name string) *SetDefaultProcessorVersionOperation
SetDefaultProcessorVersionOperation returns a new SetDefaultProcessorVersionOperation from a given name. The name must be that of a previously created SetDefaultProcessorVersionOperation, possibly from a different process.
func (*DocumentProcessorClient) TrainProcessorVersion ¶
func (c *DocumentProcessorClient) TrainProcessorVersion(ctx context.Context, req *documentaipb.TrainProcessorVersionRequest, opts ...gax.CallOption) (*TrainProcessorVersionOperation, error)
TrainProcessorVersion trains a new processor version.
Operation metadata is returned as
TrainProcessorVersionMetadata.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.TrainProcessorVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#TrainProcessorVersionRequest.
}
op, err := c.TrainProcessorVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DocumentProcessorClient) TrainProcessorVersionOperation ¶
func (c *DocumentProcessorClient) TrainProcessorVersionOperation(name string) *TrainProcessorVersionOperation
TrainProcessorVersionOperation returns a new TrainProcessorVersionOperation from a given name. The name must be that of a previously created TrainProcessorVersionOperation, possibly from a different process.
func (*DocumentProcessorClient) UndeployProcessorVersion ¶
func (c *DocumentProcessorClient) UndeployProcessorVersion(ctx context.Context, req *documentaipb.UndeployProcessorVersionRequest, opts ...gax.CallOption) (*UndeployProcessorVersionOperation, error)
UndeployProcessorVersion undeploys the processor version.
Code:play
Example¶
package main
import (
"context"
documentai "cloud.google.com/go/documentai/apiv1"
documentaipb "cloud.google.com/go/documentai/apiv1/documentaipb"
)
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 := documentai.NewDocumentProcessorClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &documentaipb.UndeployProcessorVersionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/documentai/apiv1/documentaipb#UndeployProcessorVersionRequest.
}
op, err := c.UndeployProcessorVersion(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DocumentProcessorClient) UndeployProcessorVersionOperation ¶
func (c *DocumentProcessorClient) UndeployProcessorVersionOperation(name string) *UndeployProcessorVersionOperation
UndeployProcessorVersionOperation returns a new UndeployProcessorVersionOperation from a given name. The name must be that of a previously created UndeployProcessorVersionOperation, possibly from a different process.
type EnableProcessorOperation ¶
type EnableProcessorOperation struct {
// contains filtered or unexported fields
}
EnableProcessorOperation manages a long-running operation from EnableProcessor.
func (*EnableProcessorOperation) Done ¶
func (op *EnableProcessorOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*EnableProcessorOperation) Metadata ¶
func (op *EnableProcessorOperation) Metadata() (*documentaipb.EnableProcessorMetadata, 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 (*EnableProcessorOperation) Name ¶
func (op *EnableProcessorOperation) 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 (*EnableProcessorOperation) Poll ¶
func (op *EnableProcessorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*documentaipb.EnableProcessorResponse, 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 (*EnableProcessorOperation) Wait ¶
func (op *EnableProcessorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*documentaipb.EnableProcessorResponse, 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.
type EvaluateProcessorVersionOperation ¶
type EvaluateProcessorVersionOperation struct {
// contains filtered or unexported fields
}
EvaluateProcessorVersionOperation manages a long-running operation from EvaluateProcessorVersion.
func (*EvaluateProcessorVersionOperation) Done ¶
func (op *EvaluateProcessorVersionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*EvaluateProcessorVersionOperation) Metadata ¶
func (op *EvaluateProcessorVersionOperation) Metadata() (*documentaipb.EvaluateProcessorVersionMetadata, 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 (*EvaluateProcessorVersionOperation) Name ¶
func (op *EvaluateProcessorVersionOperation) 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 (*EvaluateProcessorVersionOperation) Poll ¶
func (op *EvaluateProcessorVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*documentaipb.EvaluateProcessorVersionResponse, 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 (*EvaluateProcessorVersionOperation) Wait ¶
func (op *EvaluateProcessorVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*documentaipb.EvaluateProcessorVersionResponse, 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.
type EvaluationIterator ¶
type EvaluationIterator 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 []*documentaipb.Evaluation, nextPageToken string, err error) // contains filtered or unexported fields }
EvaluationIterator manages a stream of *documentaipb.Evaluation.
func (*EvaluationIterator) All ¶
func (it *EvaluationIterator) All() iter.Seq2[*documentaipb.Evaluation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*EvaluationIterator) Next ¶
func (it *EvaluationIterator) Next() (*documentaipb.Evaluation, 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 (*EvaluationIterator) PageInfo ¶
func (it *EvaluationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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.
type 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 ¶
func (it *OperationIterator) Next() (*longrunningpb.Operation, 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 (*OperationIterator) PageInfo ¶
func (it *OperationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ProcessorIterator ¶
type ProcessorIterator 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 []*documentaipb.Processor, nextPageToken string, err error) // contains filtered or unexported fields }
ProcessorIterator manages a stream of *documentaipb.Processor.
func (*ProcessorIterator) All ¶
func (it *ProcessorIterator) All() iter.Seq2[*documentaipb.Processor, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ProcessorIterator) Next ¶
func (it *ProcessorIterator) Next() (*documentaipb.Processor, 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 (*ProcessorIterator) PageInfo ¶
func (it *ProcessorIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ProcessorTypeIterator ¶
type ProcessorTypeIterator 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 []*documentaipb.ProcessorType, nextPageToken string, err error) // contains filtered or unexported fields }
ProcessorTypeIterator manages a stream of *documentaipb.ProcessorType.
func (*ProcessorTypeIterator) All ¶
func (it *ProcessorTypeIterator) All() iter.Seq2[*documentaipb.ProcessorType, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ProcessorTypeIterator) Next ¶
func (it *ProcessorTypeIterator) Next() (*documentaipb.ProcessorType, 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 (*ProcessorTypeIterator) PageInfo ¶
func (it *ProcessorTypeIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ProcessorVersionIterator ¶
type ProcessorVersionIterator 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 []*documentaipb.ProcessorVersion, nextPageToken string, err error) // contains filtered or unexported fields }
ProcessorVersionIterator manages a stream of *documentaipb.ProcessorVersion.
func (*ProcessorVersionIterator) All ¶
func (it *ProcessorVersionIterator) All() iter.Seq2[*documentaipb.ProcessorVersion, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ProcessorVersionIterator) Next ¶
func (it *ProcessorVersionIterator) Next() (*documentaipb.ProcessorVersion, 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 (*ProcessorVersionIterator) PageInfo ¶
func (it *ProcessorVersionIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ReviewDocumentOperation ¶
type ReviewDocumentOperation struct {
// contains filtered or unexported fields
}
ReviewDocumentOperation manages a long-running operation from ReviewDocument.
func (*ReviewDocumentOperation) Done ¶
func (op *ReviewDocumentOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ReviewDocumentOperation) Metadata ¶
func (op *ReviewDocumentOperation) Metadata() (*documentaipb.ReviewDocumentOperationMetadata, 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 (*ReviewDocumentOperation) Name ¶
func (op *ReviewDocumentOperation) 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 (*ReviewDocumentOperation) Poll ¶
func (op *ReviewDocumentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*documentaipb.ReviewDocumentResponse, 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 (*ReviewDocumentOperation) Wait ¶
func (op *ReviewDocumentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*documentaipb.ReviewDocumentResponse, 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.
type SetDefaultProcessorVersionOperation ¶
type SetDefaultProcessorVersionOperation struct {
// contains filtered or unexported fields
}
SetDefaultProcessorVersionOperation manages a long-running operation from SetDefaultProcessorVersion.
func (*SetDefaultProcessorVersionOperation) Done ¶
func (op *SetDefaultProcessorVersionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*SetDefaultProcessorVersionOperation) Metadata ¶
func (op *SetDefaultProcessorVersionOperation) Metadata() (*documentaipb.SetDefaultProcessorVersionMetadata, 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 (*SetDefaultProcessorVersionOperation) Name ¶
func (op *SetDefaultProcessorVersionOperation) 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 (*SetDefaultProcessorVersionOperation) Poll ¶
func (op *SetDefaultProcessorVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*documentaipb.SetDefaultProcessorVersionResponse, 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 (*SetDefaultProcessorVersionOperation) Wait ¶
func (op *SetDefaultProcessorVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*documentaipb.SetDefaultProcessorVersionResponse, 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.
type TrainProcessorVersionOperation ¶
type TrainProcessorVersionOperation struct {
// contains filtered or unexported fields
}
TrainProcessorVersionOperation manages a long-running operation from TrainProcessorVersion.
func (*TrainProcessorVersionOperation) Done ¶
func (op *TrainProcessorVersionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*TrainProcessorVersionOperation) Metadata ¶
func (op *TrainProcessorVersionOperation) Metadata() (*documentaipb.TrainProcessorVersionMetadata, 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 (*TrainProcessorVersionOperation) Name ¶
func (op *TrainProcessorVersionOperation) 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 (*TrainProcessorVersionOperation) Poll ¶
func (op *TrainProcessorVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*documentaipb.TrainProcessorVersionResponse, 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 (*TrainProcessorVersionOperation) Wait ¶
func (op *TrainProcessorVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*documentaipb.TrainProcessorVersionResponse, 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.
type UndeployProcessorVersionOperation ¶
type UndeployProcessorVersionOperation struct {
// contains filtered or unexported fields
}
UndeployProcessorVersionOperation manages a long-running operation from UndeployProcessorVersion.
func (*UndeployProcessorVersionOperation) Done ¶
func (op *UndeployProcessorVersionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UndeployProcessorVersionOperation) Metadata ¶
func (op *UndeployProcessorVersionOperation) Metadata() (*documentaipb.UndeployProcessorVersionMetadata, 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 (*UndeployProcessorVersionOperation) Name ¶
func (op *UndeployProcessorVersionOperation) 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 (*UndeployProcessorVersionOperation) Poll ¶
func (op *UndeployProcessorVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*documentaipb.UndeployProcessorVersionResponse, 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 (*UndeployProcessorVersionOperation) Wait ¶
func (op *UndeployProcessorVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*documentaipb.UndeployProcessorVersionResponse, 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.
Source Files ¶
auxiliary.go auxiliary_go123.go doc.go document_processor_client.go helpers.go version.go
Directories ¶
Path | Synopsis |
---|---|
apiv1/documentaipb |
- Version
- v1.35.2 (latest)
- Published
- Feb 12, 2025
- Platform
- linux/amd64
- Imports
- 30 packages
- Last checked
- 5 days ago –
Tools for package owners.