Skip to content

Commit

Permalink
feat: added sharding_config field in DocumentOutputConfig.GcsOutputCo…
Browse files Browse the repository at this point in the history
…nfig in document_io.proto (#3750)

- [ ] Regenerate this pull request now.

feat: added process_options field in ProcessRequest in document_processor_service.proto
feat: added sample_document_uris field in ProcessorType in processor_type.proto

PiperOrigin-RevId: 495363748

Source-Link: https://togithub.com/googleapis/googleapis/commit/3dce9ff167afafeddda96de98192af131b313ffc

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/66f3518217f0c04a47faefeb3322ff226106b857
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRvY3VtZW50YWkvLk93bEJvdC55YW1sIiwiaCI6IjY2ZjM1MTgyMTdmMGMwNGE0N2ZhZWZlYjMzMjJmZjIyNjEwNmI4NTcifQ==

BEGIN_NESTED_COMMIT
feat: added sharding_config field in DocumentOutputConfig.GcsOutputConfig in document_io.proto
feat: added process_options field in ProcessRequest in document_processor_service.proto
feat: added sample_document_uris field in ProcessorType in processor_type.proto

PiperOrigin-RevId: 495360288

Source-Link: https://togithub.com/googleapis/googleapis/commit/5f39f4653ed9b257db3f4e19bb3f9178f56b294b

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/8520d57093d360afec194cd029b71324e597f626
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRvY3VtZW50YWkvLk93bEJvdC55YW1sIiwiaCI6Ijg1MjBkNTcwOTNkMzYwYWZlYzE5NGNkMDI5YjcxMzI0ZTU5N2Y2MjYifQ==
END_NESTED_COMMIT
  • Loading branch information
gcf-owl-bot[bot] authored Dec 15, 2022
1 parent 626efe9 commit f9fc947
Show file tree
Hide file tree
Showing 36 changed files with 1,513 additions and 439 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ option (google.api.resource_definition) = {
// structured information from unstructured or semi-structured documents.
service DocumentProcessorService {
option (google.api.default_host) = "documentai.googleapis.com";
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";

// Processes a single document.
rpc ProcessDocument(ProcessRequest) returns (ProcessResponse) {
Expand All @@ -70,7 +71,8 @@ service DocumentProcessorService {

// LRO endpoint to batch process many documents. The output is written
// to Cloud Storage as JSON in the [Document] format.
rpc BatchProcessDocuments(BatchProcessRequest) returns (google.longrunning.Operation) {
rpc BatchProcessDocuments(BatchProcessRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/processors/*}:batchProcess"
body: "*"
Expand All @@ -88,15 +90,17 @@ service DocumentProcessorService {

// Fetches processor types. Note that we do not use ListProcessorTypes here
// because it is not paginated.
rpc FetchProcessorTypes(FetchProcessorTypesRequest) returns (FetchProcessorTypesResponse) {
rpc FetchProcessorTypes(FetchProcessorTypesRequest)
returns (FetchProcessorTypesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}:fetchProcessorTypes"
};
option (google.api.method_signature) = "parent";
}

// Lists the processor types that exist.
rpc ListProcessorTypes(ListProcessorTypesRequest) returns (ListProcessorTypesResponse) {
rpc ListProcessorTypes(ListProcessorTypesRequest)
returns (ListProcessorTypesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/processorTypes"
};
Expand All @@ -120,15 +124,17 @@ service DocumentProcessorService {
}

// Gets a processor version detail.
rpc GetProcessorVersion(GetProcessorVersionRequest) returns (ProcessorVersion) {
rpc GetProcessorVersion(GetProcessorVersionRequest)
returns (ProcessorVersion) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}"
};
option (google.api.method_signature) = "name";
}

// Lists all versions of a processor.
rpc ListProcessorVersions(ListProcessorVersionsRequest) returns (ListProcessorVersionsResponse) {
rpc ListProcessorVersions(ListProcessorVersionsRequest)
returns (ListProcessorVersionsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions"
};
Expand All @@ -137,7 +143,8 @@ service DocumentProcessorService {

// Deletes the processor version, all artifacts under the processor version
// will be deleted.
rpc DeleteProcessorVersion(DeleteProcessorVersionRequest) returns (google.longrunning.Operation) {
rpc DeleteProcessorVersion(DeleteProcessorVersionRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}"
};
Expand All @@ -149,7 +156,8 @@ service DocumentProcessorService {
}

// Deploys the processor version.
rpc DeployProcessorVersion(DeployProcessorVersionRequest) returns (google.longrunning.Operation) {
rpc DeployProcessorVersion(DeployProcessorVersionRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy"
body: "*"
Expand All @@ -162,7 +170,8 @@ service DocumentProcessorService {
}

// Undeploys the processor version.
rpc UndeployProcessorVersion(UndeployProcessorVersionRequest) returns (google.longrunning.Operation) {
rpc UndeployProcessorVersion(UndeployProcessorVersionRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy"
body: "*"
Expand All @@ -186,7 +195,8 @@ service DocumentProcessorService {

// Deletes the processor, unloads all deployed model artifacts if it was
// enabled and then deletes all artifacts associated with this processor.
rpc DeleteProcessor(DeleteProcessorRequest) returns (google.longrunning.Operation) {
rpc DeleteProcessor(DeleteProcessorRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/processors/*}"
};
Expand All @@ -198,7 +208,8 @@ service DocumentProcessorService {
}

// Enables a processor
rpc EnableProcessor(EnableProcessorRequest) returns (google.longrunning.Operation) {
rpc EnableProcessor(EnableProcessorRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/processors/*}:enable"
body: "*"
Expand All @@ -210,7 +221,8 @@ service DocumentProcessorService {
}

// Disables a processor
rpc DisableProcessor(DisableProcessorRequest) returns (google.longrunning.Operation) {
rpc DisableProcessor(DisableProcessorRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/processors/*}:disable"
body: "*"
Expand All @@ -221,10 +233,13 @@ service DocumentProcessorService {
};
}

// Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that will be used in
// [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and
// Set the default (active) version of a
// [Processor][google.cloud.documentai.v1.Processor] that will be used in
// [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]
// and
// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
rpc SetDefaultProcessorVersion(SetDefaultProcessorVersionRequest) returns (google.longrunning.Operation) {
rpc SetDefaultProcessorVersion(SetDefaultProcessorVersionRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion"
body: "*"
Expand All @@ -237,7 +252,8 @@ service DocumentProcessorService {

// Send a document for Human Review. The input document should be processed by
// the specified processor.
rpc ReviewDocument(ReviewDocumentRequest) returns (google.longrunning.Operation) {
rpc ReviewDocument(ReviewDocumentRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument"
body: "*"
Expand All @@ -261,17 +277,19 @@ message ProcessRequest {
RawDocument raw_document = 5;
}

// Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or
// Required. The resource name of the
// [Processor][google.cloud.documentai.v1.Processor] or
// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]
// to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use
// its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format:
// `projects/{project}/locations/{location}/processors/{processor}`, or
// to use for processing. If a
// [Processor][google.cloud.documentai.v1.Processor] is specified, the server
// will use its [default
// version][google.cloud.documentai.v1.Processor.default_processor_version].
// Format: `projects/{project}/locations/{location}/processors/{processor}`,
// or
// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "*"
}
(google.api.resource_reference) = { type: "*" }
];

// Whether Human Review feature should be skipped for this request. Default to
Expand Down Expand Up @@ -332,16 +350,15 @@ message ProcessResponse {

// Request message for batch process document method.
message BatchProcessRequest {
// Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or
// Required. The resource name of
// [Processor][google.cloud.documentai.v1.Processor] or
// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
// Format: `projects/{project}/locations/{location}/processors/{processor}`,
// or
// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "*"
}
(google.api.resource_reference) = { type: "*" }
];

// The input documents for batch process.
Expand All @@ -356,9 +373,7 @@ message BatchProcessRequest {
}

// Response message for batch process document method.
message BatchProcessResponse {

}
message BatchProcessResponse {}

// The long running operation metadata for batch process method.
message BatchProcessMetadata {
Expand Down Expand Up @@ -473,8 +488,8 @@ message ListProcessorTypesResponse {

// Request message for list all processors belongs to a project.
message ListProcessorsRequest {
// Required. The parent (project and location) which owns this collection of Processors.
// Format: `projects/{project}/locations/{location}`
// Required. The parent (project and location) which owns this collection of
// Processors. Format: `projects/{project}/locations/{location}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down Expand Up @@ -525,8 +540,9 @@ message GetProcessorVersionRequest {

// Request message for list all processor versions belongs to a processor.
message ListProcessorVersionsRequest {
// Required. The parent (project, location and processor) to list all versions.
// Format: `projects/{project}/locations/{location}/processors/{processor}`
// Required. The parent (project, location and processor) to list all
// versions. Format:
// `projects/{project}/locations/{location}/processors/{processor}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down Expand Up @@ -582,9 +598,7 @@ message DeployProcessorVersionRequest {
}

// Response message for the deploy processor version method.
message DeployProcessorVersionResponse {

}
message DeployProcessorVersionResponse {}

// The long running operation metadata for deploy processor version method.
message DeployProcessorVersionMetadata {
Expand All @@ -604,9 +618,7 @@ message UndeployProcessorVersionRequest {
}

// Response message for the undeploy processor version method.
message UndeployProcessorVersionResponse {

}
message UndeployProcessorVersionResponse {}

// The long running operation metadata for the undeploy processor version
// method.
Expand All @@ -619,17 +631,18 @@ message UndeployProcessorVersionMetadata {
// a regionalized backend service, and if the processor type is not available
// on that region, the creation will fail.
message CreateProcessorRequest {
// Required. The parent (project and location) under which to create the processor.
// Format: `projects/{project}/locations/{location}`
// Required. The parent (project and location) under which to create the
// processor. Format: `projects/{project}/locations/{location}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "documentai.googleapis.com/Processor"
}
];

// Required. The processor to be created, requires [processor_type] and [display_name]
// to be set. Also, the processor is under CMEK if CMEK fields are set.
// Required. The processor to be created, requires [processor_type] and
// [display_name] to be set. Also, the processor is under CMEK if CMEK fields
// are set.
Processor processor = 2 [(google.api.field_behavior) = REQUIRED];
}

Expand Down Expand Up @@ -663,9 +676,7 @@ message EnableProcessorRequest {

// Response message for the enable processor method.
// Intentionally empty proto for adding fields in future.
message EnableProcessorResponse {

}
message EnableProcessorResponse {}

// The long running operation metadata for enable processor method.
message EnableProcessorMetadata {
Expand All @@ -686,9 +697,7 @@ message DisableProcessorRequest {

// Response message for the disable processor method.
// Intentionally empty proto for adding fields in future.
message DisableProcessorResponse {

}
message DisableProcessorResponse {}

// The long running operation metadata for disable processor method.
message DisableProcessorMetadata {
Expand All @@ -698,16 +707,19 @@ message DisableProcessorMetadata {

// Request message for the set default processor version method.
message SetDefaultProcessorVersionRequest {
// Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version.
// Required. The resource name of the
// [Processor][google.cloud.documentai.v1.Processor] to change default
// version.
string processor = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "documentai.googleapis.com/Processor"
}
];

// Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default.
// Format:
// Required. The resource name of child
// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as
// default. Format:
// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
string default_processor_version = 2 [
(google.api.field_behavior) = REQUIRED,
Expand All @@ -718,9 +730,7 @@ message SetDefaultProcessorVersionRequest {
}

// Response message for set default processor version method.
message SetDefaultProcessorVersionResponse {

}
message SetDefaultProcessorVersionResponse {}

// The long running operation metadata for set default processor version
// method.
Expand All @@ -747,8 +757,8 @@ message ReviewDocumentRequest {
Document inline_document = 4;
}

// Required. The resource name of the HumanReviewConfig that the document will be
// reviewed with.
// Required. The resource name of the HumanReviewConfig that the document will
// be reviewed with.
string human_review_config = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ message DocumentSchema {
// conventions:
//
// - *use `snake_casing`*
// - name matching is case-insensitive
// - name matching is case-sensitive
// - Maximum 64 characters.
// - Must start with a letter.
// - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ message ProcessorVersion {
google.protobuf.Timestamp deprecation_time = 1;

// If set, the processor version that will be used as a replacement.
string replacement_processor_version = 2 [(google.api.resource_reference) = {
type: "documentai.googleapis.com/ProcessorVersion"
}];
string replacement_processor_version = 2
[(google.api.resource_reference) = {
type: "documentai.googleapis.com/ProcessorVersion"
}];
}

// The possible states of the processor version.
Expand Down Expand Up @@ -171,10 +172,11 @@ message Processor {

// The default processor version.
string default_processor_version = 9 [(google.api.resource_reference) = {
type: "documentai.googleapis.com/ProcessorVersion"
}];
type: "documentai.googleapis.com/ProcessorVersion"
}];

// Output only. Immutable. The http endpoint that can be called to invoke processing.
// Output only. Immutable. The http endpoint that can be called to invoke
// processing.
string process_endpoint = 6 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.field_behavior) = IMMUTABLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,7 @@ message ProcessorType {

// Launch stage of the processor type
google.api.LaunchStage launch_stage = 8;

// A set of Cloud Storage URIs of sample documents for this processor.
repeated string sample_document_uris = 9;
}
Loading

0 comments on commit f9fc947

Please sign in to comment.