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 15syntax = "proto3"; 16 17package google.cloud.discoveryengine.v1beta; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/cloud/discoveryengine/v1beta/document.proto"; 24import "google/cloud/discoveryengine/v1beta/import_config.proto"; 25import "google/cloud/discoveryengine/v1beta/purge_config.proto"; 26import "google/longrunning/operations.proto"; 27import "google/protobuf/empty.proto"; 28import "google/protobuf/field_mask.proto"; 29 30option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta"; 31option go_package = "cloud.google.com/go/discoveryengine/apiv1beta/discoveryenginepb;discoveryenginepb"; 32option java_multiple_files = true; 33option java_outer_classname = "DocumentServiceProto"; 34option java_package = "com.google.cloud.discoveryengine.v1beta"; 35option objc_class_prefix = "DISCOVERYENGINE"; 36option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1beta"; 37option ruby_package = "Google::Cloud::DiscoveryEngine::V1beta"; 38 39// Service for ingesting 40// [Document][google.cloud.discoveryengine.v1beta.Document] information of the 41// customer's website. 42service DocumentService { 43 option (google.api.default_host) = "discoveryengine.googleapis.com"; 44 option (google.api.oauth_scopes) = 45 "https://www.googleapis.com/auth/cloud-platform"; 46 47 // Gets a [Document][google.cloud.discoveryengine.v1beta.Document]. 48 rpc GetDocument(GetDocumentRequest) returns (Document) { 49 option (google.api.http) = { 50 get: "/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}" 51 additional_bindings { 52 get: "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}" 53 } 54 }; 55 option (google.api.method_signature) = "name"; 56 } 57 58 // Gets a list of [Document][google.cloud.discoveryengine.v1beta.Document]s. 59 rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) { 60 option (google.api.http) = { 61 get: "/v1beta/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents" 62 additional_bindings { 63 get: "/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents" 64 } 65 }; 66 option (google.api.method_signature) = "parent"; 67 } 68 69 // Creates a [Document][google.cloud.discoveryengine.v1beta.Document]. 70 rpc CreateDocument(CreateDocumentRequest) returns (Document) { 71 option (google.api.http) = { 72 post: "/v1beta/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents" 73 body: "document" 74 additional_bindings { 75 post: "/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents" 76 body: "document" 77 } 78 }; 79 option (google.api.method_signature) = "parent,document,document_id"; 80 } 81 82 // Updates a [Document][google.cloud.discoveryengine.v1beta.Document]. 83 rpc UpdateDocument(UpdateDocumentRequest) returns (Document) { 84 option (google.api.http) = { 85 patch: "/v1beta/{document.name=projects/*/locations/*/dataStores/*/branches/*/documents/*}" 86 body: "document" 87 additional_bindings { 88 patch: "/v1beta/{document.name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}" 89 body: "document" 90 } 91 }; 92 option (google.api.method_signature) = "document,update_mask"; 93 } 94 95 // Deletes a [Document][google.cloud.discoveryengine.v1beta.Document]. 96 rpc DeleteDocument(DeleteDocumentRequest) returns (google.protobuf.Empty) { 97 option (google.api.http) = { 98 delete: "/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}" 99 additional_bindings { 100 delete: "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}" 101 } 102 }; 103 option (google.api.method_signature) = "name"; 104 } 105 106 // Bulk import of multiple 107 // [Document][google.cloud.discoveryengine.v1beta.Document]s. Request 108 // processing may be synchronous. Non-existing items will be created. 109 // 110 // Note: It is possible for a subset of the 111 // [Document][google.cloud.discoveryengine.v1beta.Document]s to be 112 // successfully updated. 113 rpc ImportDocuments(ImportDocumentsRequest) 114 returns (google.longrunning.Operation) { 115 option (google.api.http) = { 116 post: "/v1beta/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:import" 117 body: "*" 118 additional_bindings { 119 post: "/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:import" 120 body: "*" 121 } 122 }; 123 option (google.longrunning.operation_info) = { 124 response_type: "google.cloud.discoveryengine.v1beta.ImportDocumentsResponse" 125 metadata_type: "google.cloud.discoveryengine.v1beta.ImportDocumentsMetadata" 126 }; 127 } 128 129 // Permanently deletes all selected 130 // [Document][google.cloud.discoveryengine.v1beta.Document]s in a branch. 131 // 132 // This process is asynchronous. Depending on the number of 133 // [Document][google.cloud.discoveryengine.v1beta.Document]s to be deleted, 134 // this operation can take hours to complete. Before the delete operation 135 // completes, some [Document][google.cloud.discoveryengine.v1beta.Document]s 136 // might still be returned by 137 // [DocumentService.GetDocument][google.cloud.discoveryengine.v1beta.DocumentService.GetDocument] 138 // or 139 // [DocumentService.ListDocuments][google.cloud.discoveryengine.v1beta.DocumentService.ListDocuments]. 140 // 141 // To get a list of the 142 // [Document][google.cloud.discoveryengine.v1beta.Document]s to be deleted, 143 // set 144 // [PurgeDocumentsRequest.force][google.cloud.discoveryengine.v1beta.PurgeDocumentsRequest.force] 145 // to false. 146 rpc PurgeDocuments(PurgeDocumentsRequest) 147 returns (google.longrunning.Operation) { 148 option (google.api.http) = { 149 post: "/v1beta/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:purge" 150 body: "*" 151 additional_bindings { 152 post: "/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:purge" 153 body: "*" 154 } 155 }; 156 option (google.longrunning.operation_info) = { 157 response_type: "google.cloud.discoveryengine.v1beta.PurgeDocumentsResponse" 158 metadata_type: "google.cloud.discoveryengine.v1beta.PurgeDocumentsMetadata" 159 }; 160 } 161} 162 163// Request message for 164// [DocumentService.GetDocument][google.cloud.discoveryengine.v1beta.DocumentService.GetDocument] 165// method. 166message GetDocumentRequest { 167 // Required. Full resource name of 168 // [Document][google.cloud.discoveryengine.v1beta.Document], such as 169 // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. 170 // 171 // If the caller does not have permission to access the 172 // [Document][google.cloud.discoveryengine.v1beta.Document], regardless of 173 // whether or not it exists, a `PERMISSION_DENIED` error is returned. 174 // 175 // If the requested [Document][google.cloud.discoveryengine.v1beta.Document] 176 // does not exist, a `NOT_FOUND` error is returned. 177 string name = 1 [ 178 (google.api.field_behavior) = REQUIRED, 179 (google.api.resource_reference) = { 180 type: "discoveryengine.googleapis.com/Document" 181 } 182 ]; 183} 184 185// Request message for 186// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1beta.DocumentService.ListDocuments] 187// method. 188message ListDocumentsRequest { 189 // Required. The parent branch resource name, such as 190 // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. 191 // Use `default_branch` as the branch ID, to list documents under the default 192 // branch. 193 // 194 // If the caller does not have permission to list 195 // [Document][google.cloud.discoveryengine.v1beta.Document]s under this 196 // branch, regardless of whether or not this branch exists, a 197 // `PERMISSION_DENIED` error is returned. 198 string parent = 1 [ 199 (google.api.field_behavior) = REQUIRED, 200 (google.api.resource_reference) = { 201 type: "discoveryengine.googleapis.com/Branch" 202 } 203 ]; 204 205 // Maximum number of [Document][google.cloud.discoveryengine.v1beta.Document]s 206 // to return. If unspecified, defaults to 100. The maximum allowed value is 207 // 1000. Values above 1000 will be coerced to 1000. 208 // 209 // If this field is negative, an `INVALID_ARGUMENT` error is returned. 210 int32 page_size = 2; 211 212 // A page token 213 // [ListDocumentsResponse.next_page_token][google.cloud.discoveryengine.v1beta.ListDocumentsResponse.next_page_token], 214 // received from a previous 215 // [DocumentService.ListDocuments][google.cloud.discoveryengine.v1beta.DocumentService.ListDocuments] 216 // call. Provide this to retrieve the subsequent page. 217 // 218 // When paginating, all other parameters provided to 219 // [DocumentService.ListDocuments][google.cloud.discoveryengine.v1beta.DocumentService.ListDocuments] 220 // must match the call that provided the page token. Otherwise, an 221 // `INVALID_ARGUMENT` error is returned. 222 string page_token = 3; 223} 224 225// Response message for 226// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1beta.DocumentService.ListDocuments] 227// method. 228message ListDocumentsResponse { 229 // The [Document][google.cloud.discoveryengine.v1beta.Document]s. 230 repeated Document documents = 1; 231 232 // A token that can be sent as 233 // [ListDocumentsRequest.page_token][google.cloud.discoveryengine.v1beta.ListDocumentsRequest.page_token] 234 // to retrieve the next page. If this field is omitted, there are no 235 // subsequent pages. 236 string next_page_token = 2; 237} 238 239// Request message for 240// [DocumentService.CreateDocument][google.cloud.discoveryengine.v1beta.DocumentService.CreateDocument] 241// method. 242message CreateDocumentRequest { 243 // Required. The parent resource name, such as 244 // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. 245 string parent = 1 [ 246 (google.api.field_behavior) = REQUIRED, 247 (google.api.resource_reference) = { 248 type: "discoveryengine.googleapis.com/Branch" 249 } 250 ]; 251 252 // Required. The [Document][google.cloud.discoveryengine.v1beta.Document] to 253 // create. 254 Document document = 2 [(google.api.field_behavior) = REQUIRED]; 255 256 // Required. The ID to use for the 257 // [Document][google.cloud.discoveryengine.v1beta.Document], which will become 258 // the final component of the 259 // [Document.name][google.cloud.discoveryengine.v1beta.Document.name]. 260 // 261 // If the caller does not have permission to create the 262 // [Document][google.cloud.discoveryengine.v1beta.Document], regardless of 263 // whether or not it exists, a `PERMISSION_DENIED` error is returned. 264 // 265 // This field must be unique among all 266 // [Document][google.cloud.discoveryengine.v1beta.Document]s with the same 267 // [parent][google.cloud.discoveryengine.v1beta.CreateDocumentRequest.parent]. 268 // Otherwise, an `ALREADY_EXISTS` error is returned. 269 // 270 // This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) 271 // standard with a length limit of 63 characters. Otherwise, an 272 // `INVALID_ARGUMENT` error is returned. 273 string document_id = 3 [(google.api.field_behavior) = REQUIRED]; 274} 275 276// Request message for 277// [DocumentService.UpdateDocument][google.cloud.discoveryengine.v1beta.DocumentService.UpdateDocument] 278// method. 279message UpdateDocumentRequest { 280 // Required. The document to update/create. 281 // 282 // If the caller does not have permission to update the 283 // [Document][google.cloud.discoveryengine.v1beta.Document], regardless of 284 // whether or not it exists, a `PERMISSION_DENIED` error is returned. 285 // 286 // If the [Document][google.cloud.discoveryengine.v1beta.Document] to update 287 // does not exist and 288 // [allow_missing][google.cloud.discoveryengine.v1beta.UpdateDocumentRequest.allow_missing] 289 // is not set, a `NOT_FOUND` error is returned. 290 Document document = 1 [(google.api.field_behavior) = REQUIRED]; 291 292 // If set to true, and the 293 // [Document][google.cloud.discoveryengine.v1beta.Document] is not found, a 294 // new [Document][google.cloud.discoveryengine.v1beta.Document] will be 295 // created. 296 bool allow_missing = 2; 297 298 // Indicates which fields in the provided imported 'document' to update. If 299 // not set, will by default update all fields. 300 google.protobuf.FieldMask update_mask = 3; 301} 302 303// Request message for 304// [DocumentService.DeleteDocument][google.cloud.discoveryengine.v1beta.DocumentService.DeleteDocument] 305// method. 306message DeleteDocumentRequest { 307 // Required. Full resource name of 308 // [Document][google.cloud.discoveryengine.v1beta.Document], such as 309 // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. 310 // 311 // If the caller does not have permission to delete the 312 // [Document][google.cloud.discoveryengine.v1beta.Document], regardless of 313 // whether or not it exists, a `PERMISSION_DENIED` error is returned. 314 // 315 // If the [Document][google.cloud.discoveryengine.v1beta.Document] to delete 316 // does not exist, a `NOT_FOUND` error is returned. 317 string name = 1 [ 318 (google.api.field_behavior) = REQUIRED, 319 (google.api.resource_reference) = { 320 type: "discoveryengine.googleapis.com/Document" 321 } 322 ]; 323} 324