processor.proto 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/documentai/v1/document_schema.proto";
  19. import "google/protobuf/timestamp.proto";
  20. option csharp_namespace = "Google.Cloud.DocumentAI.V1";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1;documentai";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "DocumentAiProcessor";
  24. option java_package = "com.google.cloud.documentai.v1";
  25. option php_namespace = "Google\\Cloud\\DocumentAI\\V1";
  26. option ruby_package = "Google::Cloud::DocumentAI::V1";
  27. // A processor version is an implementation of a processor. Each processor
  28. // can have multiple versions, pre-trained by Google internally or up-trained
  29. // by the customer. At a time, a processor can only have one default version
  30. // version. So the processor's behavior (when processing documents) is defined
  31. // by a default version
  32. message ProcessorVersion {
  33. option (google.api.resource) = {
  34. type: "documentai.googleapis.com/ProcessorVersion"
  35. pattern: "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}"
  36. };
  37. // Information about the upcoming deprecation of this processor version.
  38. message DeprecationInfo {
  39. // The time at which this processor version will be deprecated.
  40. google.protobuf.Timestamp deprecation_time = 1;
  41. // If set, the processor version that will be used as a replacement.
  42. string replacement_processor_version = 2 [(google.api.resource_reference) = {
  43. type: "documentai.googleapis.com/ProcessorVersion"
  44. }];
  45. }
  46. // The possible states of the processor version.
  47. enum State {
  48. // The processor version is in an unspecified state.
  49. STATE_UNSPECIFIED = 0;
  50. // The processor version is deployed and can be used for processing.
  51. DEPLOYED = 1;
  52. // The processor version is being deployed.
  53. DEPLOYING = 2;
  54. // The processor version is not deployed and cannot be used for processing.
  55. UNDEPLOYED = 3;
  56. // The processor version is being undeployed.
  57. UNDEPLOYING = 4;
  58. // The processor version is being created.
  59. CREATING = 5;
  60. // The processor version is being deleted.
  61. DELETING = 6;
  62. // The processor version failed and is in an indeterminate state.
  63. FAILED = 7;
  64. }
  65. // The resource name of the processor version.
  66. // Format:
  67. // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
  68. string name = 1;
  69. // The display name of the processor version.
  70. string display_name = 2;
  71. // The schema of the processor version. Describes the output.
  72. DocumentSchema document_schema = 12;
  73. // The state of the processor version.
  74. State state = 6;
  75. // The time the processor version was created.
  76. google.protobuf.Timestamp create_time = 7;
  77. // The KMS key name used for encryption.
  78. string kms_key_name = 9;
  79. // The KMS key version with which data is encrypted.
  80. string kms_key_version_name = 10;
  81. // Denotes that this ProcessorVersion is managed by google.
  82. bool google_managed = 11;
  83. // If set, information about the eventual deprecation of this version.
  84. DeprecationInfo deprecation_info = 13;
  85. }
  86. // The first-class citizen for Document AI. Each processor defines how to
  87. // extract structural information from a document.
  88. message Processor {
  89. option (google.api.resource) = {
  90. type: "documentai.googleapis.com/Processor"
  91. pattern: "projects/{project}/locations/{location}/processors/{processor}"
  92. };
  93. // The possible states of the processor.
  94. enum State {
  95. // The processor is in an unspecified state.
  96. STATE_UNSPECIFIED = 0;
  97. // The processor is enabled, i.e., has an enabled version which can
  98. // currently serve processing requests and all the feature dependencies have
  99. // been successfully initialized.
  100. ENABLED = 1;
  101. // The processor is disabled.
  102. DISABLED = 2;
  103. // The processor is being enabled, will become `ENABLED` if successful.
  104. ENABLING = 3;
  105. // The processor is being disabled, will become `DISABLED` if successful.
  106. DISABLING = 4;
  107. // The processor is being created, will become either `ENABLED` (for
  108. // successful creation) or `FAILED` (for failed ones).
  109. // Once a processor is in this state, it can then be used for document
  110. // processing, but the feature dependencies of the processor might not be
  111. // fully created yet.
  112. CREATING = 5;
  113. // The processor failed during creation or initialization of feature
  114. // dependencies. The user should delete the processor and recreate one as
  115. // all the functionalities of the processor are disabled.
  116. FAILED = 6;
  117. // The processor is being deleted, will be removed if successful.
  118. DELETING = 7;
  119. }
  120. // Output only. Immutable. The resource name of the processor.
  121. // Format: `projects/{project}/locations/{location}/processors/{processor}`
  122. string name = 1 [
  123. (google.api.field_behavior) = IMMUTABLE,
  124. (google.api.field_behavior) = OUTPUT_ONLY
  125. ];
  126. // The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, etc.
  127. // To get a list of processors types, see
  128. // [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes].
  129. string type = 2;
  130. // The display name of the processor.
  131. string display_name = 3;
  132. // Output only. The state of the processor.
  133. State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  134. // The default processor version.
  135. string default_processor_version = 9 [(google.api.resource_reference) = {
  136. type: "documentai.googleapis.com/ProcessorVersion"
  137. }];
  138. // Output only. Immutable. The http endpoint that can be called to invoke processing.
  139. string process_endpoint = 6 [
  140. (google.api.field_behavior) = OUTPUT_ONLY,
  141. (google.api.field_behavior) = IMMUTABLE
  142. ];
  143. // The time the processor was created.
  144. google.protobuf.Timestamp create_time = 7;
  145. // The KMS key used for encryption/decryption in CMEK scenarios.
  146. // See https://cloud.google.com/security-key-management.
  147. string kms_key_name = 8;
  148. }