document_processor_service.proto 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.documentai.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/cloud/documentai/v1/document.proto";
  21. import "google/cloud/documentai/v1/document_io.proto";
  22. import "google/cloud/documentai/v1/document_schema.proto";
  23. import "google/cloud/documentai/v1/operation_metadata.proto";
  24. import "google/cloud/documentai/v1/processor.proto";
  25. import "google/cloud/documentai/v1/processor_type.proto";
  26. import "google/longrunning/operations.proto";
  27. import "google/protobuf/field_mask.proto";
  28. import "google/protobuf/timestamp.proto";
  29. import "google/rpc/status.proto";
  30. option csharp_namespace = "Google.Cloud.DocumentAI.V1";
  31. option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1;documentai";
  32. option java_multiple_files = true;
  33. option java_outer_classname = "DocumentAiProcessorService";
  34. option java_package = "com.google.cloud.documentai.v1";
  35. option php_namespace = "Google\\Cloud\\DocumentAI\\V1";
  36. option ruby_package = "Google::Cloud::DocumentAI::V1";
  37. option (google.api.resource_definition) = {
  38. type: "documentai.googleapis.com/HumanReviewConfig"
  39. pattern: "projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig"
  40. };
  41. option (google.api.resource_definition) = {
  42. type: "documentai.googleapis.com/Location"
  43. pattern: "projects/{project}/locations/{location}"
  44. };
  45. // Service to call Cloud DocumentAI to process documents according to the
  46. // processor's definition. Processors are built using state-of-the-art Google
  47. // AI such as natural language, computer vision, and translation to extract
  48. // structured information from unstructured or semi-structured documents.
  49. service DocumentProcessorService {
  50. option (google.api.default_host) = "documentai.googleapis.com";
  51. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  52. // Processes a single document.
  53. rpc ProcessDocument(ProcessRequest) returns (ProcessResponse) {
  54. option (google.api.http) = {
  55. post: "/v1/{name=projects/*/locations/*/processors/*}:process"
  56. body: "*"
  57. additional_bindings {
  58. post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:process"
  59. body: "*"
  60. }
  61. };
  62. option (google.api.method_signature) = "name";
  63. }
  64. // LRO endpoint to batch process many documents. The output is written
  65. // to Cloud Storage as JSON in the [Document] format.
  66. rpc BatchProcessDocuments(BatchProcessRequest) returns (google.longrunning.Operation) {
  67. option (google.api.http) = {
  68. post: "/v1/{name=projects/*/locations/*/processors/*}:batchProcess"
  69. body: "*"
  70. additional_bindings {
  71. post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess"
  72. body: "*"
  73. }
  74. };
  75. option (google.api.method_signature) = "name";
  76. option (google.longrunning.operation_info) = {
  77. response_type: "BatchProcessResponse"
  78. metadata_type: "BatchProcessMetadata"
  79. };
  80. }
  81. // Fetches processor types. Note that we do not use ListProcessorTypes here
  82. // because it is not paginated.
  83. rpc FetchProcessorTypes(FetchProcessorTypesRequest) returns (FetchProcessorTypesResponse) {
  84. option (google.api.http) = {
  85. get: "/v1/{parent=projects/*/locations/*}:fetchProcessorTypes"
  86. };
  87. option (google.api.method_signature) = "parent";
  88. }
  89. // Lists the processor types that exist.
  90. rpc ListProcessorTypes(ListProcessorTypesRequest) returns (ListProcessorTypesResponse) {
  91. option (google.api.http) = {
  92. get: "/v1/{parent=projects/*/locations/*}/processorTypes"
  93. };
  94. option (google.api.method_signature) = "parent";
  95. }
  96. // Lists all processors which belong to this project.
  97. rpc ListProcessors(ListProcessorsRequest) returns (ListProcessorsResponse) {
  98. option (google.api.http) = {
  99. get: "/v1/{parent=projects/*/locations/*}/processors"
  100. };
  101. option (google.api.method_signature) = "parent";
  102. }
  103. // Gets a processor detail.
  104. rpc GetProcessor(GetProcessorRequest) returns (Processor) {
  105. option (google.api.http) = {
  106. get: "/v1/{name=projects/*/locations/*/processors/*}"
  107. };
  108. option (google.api.method_signature) = "name";
  109. }
  110. // Gets a processor version detail.
  111. rpc GetProcessorVersion(GetProcessorVersionRequest) returns (ProcessorVersion) {
  112. option (google.api.http) = {
  113. get: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}"
  114. };
  115. option (google.api.method_signature) = "name";
  116. }
  117. // Lists all versions of a processor.
  118. rpc ListProcessorVersions(ListProcessorVersionsRequest) returns (ListProcessorVersionsResponse) {
  119. option (google.api.http) = {
  120. get: "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions"
  121. };
  122. option (google.api.method_signature) = "parent";
  123. }
  124. // Deletes the processor version, all artifacts under the processor version
  125. // will be deleted.
  126. rpc DeleteProcessorVersion(DeleteProcessorVersionRequest) returns (google.longrunning.Operation) {
  127. option (google.api.http) = {
  128. delete: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}"
  129. };
  130. option (google.api.method_signature) = "name";
  131. option (google.longrunning.operation_info) = {
  132. response_type: "google.protobuf.Empty"
  133. metadata_type: "DeleteProcessorVersionMetadata"
  134. };
  135. }
  136. // Deploys the processor version.
  137. rpc DeployProcessorVersion(DeployProcessorVersionRequest) returns (google.longrunning.Operation) {
  138. option (google.api.http) = {
  139. post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy"
  140. body: "*"
  141. };
  142. option (google.api.method_signature) = "name";
  143. option (google.longrunning.operation_info) = {
  144. response_type: "DeployProcessorVersionResponse"
  145. metadata_type: "DeployProcessorVersionMetadata"
  146. };
  147. }
  148. // Undeploys the processor version.
  149. rpc UndeployProcessorVersion(UndeployProcessorVersionRequest) returns (google.longrunning.Operation) {
  150. option (google.api.http) = {
  151. post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy"
  152. body: "*"
  153. };
  154. option (google.api.method_signature) = "name";
  155. option (google.longrunning.operation_info) = {
  156. response_type: "UndeployProcessorVersionResponse"
  157. metadata_type: "UndeployProcessorVersionMetadata"
  158. };
  159. }
  160. // Creates a processor from the type processor that the user chose.
  161. // The processor will be at "ENABLED" state by default after its creation.
  162. rpc CreateProcessor(CreateProcessorRequest) returns (Processor) {
  163. option (google.api.http) = {
  164. post: "/v1/{parent=projects/*/locations/*}/processors"
  165. body: "processor"
  166. };
  167. option (google.api.method_signature) = "parent,processor";
  168. }
  169. // Deletes the processor, unloads all deployed model artifacts if it was
  170. // enabled and then deletes all artifacts associated with this processor.
  171. rpc DeleteProcessor(DeleteProcessorRequest) returns (google.longrunning.Operation) {
  172. option (google.api.http) = {
  173. delete: "/v1/{name=projects/*/locations/*/processors/*}"
  174. };
  175. option (google.api.method_signature) = "name";
  176. option (google.longrunning.operation_info) = {
  177. response_type: "google.protobuf.Empty"
  178. metadata_type: "DeleteProcessorMetadata"
  179. };
  180. }
  181. // Enables a processor
  182. rpc EnableProcessor(EnableProcessorRequest) returns (google.longrunning.Operation) {
  183. option (google.api.http) = {
  184. post: "/v1/{name=projects/*/locations/*/processors/*}:enable"
  185. body: "*"
  186. };
  187. option (google.longrunning.operation_info) = {
  188. response_type: "EnableProcessorResponse"
  189. metadata_type: "EnableProcessorMetadata"
  190. };
  191. }
  192. // Disables a processor
  193. rpc DisableProcessor(DisableProcessorRequest) returns (google.longrunning.Operation) {
  194. option (google.api.http) = {
  195. post: "/v1/{name=projects/*/locations/*/processors/*}:disable"
  196. body: "*"
  197. };
  198. option (google.longrunning.operation_info) = {
  199. response_type: "DisableProcessorResponse"
  200. metadata_type: "DisableProcessorMetadata"
  201. };
  202. }
  203. // Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that will be used in
  204. // [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and
  205. // [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
  206. rpc SetDefaultProcessorVersion(SetDefaultProcessorVersionRequest) returns (google.longrunning.Operation) {
  207. option (google.api.http) = {
  208. post: "/v1/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion"
  209. body: "*"
  210. };
  211. option (google.longrunning.operation_info) = {
  212. response_type: "SetDefaultProcessorVersionResponse"
  213. metadata_type: "SetDefaultProcessorVersionMetadata"
  214. };
  215. }
  216. // Send a document for Human Review. The input document should be processed by
  217. // the specified processor.
  218. rpc ReviewDocument(ReviewDocumentRequest) returns (google.longrunning.Operation) {
  219. option (google.api.http) = {
  220. post: "/v1/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument"
  221. body: "*"
  222. };
  223. option (google.api.method_signature) = "human_review_config";
  224. option (google.longrunning.operation_info) = {
  225. response_type: "ReviewDocumentResponse"
  226. metadata_type: "ReviewDocumentOperationMetadata"
  227. };
  228. }
  229. }
  230. // Request message for the process document method.
  231. message ProcessRequest {
  232. // The document payload.
  233. oneof source {
  234. // An inline document proto.
  235. Document inline_document = 4;
  236. // A raw document content (bytes).
  237. RawDocument raw_document = 5;
  238. }
  239. // Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or
  240. // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]
  241. // to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use
  242. // its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format:
  243. // `projects/{project}/locations/{location}/processors/{processor}`, or
  244. // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
  245. string name = 1 [
  246. (google.api.field_behavior) = REQUIRED,
  247. (google.api.resource_reference) = {
  248. type: "*"
  249. }
  250. ];
  251. // Whether Human Review feature should be skipped for this request. Default to
  252. // false.
  253. bool skip_human_review = 3;
  254. // Specifies which fields to include in ProcessResponse's document.
  255. // Only supports top level document and pages field so it must be in the form
  256. // of `{document_field_name}` or `pages.{page_field_name}`.
  257. google.protobuf.FieldMask field_mask = 6;
  258. }
  259. // The status of human review on a processed document.
  260. message HumanReviewStatus {
  261. // The final state of human review on a processed document.
  262. enum State {
  263. // Human review state is unspecified. Most likely due to an internal error.
  264. STATE_UNSPECIFIED = 0;
  265. // Human review is skipped for the document. This can happen because human
  266. // review is not enabled on the processor or the processing request has
  267. // been set to skip this document.
  268. SKIPPED = 1;
  269. // Human review validation is triggered and passed, so no review is needed.
  270. VALIDATION_PASSED = 2;
  271. // Human review validation is triggered and the document is under review.
  272. IN_PROGRESS = 3;
  273. // Some error happened during triggering human review, see the
  274. // [state_message] for details.
  275. ERROR = 4;
  276. }
  277. // The state of human review on the processing request.
  278. State state = 1;
  279. // A message providing more details about the human review state.
  280. string state_message = 2;
  281. // The name of the operation triggered by the processed document. This field
  282. // is populated only when the [state] is [HUMAN_REVIEW_IN_PROGRESS]. It has
  283. // the same response type and metadata as the long running operation returned
  284. // by [ReviewDocument] method.
  285. string human_review_operation = 3;
  286. }
  287. // Response message for the process document method.
  288. message ProcessResponse {
  289. // The document payload, will populate fields based on the processor's
  290. // behavior.
  291. Document document = 1;
  292. // The status of human review on the processed document.
  293. HumanReviewStatus human_review_status = 3;
  294. }
  295. // Request message for batch process document method.
  296. message BatchProcessRequest {
  297. // Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or
  298. // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
  299. // Format: `projects/{project}/locations/{location}/processors/{processor}`,
  300. // or
  301. // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
  302. string name = 1 [
  303. (google.api.field_behavior) = REQUIRED,
  304. (google.api.resource_reference) = {
  305. type: "*"
  306. }
  307. ];
  308. // The input documents for batch process.
  309. BatchDocumentsInputConfig input_documents = 5;
  310. // The overall output config for batch process.
  311. DocumentOutputConfig document_output_config = 6;
  312. // Whether Human Review feature should be skipped for this request. Default to
  313. // false.
  314. bool skip_human_review = 4;
  315. }
  316. // Response message for batch process document method.
  317. message BatchProcessResponse {
  318. }
  319. // The long running operation metadata for batch process method.
  320. message BatchProcessMetadata {
  321. // The status of a each individual document in the batch process.
  322. message IndividualProcessStatus {
  323. // The source of the document, same as the [input_gcs_source] field in the
  324. // request when the batch process started. The batch process is started by
  325. // take snapshot of that document, since a user can move or change that
  326. // document during the process.
  327. string input_gcs_source = 1;
  328. // The status processing the document.
  329. google.rpc.Status status = 2;
  330. // The output_gcs_destination (in the request as `output_gcs_destination`)
  331. // of the processed document if it was successful, otherwise empty.
  332. string output_gcs_destination = 3;
  333. // The status of human review on the processed document.
  334. HumanReviewStatus human_review_status = 5;
  335. }
  336. // Possible states of the batch processing operation.
  337. enum State {
  338. // The default value. This value is used if the state is omitted.
  339. STATE_UNSPECIFIED = 0;
  340. // Request operation is waiting for scheduling.
  341. WAITING = 1;
  342. // Request is being processed.
  343. RUNNING = 2;
  344. // The batch processing completed successfully.
  345. SUCCEEDED = 3;
  346. // The batch processing was being cancelled.
  347. CANCELLING = 4;
  348. // The batch processing was cancelled.
  349. CANCELLED = 5;
  350. // The batch processing has failed.
  351. FAILED = 6;
  352. }
  353. // The state of the current batch processing.
  354. State state = 1;
  355. // A message providing more details about the current state of processing.
  356. // For example, the error message if the operation is failed.
  357. string state_message = 2;
  358. // The creation time of the operation.
  359. google.protobuf.Timestamp create_time = 3;
  360. // The last update time of the operation.
  361. google.protobuf.Timestamp update_time = 4;
  362. // The list of response details of each document.
  363. repeated IndividualProcessStatus individual_process_statuses = 5;
  364. }
  365. // Request message for fetch processor types.
  366. message FetchProcessorTypesRequest {
  367. // Required. The project of processor type to list.
  368. // The available processor types may depend on the allow-listing on projects.
  369. // Format: `projects/{project}/locations/{location}`
  370. string parent = 1 [
  371. (google.api.field_behavior) = REQUIRED,
  372. (google.api.resource_reference) = {
  373. child_type: "documentai.googleapis.com/ProcessorType"
  374. }
  375. ];
  376. }
  377. // Response message for fetch processor types.
  378. message FetchProcessorTypesResponse {
  379. // The list of processor types.
  380. repeated ProcessorType processor_types = 1;
  381. }
  382. // Request message for list processor types.
  383. message ListProcessorTypesRequest {
  384. // Required. The location of processor type to list.
  385. // The available processor types may depend on the allow-listing on projects.
  386. // Format: `projects/{project}/locations/{location}`
  387. string parent = 1 [
  388. (google.api.field_behavior) = REQUIRED,
  389. (google.api.resource_reference) = {
  390. child_type: "documentai.googleapis.com/ProcessorType"
  391. }
  392. ];
  393. // The maximum number of processor types to return.
  394. // If unspecified, at most 100 processor types will be returned.
  395. // The maximum value is 500; values above 500 will be coerced to 500.
  396. int32 page_size = 2;
  397. // Used to retrieve the next page of results, empty if at the end of the list.
  398. string page_token = 3;
  399. }
  400. // Response message for list processor types.
  401. message ListProcessorTypesResponse {
  402. // The processor types.
  403. repeated ProcessorType processor_types = 1;
  404. // Points to the next page, otherwise empty.
  405. string next_page_token = 2;
  406. }
  407. // Request message for list all processors belongs to a project.
  408. message ListProcessorsRequest {
  409. // Required. The parent (project and location) which owns this collection of Processors.
  410. // Format: `projects/{project}/locations/{location}`
  411. string parent = 1 [
  412. (google.api.field_behavior) = REQUIRED,
  413. (google.api.resource_reference) = {
  414. child_type: "documentai.googleapis.com/Processor"
  415. }
  416. ];
  417. // The maximum number of processors to return.
  418. // If unspecified, at most 50 processors will be returned.
  419. // The maximum value is 100; values above 100 will be coerced to 100.
  420. int32 page_size = 2;
  421. // We will return the processors sorted by creation time. The page token
  422. // will point to the next processor.
  423. string page_token = 3;
  424. }
  425. // Response message for list processors.
  426. message ListProcessorsResponse {
  427. // The list of processors.
  428. repeated Processor processors = 1;
  429. // Points to the next processor, otherwise empty.
  430. string next_page_token = 2;
  431. }
  432. // Request message for get processor.
  433. message GetProcessorRequest {
  434. // Required. The processor resource name.
  435. string name = 1 [
  436. (google.api.field_behavior) = REQUIRED,
  437. (google.api.resource_reference) = {
  438. type: "documentai.googleapis.com/Processor"
  439. }
  440. ];
  441. }
  442. // Request message for get processor version.
  443. message GetProcessorVersionRequest {
  444. // Required. The processor resource name.
  445. string name = 1 [
  446. (google.api.field_behavior) = REQUIRED,
  447. (google.api.resource_reference) = {
  448. type: "documentai.googleapis.com/ProcessorVersion"
  449. }
  450. ];
  451. }
  452. // Request message for list all processor versions belongs to a processor.
  453. message ListProcessorVersionsRequest {
  454. // Required. The parent (project, location and processor) to list all versions.
  455. // Format: `projects/{project}/locations/{location}/processors/{processor}`
  456. string parent = 1 [
  457. (google.api.field_behavior) = REQUIRED,
  458. (google.api.resource_reference) = {
  459. child_type: "documentai.googleapis.com/ProcessorVersion"
  460. }
  461. ];
  462. // The maximum number of processor versions to return.
  463. // If unspecified, at most 10 processor versions will be returned.
  464. // The maximum value is 20; values above 20 will be coerced to 20.
  465. int32 page_size = 2;
  466. // We will return the processor versions sorted by creation time. The page
  467. // token will point to the next processor version.
  468. string page_token = 3;
  469. }
  470. // Response message for list processors.
  471. message ListProcessorVersionsResponse {
  472. // The list of processors.
  473. repeated ProcessorVersion processor_versions = 1;
  474. // Points to the next processor, otherwise empty.
  475. string next_page_token = 2;
  476. }
  477. // Request message for the delete processor version method.
  478. message DeleteProcessorVersionRequest {
  479. // Required. The processor version resource name to be deleted.
  480. string name = 1 [
  481. (google.api.field_behavior) = REQUIRED,
  482. (google.api.resource_reference) = {
  483. type: "documentai.googleapis.com/ProcessorVersion"
  484. }
  485. ];
  486. }
  487. // The long running operation metadata for delete processor version method.
  488. message DeleteProcessorVersionMetadata {
  489. // The basic metadata of the long running operation.
  490. CommonOperationMetadata common_metadata = 1;
  491. }
  492. // Request message for the deploy processor version method.
  493. message DeployProcessorVersionRequest {
  494. // Required. The processor version resource name to be deployed.
  495. string name = 1 [
  496. (google.api.field_behavior) = REQUIRED,
  497. (google.api.resource_reference) = {
  498. type: "documentai.googleapis.com/ProcessorVersion"
  499. }
  500. ];
  501. }
  502. // Response message for the deploy processor version method.
  503. message DeployProcessorVersionResponse {
  504. }
  505. // The long running operation metadata for deploy processor version method.
  506. message DeployProcessorVersionMetadata {
  507. // The basic metadata of the long running operation.
  508. CommonOperationMetadata common_metadata = 1;
  509. }
  510. // Request message for the undeploy processor version method.
  511. message UndeployProcessorVersionRequest {
  512. // Required. The processor version resource name to be undeployed.
  513. string name = 1 [
  514. (google.api.field_behavior) = REQUIRED,
  515. (google.api.resource_reference) = {
  516. type: "documentai.googleapis.com/ProcessorVersion"
  517. }
  518. ];
  519. }
  520. // Response message for the undeploy processor version method.
  521. message UndeployProcessorVersionResponse {
  522. }
  523. // The long running operation metadata for the undeploy processor version
  524. // method.
  525. message UndeployProcessorVersionMetadata {
  526. // The basic metadata of the long running operation.
  527. CommonOperationMetadata common_metadata = 1;
  528. }
  529. // Request message for create a processor. Notice this request is sent to
  530. // a regionalized backend service, and if the processor type is not available
  531. // on that region, the creation will fail.
  532. message CreateProcessorRequest {
  533. // Required. The parent (project and location) under which to create the processor.
  534. // Format: `projects/{project}/locations/{location}`
  535. string parent = 1 [
  536. (google.api.field_behavior) = REQUIRED,
  537. (google.api.resource_reference) = {
  538. child_type: "documentai.googleapis.com/Processor"
  539. }
  540. ];
  541. // Required. The processor to be created, requires [processor_type] and [display_name]
  542. // to be set. Also, the processor is under CMEK if CMEK fields are set.
  543. Processor processor = 2 [(google.api.field_behavior) = REQUIRED];
  544. }
  545. // Request message for the delete processor method.
  546. message DeleteProcessorRequest {
  547. // Required. The processor resource name to be deleted.
  548. string name = 1 [
  549. (google.api.field_behavior) = REQUIRED,
  550. (google.api.resource_reference) = {
  551. type: "documentai.googleapis.com/Processor"
  552. }
  553. ];
  554. }
  555. // The long running operation metadata for delete processor method.
  556. message DeleteProcessorMetadata {
  557. // The basic metadata of the long running operation.
  558. CommonOperationMetadata common_metadata = 5;
  559. }
  560. // Request message for the enable processor method.
  561. message EnableProcessorRequest {
  562. // Required. The processor resource name to be enabled.
  563. string name = 1 [
  564. (google.api.field_behavior) = REQUIRED,
  565. (google.api.resource_reference) = {
  566. type: "documentai.googleapis.com/Processor"
  567. }
  568. ];
  569. }
  570. // Response message for the enable processor method.
  571. // Intentionally empty proto for adding fields in future.
  572. message EnableProcessorResponse {
  573. }
  574. // The long running operation metadata for enable processor method.
  575. message EnableProcessorMetadata {
  576. // The basic metadata of the long running operation.
  577. CommonOperationMetadata common_metadata = 5;
  578. }
  579. // Request message for the disable processor method.
  580. message DisableProcessorRequest {
  581. // Required. The processor resource name to be disabled.
  582. string name = 1 [
  583. (google.api.field_behavior) = REQUIRED,
  584. (google.api.resource_reference) = {
  585. type: "documentai.googleapis.com/Processor"
  586. }
  587. ];
  588. }
  589. // Response message for the disable processor method.
  590. // Intentionally empty proto for adding fields in future.
  591. message DisableProcessorResponse {
  592. }
  593. // The long running operation metadata for disable processor method.
  594. message DisableProcessorMetadata {
  595. // The basic metadata of the long running operation.
  596. CommonOperationMetadata common_metadata = 5;
  597. }
  598. // Request message for the set default processor version method.
  599. message SetDefaultProcessorVersionRequest {
  600. // Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version.
  601. string processor = 1 [
  602. (google.api.field_behavior) = REQUIRED,
  603. (google.api.resource_reference) = {
  604. type: "documentai.googleapis.com/Processor"
  605. }
  606. ];
  607. // Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default.
  608. // Format:
  609. // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
  610. string default_processor_version = 2 [
  611. (google.api.field_behavior) = REQUIRED,
  612. (google.api.resource_reference) = {
  613. type: "documentai.googleapis.com/ProcessorVersion"
  614. }
  615. ];
  616. }
  617. // Response message for set default processor version method.
  618. message SetDefaultProcessorVersionResponse {
  619. }
  620. // The long running operation metadata for set default processor version
  621. // method.
  622. message SetDefaultProcessorVersionMetadata {
  623. // The basic metadata of the long running operation.
  624. CommonOperationMetadata common_metadata = 1;
  625. }
  626. // Request message for review document method.
  627. message ReviewDocumentRequest {
  628. // The priority level of the human review task.
  629. enum Priority {
  630. // The default priority level.
  631. DEFAULT = 0;
  632. // The urgent priority level. The labeling manager should allocate labeler
  633. // resource to the urgent task queue to respect this priority level.
  634. URGENT = 1;
  635. }
  636. // The document payload.
  637. oneof source {
  638. // An inline document proto.
  639. Document inline_document = 4;
  640. }
  641. // Required. The resource name of the HumanReviewConfig that the document will be
  642. // reviewed with.
  643. string human_review_config = 1 [
  644. (google.api.field_behavior) = REQUIRED,
  645. (google.api.resource_reference) = {
  646. type: "documentai.googleapis.com/HumanReviewConfig"
  647. }
  648. ];
  649. // Whether the validation should be performed on the ad-hoc review request.
  650. bool enable_schema_validation = 3;
  651. // The priority of the human review task.
  652. Priority priority = 5;
  653. // The document schema of the human review task.
  654. DocumentSchema document_schema = 6;
  655. }
  656. // Response message for review document method.
  657. message ReviewDocumentResponse {
  658. // Possible states of the review operation.
  659. enum State {
  660. // The default value. This value is used if the state is omitted.
  661. STATE_UNSPECIFIED = 0;
  662. // The review operation is rejected by the reviewer.
  663. REJECTED = 1;
  664. // The review operation is succeeded.
  665. SUCCEEDED = 2;
  666. }
  667. // The Cloud Storage uri for the human reviewed document if the review is
  668. // succeeded.
  669. string gcs_destination = 1;
  670. // The state of the review operation.
  671. State state = 2;
  672. // The reason why the review is rejected by reviewer.
  673. string rejection_reason = 3;
  674. }
  675. // The long running operation metadata for review document method.
  676. message ReviewDocumentOperationMetadata {
  677. // The basic metadata of the long running operation.
  678. CommonOperationMetadata common_metadata = 5;
  679. // The Crowd Compute question ID.
  680. string question_id = 6;
  681. }