-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
document_service.proto
388 lines (354 loc) · 16 KB
/
document_service.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.discoveryengine.v1alpha;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/discoveryengine/v1alpha/document.proto";
import "google/cloud/discoveryengine/v1alpha/import_config.proto";
import "google/cloud/discoveryengine/v1alpha/purge_config.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha";
option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb";
option java_multiple_files = true;
option java_outer_classname = "DocumentServiceProto";
option java_package = "com.google.cloud.discoveryengine.v1alpha";
option objc_class_prefix = "DISCOVERYENGINE";
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha";
option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha";
// Service for ingesting
// [Document][google.cloud.discoveryengine.v1alpha.Document] information of the
// customer's website.
service DocumentService {
option (google.api.default_host) = "discoveryengine.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";
// Gets a [Document][google.cloud.discoveryengine.v1alpha.Document].
rpc GetDocument(GetDocumentRequest) returns (Document) {
option (google.api.http) = {
get: "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}"
additional_bindings {
get: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}"
}
};
option (google.api.method_signature) = "name";
}
// Gets a list of [Document][google.cloud.discoveryengine.v1alpha.Document]s.
rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) {
option (google.api.http) = {
get: "/v1alpha/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents"
additional_bindings {
get: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents"
}
};
option (google.api.method_signature) = "parent";
}
// Creates a [Document][google.cloud.discoveryengine.v1alpha.Document].
rpc CreateDocument(CreateDocumentRequest) returns (Document) {
option (google.api.http) = {
post: "/v1alpha/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents"
body: "document"
additional_bindings {
post: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents"
body: "document"
}
};
option (google.api.method_signature) = "parent,document,document_id";
}
// Updates a [Document][google.cloud.discoveryengine.v1alpha.Document].
rpc UpdateDocument(UpdateDocumentRequest) returns (Document) {
option (google.api.http) = {
patch: "/v1alpha/{document.name=projects/*/locations/*/dataStores/*/branches/*/documents/*}"
body: "document"
additional_bindings {
patch: "/v1alpha/{document.name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}"
body: "document"
}
};
option (google.api.method_signature) = "document,update_mask";
}
// Deletes a [Document][google.cloud.discoveryengine.v1alpha.Document].
rpc DeleteDocument(DeleteDocumentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}"
additional_bindings {
delete: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}"
}
};
option (google.api.method_signature) = "name";
}
// Bulk import of multiple
// [Document][google.cloud.discoveryengine.v1alpha.Document]s. Request
// processing may be synchronous. Non-existing items will be created.
//
// Note: It is possible for a subset of the
// [Document][google.cloud.discoveryengine.v1alpha.Document]s to be
// successfully updated.
rpc ImportDocuments(ImportDocumentsRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1alpha/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:import"
body: "*"
additional_bindings {
post: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:import"
body: "*"
}
};
option (google.longrunning.operation_info) = {
response_type: "google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse"
metadata_type: "google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata"
};
}
// Permanently deletes all selected
// [Document][google.cloud.discoveryengine.v1alpha.Document]s in a branch.
//
// This process is asynchronous. Depending on the number of
// [Document][google.cloud.discoveryengine.v1alpha.Document]s to be deleted,
// this operation can take hours to complete. Before the delete operation
// completes, some [Document][google.cloud.discoveryengine.v1alpha.Document]s
// might still be returned by
// [DocumentService.GetDocument][google.cloud.discoveryengine.v1alpha.DocumentService.GetDocument]
// or
// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments].
//
// To get a list of the
// [Document][google.cloud.discoveryengine.v1alpha.Document]s to be deleted,
// set
// [PurgeDocumentsRequest.force][google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest.force]
// to false.
rpc PurgeDocuments(PurgeDocumentsRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1alpha/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:purge"
body: "*"
additional_bindings {
post: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:purge"
body: "*"
}
};
option (google.longrunning.operation_info) = {
response_type: "google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse"
metadata_type: "google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata"
};
}
// Gets the parsed layout information for a
// [Document][google.cloud.discoveryengine.v1alpha.Document].
rpc GetProcessedDocument(GetProcessedDocumentRequest)
returns (ProcessedDocument) {
option (google.api.http) = {
get: "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}:getProcessedDocument"
additional_bindings {
get: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}:getProcessedDocument"
}
};
option (google.api.method_signature) = "name";
}
}
// Request message for
// [DocumentService.GetDocument][google.cloud.discoveryengine.v1alpha.DocumentService.GetDocument]
// method.
message GetDocumentRequest {
// Required. Full resource name of
// [Document][google.cloud.discoveryengine.v1alpha.Document], such as
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
//
// If the caller does not have permission to access the
// [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
// whether or not it exists, a `PERMISSION_DENIED` error is returned.
//
// If the requested [Document][google.cloud.discoveryengine.v1alpha.Document]
// does not exist, a `NOT_FOUND` error is returned.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/Document"
}
];
}
// Request message for
// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
// method.
message ListDocumentsRequest {
// Required. The parent branch resource name, such as
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
// Use `default_branch` as the branch ID, to list documents under the default
// branch.
//
// If the caller does not have permission to list
// [Document][google.cloud.discoveryengine.v1alpha.Document]s under this
// branch, regardless of whether or not this branch exists, a
// `PERMISSION_DENIED` error is returned.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/Branch"
}
];
// Maximum number of
// [Document][google.cloud.discoveryengine.v1alpha.Document]s to return. If
// unspecified, defaults to 100. The maximum allowed value is 1000. Values
// above 1000 will be coerced to 1000.
//
// If this field is negative, an `INVALID_ARGUMENT` error is returned.
int32 page_size = 2;
// A page token
// [ListDocumentsResponse.next_page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.next_page_token],
// received from a previous
// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
// call. Provide this to retrieve the subsequent page.
//
// When paginating, all other parameters provided to
// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
// must match the call that provided the page token. Otherwise, an
// `INVALID_ARGUMENT` error is returned.
string page_token = 3;
}
// Response message for
// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
// method.
message ListDocumentsResponse {
// The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
repeated Document documents = 1;
// A token that can be sent as
// [ListDocumentsRequest.page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.page_token]
// to retrieve the next page. If this field is omitted, there are no
// subsequent pages.
string next_page_token = 2;
}
// Request message for
// [DocumentService.CreateDocument][google.cloud.discoveryengine.v1alpha.DocumentService.CreateDocument]
// method.
message CreateDocumentRequest {
// Required. The parent resource name, such as
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/Branch"
}
];
// Required. The [Document][google.cloud.discoveryengine.v1alpha.Document] to
// create.
Document document = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The ID to use for the
// [Document][google.cloud.discoveryengine.v1alpha.Document], which will
// become the final component of the
// [Document.name][google.cloud.discoveryengine.v1alpha.Document.name].
//
// If the caller does not have permission to create the
// [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
// whether or not it exists, a `PERMISSION_DENIED` error is returned.
//
// This field must be unique among all
// [Document][google.cloud.discoveryengine.v1alpha.Document]s with the same
// [parent][google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.parent].
// Otherwise, an `ALREADY_EXISTS` error is returned.
//
// This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
// standard with a length limit of 63 characters. Otherwise, an
// `INVALID_ARGUMENT` error is returned.
string document_id = 3 [(google.api.field_behavior) = REQUIRED];
}
// Request message for
// [DocumentService.UpdateDocument][google.cloud.discoveryengine.v1alpha.DocumentService.UpdateDocument]
// method.
message UpdateDocumentRequest {
// Required. The document to update/create.
//
// If the caller does not have permission to update the
// [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
// whether or not it exists, a `PERMISSION_DENIED` error is returned.
//
// If the [Document][google.cloud.discoveryengine.v1alpha.Document] to update
// does not exist and
// [allow_missing][google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.allow_missing]
// is not set, a `NOT_FOUND` error is returned.
Document document = 1 [(google.api.field_behavior) = REQUIRED];
// If set to true, and the
// [Document][google.cloud.discoveryengine.v1alpha.Document] is not found, a
// new [Document][google.cloud.discoveryengine.v1alpha.Document] will be
// created.
bool allow_missing = 2;
// Indicates which fields in the provided imported 'document' to update. If
// not set, will by default update all fields.
google.protobuf.FieldMask update_mask = 3;
}
// Request message for
// [DocumentService.DeleteDocument][google.cloud.discoveryengine.v1alpha.DocumentService.DeleteDocument]
// method.
message DeleteDocumentRequest {
// Required. Full resource name of
// [Document][google.cloud.discoveryengine.v1alpha.Document], such as
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
//
// If the caller does not have permission to delete the
// [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
// whether or not it exists, a `PERMISSION_DENIED` error is returned.
//
// If the [Document][google.cloud.discoveryengine.v1alpha.Document] to delete
// does not exist, a `NOT_FOUND` error is returned.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/Document"
}
];
}
// Request message for
// [DocumentService.GetDocument][google.cloud.discoveryengine.v1alpha.DocumentService.GetDocument]
// method.
message GetProcessedDocumentRequest {
// The type of processing to return in the response.
enum ProcessedDocumentType {
// Default value.
PROCESSED_DOCUMENT_TYPE_UNSPECIFIED = 0;
// Available for all data store parsing configs.
PARSED_DOCUMENT = 1;
// Only available if ChunkingConfig is enabeld on the data store.
CHUNKED_DOCUMENT = 2;
}
// The format of the returned processed document. If unspecified, defaults to
// JSON.
enum ProcessedDocumentFormat {
// Default value.
PROCESSED_DOCUMENT_FORMAT_UNSPECIFIED = 0;
// output format will be a JSON string representation of processed document.
JSON = 1;
}
// Required. Full resource name of
// [Document][google.cloud.discoveryengine.v1alpha.Document], such as
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
//
// If the caller does not have permission to access the
// [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
// whether or not it exists, a `PERMISSION_DENIED` error is returned.
//
// If the requested [Document][google.cloud.discoveryengine.v1alpha.Document]
// does not exist, a `NOT_FOUND` error is returned.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/Document"
}
];
// Required. What type of processing to return.
ProcessedDocumentType processed_document_type = 2
[(google.api.field_behavior) = REQUIRED];
// What format output should be. If unspecified, defaults to JSON.
ProcessedDocumentFormat processed_document_format = 3;
}