1// Copyright 2023 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 15syntax = "proto3"; 16 17package google.cloud.documentai.v1beta3; 18 19import "google/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21import "google/cloud/documentai/v1beta3/document_schema.proto"; 22import "google/cloud/documentai/v1beta3/evaluation.proto"; 23import "google/protobuf/timestamp.proto"; 24 25option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; 26option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; 27option java_multiple_files = true; 28option java_outer_classname = "DocumentAiProcessor"; 29option java_package = "com.google.cloud.documentai.v1beta3"; 30option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; 31option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; 32 33// A processor version is an implementation of a processor. Each processor 34// can have multiple versions, pretrained by Google internally or uptrained 35// by the customer. A processor can only have one default version at a time. 36// Its document-processing behavior is defined by that version. 37message ProcessorVersion { 38 option (google.api.resource) = { 39 type: "documentai.googleapis.com/ProcessorVersion" 40 pattern: "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}" 41 }; 42 43 // Information about the upcoming deprecation of this processor version. 44 message DeprecationInfo { 45 // The time at which this processor version will be deprecated. 46 google.protobuf.Timestamp deprecation_time = 1; 47 48 // If set, the processor version that will be used as a replacement. 49 string replacement_processor_version = 2 50 [(google.api.resource_reference) = { 51 type: "documentai.googleapis.com/ProcessorVersion" 52 }]; 53 } 54 55 // The possible states of the processor version. 56 enum State { 57 // The processor version is in an unspecified state. 58 STATE_UNSPECIFIED = 0; 59 60 // The processor version is deployed and can be used for processing. 61 DEPLOYED = 1; 62 63 // The processor version is being deployed. 64 DEPLOYING = 2; 65 66 // The processor version is not deployed and cannot be used for processing. 67 UNDEPLOYED = 3; 68 69 // The processor version is being undeployed. 70 UNDEPLOYING = 4; 71 72 // The processor version is being created. 73 CREATING = 5; 74 75 // The processor version is being deleted. 76 DELETING = 6; 77 78 // The processor version failed and is in an indeterminate state. 79 FAILED = 7; 80 81 // The processor version is being imported. 82 IMPORTING = 8; 83 } 84 85 // The possible model types of the processor version. 86 enum ModelType { 87 // The processor version has unspecified model type. 88 MODEL_TYPE_UNSPECIFIED = 0; 89 90 // The processor version has generative model type. 91 MODEL_TYPE_GENERATIVE = 1; 92 93 // The processor version has custom model type. 94 MODEL_TYPE_CUSTOM = 2; 95 } 96 97 // Identifier. The resource name of the processor version. 98 // Format: 99 // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` 100 string name = 1 [(google.api.field_behavior) = IDENTIFIER]; 101 102 // The display name of the processor version. 103 string display_name = 2; 104 105 // The schema of the processor version. Describes the output. 106 DocumentSchema document_schema = 12; 107 108 // Output only. The state of the processor version. 109 State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 110 111 // The time the processor version was created. 112 google.protobuf.Timestamp create_time = 7; 113 114 // The most recently invoked evaluation for the processor version. 115 EvaluationReference latest_evaluation = 8; 116 117 // The KMS key name used for encryption. 118 string kms_key_name = 9; 119 120 // The KMS key version with which data is encrypted. 121 string kms_key_version_name = 10; 122 123 // Output only. Denotes that this `ProcessorVersion` is managed by Google. 124 bool google_managed = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; 125 126 // If set, information about the eventual deprecation of this version. 127 DeprecationInfo deprecation_info = 13; 128 129 // Output only. The model type of this processor version. 130 ModelType model_type = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; 131} 132 133// Contains the alias and the aliased resource name of processor version. 134message ProcessorVersionAlias { 135 // The alias in the form of `processor_version` resource name. 136 string alias = 1; 137 138 // The resource name of aliased processor version. 139 string processor_version = 2 [(google.api.resource_reference) = { 140 type: "documentai.googleapis.com/ProcessorVersion" 141 }]; 142} 143 144// The first-class citizen for Document AI. Each processor defines how to 145// extract structural information from a document. 146message Processor { 147 option (google.api.resource) = { 148 type: "documentai.googleapis.com/Processor" 149 pattern: "projects/{project}/locations/{location}/processors/{processor}" 150 }; 151 152 // The possible states of the processor. 153 enum State { 154 // The processor is in an unspecified state. 155 STATE_UNSPECIFIED = 0; 156 157 // The processor is enabled, i.e., has an enabled version which can 158 // currently serve processing requests and all the feature dependencies have 159 // been successfully initialized. 160 ENABLED = 1; 161 162 // The processor is disabled. 163 DISABLED = 2; 164 165 // The processor is being enabled, will become `ENABLED` if successful. 166 ENABLING = 3; 167 168 // The processor is being disabled, will become `DISABLED` if successful. 169 DISABLING = 4; 170 171 // The processor is being created, will become either `ENABLED` (for 172 // successful creation) or `FAILED` (for failed ones). 173 // Once a processor is in this state, it can then be used for document 174 // processing, but the feature dependencies of the processor might not be 175 // fully created yet. 176 CREATING = 5; 177 178 // The processor failed during creation or initialization of feature 179 // dependencies. The user should delete the processor and recreate one as 180 // all the functionalities of the processor are disabled. 181 FAILED = 6; 182 183 // The processor is being deleted, will be removed if successful. 184 DELETING = 7; 185 } 186 187 // Output only. Immutable. The resource name of the processor. 188 // Format: `projects/{project}/locations/{location}/processors/{processor}` 189 string name = 1 [ 190 (google.api.field_behavior) = IMMUTABLE, 191 (google.api.field_behavior) = OUTPUT_ONLY 192 ]; 193 194 // The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. 195 // To get a list of processor types, see 196 // [FetchProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes]. 197 string type = 2; 198 199 // The display name of the processor. 200 string display_name = 3; 201 202 // Output only. The state of the processor. 203 State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; 204 205 // The default processor version. 206 string default_processor_version = 9 [(google.api.resource_reference) = { 207 type: "documentai.googleapis.com/ProcessorVersion" 208 }]; 209 210 // Output only. The processor version aliases. 211 repeated ProcessorVersionAlias processor_version_aliases = 10 212 [(google.api.field_behavior) = OUTPUT_ONLY]; 213 214 // Output only. Immutable. The http endpoint that can be called to invoke 215 // processing. 216 string process_endpoint = 6 [ 217 (google.api.field_behavior) = OUTPUT_ONLY, 218 (google.api.field_behavior) = IMMUTABLE 219 ]; 220 221 // The time the processor was created. 222 google.protobuf.Timestamp create_time = 7; 223 224 // The [KMS key](https://cloud.google.com/security-key-management) used for 225 // encryption and decryption in CMEK scenarios. 226 string kms_key_name = 8; 227} 228