1*d5c09012SAndroid Build Coastguard Worker// Copyright 2022 Google LLC 2*d5c09012SAndroid Build Coastguard Worker// 3*d5c09012SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License"); 4*d5c09012SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License. 5*d5c09012SAndroid Build Coastguard Worker// You may obtain a copy of the License at 6*d5c09012SAndroid Build Coastguard Worker// 7*d5c09012SAndroid Build Coastguard Worker// http://www.apache.org/licenses/LICENSE-2.0 8*d5c09012SAndroid Build Coastguard Worker// 9*d5c09012SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software 10*d5c09012SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS, 11*d5c09012SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12*d5c09012SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and 13*d5c09012SAndroid Build Coastguard Worker// limitations under the License. 14*d5c09012SAndroid Build Coastguard Worker 15*d5c09012SAndroid Build Coastguard Workersyntax = "proto3"; 16*d5c09012SAndroid Build Coastguard Worker 17*d5c09012SAndroid Build Coastguard Workerpackage google.cloud.discoveryengine.v1beta; 18*d5c09012SAndroid Build Coastguard Worker 19*d5c09012SAndroid Build Coastguard Workerimport "google/api/field_behavior.proto"; 20*d5c09012SAndroid Build Coastguard Workerimport "google/api/resource.proto"; 21*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/struct.proto"; 22*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/timestamp.proto"; 23*d5c09012SAndroid Build Coastguard Worker 24*d5c09012SAndroid Build Coastguard Workeroption csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta"; 25*d5c09012SAndroid Build Coastguard Workeroption go_package = "cloud.google.com/go/discoveryengine/apiv1beta/discoveryenginepb;discoveryenginepb"; 26*d5c09012SAndroid Build Coastguard Workeroption java_multiple_files = true; 27*d5c09012SAndroid Build Coastguard Workeroption java_outer_classname = "DocumentProto"; 28*d5c09012SAndroid Build Coastguard Workeroption java_package = "com.google.cloud.discoveryengine.v1beta"; 29*d5c09012SAndroid Build Coastguard Workeroption objc_class_prefix = "DISCOVERYENGINE"; 30*d5c09012SAndroid Build Coastguard Workeroption php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1beta"; 31*d5c09012SAndroid Build Coastguard Workeroption ruby_package = "Google::Cloud::DiscoveryEngine::V1beta"; 32*d5c09012SAndroid Build Coastguard Worker 33*d5c09012SAndroid Build Coastguard Worker// Document captures all raw metadata information of items to be recommended or 34*d5c09012SAndroid Build Coastguard Worker// searched. 35*d5c09012SAndroid Build Coastguard Workermessage Document { 36*d5c09012SAndroid Build Coastguard Worker option (google.api.resource) = { 37*d5c09012SAndroid Build Coastguard Worker type: "discoveryengine.googleapis.com/Document" 38*d5c09012SAndroid Build Coastguard Worker pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}" 39*d5c09012SAndroid Build Coastguard Worker pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}" 40*d5c09012SAndroid Build Coastguard Worker }; 41*d5c09012SAndroid Build Coastguard Worker 42*d5c09012SAndroid Build Coastguard Worker // Unstructured data linked to this document. 43*d5c09012SAndroid Build Coastguard Worker message Content { 44*d5c09012SAndroid Build Coastguard Worker oneof content { 45*d5c09012SAndroid Build Coastguard Worker // The content represented as a stream of bytes. The maximum length is 46*d5c09012SAndroid Build Coastguard Worker // 1,000,000 bytes (1 MB / ~0.95 MiB). 47*d5c09012SAndroid Build Coastguard Worker // 48*d5c09012SAndroid Build Coastguard Worker // Note: As with all `bytes` fields, this field is represented as pure 49*d5c09012SAndroid Build Coastguard Worker // binary in Protocol Buffers and base64-encoded string in JSON. For 50*d5c09012SAndroid Build Coastguard Worker // example, `abc123!?$*&()'-=@~` should be represented as 51*d5c09012SAndroid Build Coastguard Worker // `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See 52*d5c09012SAndroid Build Coastguard Worker // https://developers.google.com/protocol-buffers/docs/proto3#json. 53*d5c09012SAndroid Build Coastguard Worker bytes raw_bytes = 2; 54*d5c09012SAndroid Build Coastguard Worker 55*d5c09012SAndroid Build Coastguard Worker // The URI of the content. Only Cloud Storage URIs (e.g. 56*d5c09012SAndroid Build Coastguard Worker // `gs://bucket-name/path/to/file`) are supported. The maximum file size 57*d5c09012SAndroid Build Coastguard Worker // is 2.5 MB for text-based formats, 100 MB for other formats. 58*d5c09012SAndroid Build Coastguard Worker string uri = 3; 59*d5c09012SAndroid Build Coastguard Worker } 60*d5c09012SAndroid Build Coastguard Worker 61*d5c09012SAndroid Build Coastguard Worker // The MIME type of the content. Supported types: 62*d5c09012SAndroid Build Coastguard Worker // 63*d5c09012SAndroid Build Coastguard Worker // * `application/pdf` (PDF, only native PDFs are supported for now) 64*d5c09012SAndroid Build Coastguard Worker // * `text/html` (HTML) 65*d5c09012SAndroid Build Coastguard Worker // * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX) 66*d5c09012SAndroid Build Coastguard Worker // * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX) 67*d5c09012SAndroid Build Coastguard Worker // * `text/plain` (TXT) 68*d5c09012SAndroid Build Coastguard Worker // 69*d5c09012SAndroid Build Coastguard Worker // See https://www.iana.org/assignments/media-types/media-types.xhtml. 70*d5c09012SAndroid Build Coastguard Worker string mime_type = 1; 71*d5c09012SAndroid Build Coastguard Worker } 72*d5c09012SAndroid Build Coastguard Worker 73*d5c09012SAndroid Build Coastguard Worker // Data representation. One of 74*d5c09012SAndroid Build Coastguard Worker // [struct_data][google.cloud.discoveryengine.v1beta.Document.struct_data] or 75*d5c09012SAndroid Build Coastguard Worker // [json_data][google.cloud.discoveryengine.v1beta.Document.json_data] should 76*d5c09012SAndroid Build Coastguard Worker // be provided otherwise an `INVALID_ARGUMENT` error is thrown. 77*d5c09012SAndroid Build Coastguard Worker oneof data { 78*d5c09012SAndroid Build Coastguard Worker // The structured JSON data for the document. It should conform to the 79*d5c09012SAndroid Build Coastguard Worker // registered [Schema][google.cloud.discoveryengine.v1beta.Schema] or an 80*d5c09012SAndroid Build Coastguard Worker // `INVALID_ARGUMENT` error is thrown. 81*d5c09012SAndroid Build Coastguard Worker google.protobuf.Struct struct_data = 4; 82*d5c09012SAndroid Build Coastguard Worker 83*d5c09012SAndroid Build Coastguard Worker // The JSON string representation of the document. It should conform to the 84*d5c09012SAndroid Build Coastguard Worker // registered [Schema][google.cloud.discoveryengine.v1beta.Schema] or an 85*d5c09012SAndroid Build Coastguard Worker // `INVALID_ARGUMENT` error is thrown. 86*d5c09012SAndroid Build Coastguard Worker string json_data = 5; 87*d5c09012SAndroid Build Coastguard Worker } 88*d5c09012SAndroid Build Coastguard Worker 89*d5c09012SAndroid Build Coastguard Worker // Immutable. The full resource name of the document. 90*d5c09012SAndroid Build Coastguard Worker // Format: 91*d5c09012SAndroid Build Coastguard Worker // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. 92*d5c09012SAndroid Build Coastguard Worker // 93*d5c09012SAndroid Build Coastguard Worker // This field must be a UTF-8 encoded string with a length limit of 1024 94*d5c09012SAndroid Build Coastguard Worker // characters. 95*d5c09012SAndroid Build Coastguard Worker string name = 1 [(google.api.field_behavior) = IMMUTABLE]; 96*d5c09012SAndroid Build Coastguard Worker 97*d5c09012SAndroid Build Coastguard Worker // Immutable. The identifier of the document. 98*d5c09012SAndroid Build Coastguard Worker // 99*d5c09012SAndroid Build Coastguard Worker // Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) 100*d5c09012SAndroid Build Coastguard Worker // standard with a length limit of 63 characters. 101*d5c09012SAndroid Build Coastguard Worker string id = 2 [(google.api.field_behavior) = IMMUTABLE]; 102*d5c09012SAndroid Build Coastguard Worker 103*d5c09012SAndroid Build Coastguard Worker // The identifier of the schema located in the same data store. 104*d5c09012SAndroid Build Coastguard Worker string schema_id = 3; 105*d5c09012SAndroid Build Coastguard Worker 106*d5c09012SAndroid Build Coastguard Worker // The unstructured data linked to this document. Content must be set if this 107*d5c09012SAndroid Build Coastguard Worker // document is under a 108*d5c09012SAndroid Build Coastguard Worker // `CONTENT_REQUIRED` data store. 109*d5c09012SAndroid Build Coastguard Worker Content content = 10; 110*d5c09012SAndroid Build Coastguard Worker 111*d5c09012SAndroid Build Coastguard Worker // The identifier of the parent document. Currently supports at most two level 112*d5c09012SAndroid Build Coastguard Worker // document hierarchy. 113*d5c09012SAndroid Build Coastguard Worker // 114*d5c09012SAndroid Build Coastguard Worker // Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) 115*d5c09012SAndroid Build Coastguard Worker // standard with a length limit of 63 characters. 116*d5c09012SAndroid Build Coastguard Worker string parent_document_id = 7; 117*d5c09012SAndroid Build Coastguard Worker 118*d5c09012SAndroid Build Coastguard Worker // Output only. This field is OUTPUT_ONLY. 119*d5c09012SAndroid Build Coastguard Worker // It contains derived data that are not in the original input document. 120*d5c09012SAndroid Build Coastguard Worker google.protobuf.Struct derived_struct_data = 6 121*d5c09012SAndroid Build Coastguard Worker [(google.api.field_behavior) = OUTPUT_ONLY]; 122*d5c09012SAndroid Build Coastguard Worker 123*d5c09012SAndroid Build Coastguard Worker // Output only. The last time the document was indexed. If this field is set, 124*d5c09012SAndroid Build Coastguard Worker // the document could be returned in search results. 125*d5c09012SAndroid Build Coastguard Worker // 126*d5c09012SAndroid Build Coastguard Worker // This field is OUTPUT_ONLY. If this field is not populated, it means the 127*d5c09012SAndroid Build Coastguard Worker // document has never been indexed. 128*d5c09012SAndroid Build Coastguard Worker google.protobuf.Timestamp index_time = 13 129*d5c09012SAndroid Build Coastguard Worker [(google.api.field_behavior) = OUTPUT_ONLY]; 130*d5c09012SAndroid Build Coastguard Worker} 131