@google-cloud/discoveryengine 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/README.md +38 -21
- package/build/protos/google/cloud/discoveryengine/v1/common.proto +100 -0
- package/build/protos/google/cloud/discoveryengine/v1/completion_service.proto +116 -0
- package/build/protos/google/cloud/discoveryengine/v1/document.proto +118 -0
- package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +313 -0
- package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +334 -0
- package/build/protos/google/cloud/discoveryengine/v1/purge_config.proto +86 -0
- package/build/protos/google/cloud/discoveryengine/v1/schema.proto +58 -0
- package/build/protos/google/cloud/discoveryengine/v1/schema_service.proto +256 -0
- package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +289 -0
- package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +458 -0
- package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +133 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +3 -1
- package/build/protos/google/cloud/discoveryengine/v1beta/document_service.proto +34 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +54 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/purge_config.proto +86 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +29 -4
- package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +17 -13
- package/build/protos/protos.d.ts +6937 -0
- package/build/protos/protos.js +55830 -1
- package/build/protos/protos.json +5770 -1
- package/build/src/index.d.ts +18 -19
- package/build/src/index.js +9 -9
- package/build/src/v1/completion_service_client.d.ts +455 -0
- package/build/src/v1/completion_service_client.js +659 -0
- package/build/src/v1/completion_service_client_config.json +43 -0
- package/build/src/v1/document_service_client.d.ts +995 -0
- package/build/src/v1/document_service_client.js +1191 -0
- package/build/src/v1/document_service_client_config.json +82 -0
- package/build/src/v1/index.d.ts +5 -0
- package/build/src/v1/index.js +31 -0
- package/build/src/v1/schema_service_client.d.ts +795 -0
- package/build/src/v1/schema_service_client.js +1129 -0
- package/build/src/v1/schema_service_client_config.json +63 -0
- package/build/src/v1/search_service_client.d.ts +857 -0
- package/build/src/v1/search_service_client.js +1073 -0
- package/build/src/v1/search_service_client_config.json +43 -0
- package/build/src/v1/user_event_service_client.d.ts +638 -0
- package/build/src/v1/user_event_service_client.js +933 -0
- package/build/src/v1/user_event_service_client_config.json +62 -0
- package/build/src/v1beta/document_service_client.d.ts +115 -0
- package/build/src/v1beta/document_service_client.js +49 -0
- package/build/src/v1beta/document_service_client_config.json +5 -0
- package/build/src/v1beta/schema_service_client.js +6 -0
- package/build/src/v1beta/search_service_client.d.ts +78 -12
- package/build/src/v1beta/search_service_client.js +52 -8
- package/build/src/v1beta/user_event_service_client.js +6 -0
- package/package.json +9 -7
@@ -0,0 +1,313 @@
|
|
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
|
+
|
15
|
+
syntax = "proto3";
|
16
|
+
|
17
|
+
package google.cloud.discoveryengine.v1;
|
18
|
+
|
19
|
+
import "google/api/annotations.proto";
|
20
|
+
import "google/api/client.proto";
|
21
|
+
import "google/api/field_behavior.proto";
|
22
|
+
import "google/api/resource.proto";
|
23
|
+
import "google/cloud/discoveryengine/v1/document.proto";
|
24
|
+
import "google/cloud/discoveryengine/v1/import_config.proto";
|
25
|
+
import "google/cloud/discoveryengine/v1/purge_config.proto";
|
26
|
+
import "google/longrunning/operations.proto";
|
27
|
+
import "google/protobuf/empty.proto";
|
28
|
+
|
29
|
+
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1";
|
30
|
+
option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb";
|
31
|
+
option java_multiple_files = true;
|
32
|
+
option java_outer_classname = "DocumentServiceProto";
|
33
|
+
option java_package = "com.google.cloud.discoveryengine.v1";
|
34
|
+
option objc_class_prefix = "DISCOVERYENGINE";
|
35
|
+
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1";
|
36
|
+
option ruby_package = "Google::Cloud::DiscoveryEngine::V1";
|
37
|
+
|
38
|
+
// Service for ingesting [Document][google.cloud.discoveryengine.v1.Document]
|
39
|
+
// information of the customer's website.
|
40
|
+
service DocumentService {
|
41
|
+
option (google.api.default_host) = "discoveryengine.googleapis.com";
|
42
|
+
option (google.api.oauth_scopes) =
|
43
|
+
"https://www.googleapis.com/auth/cloud-platform";
|
44
|
+
|
45
|
+
// Gets a [Document][google.cloud.discoveryengine.v1.Document].
|
46
|
+
rpc GetDocument(GetDocumentRequest) returns (Document) {
|
47
|
+
option (google.api.http) = {
|
48
|
+
get: "/v1/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}"
|
49
|
+
additional_bindings {
|
50
|
+
get: "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}"
|
51
|
+
}
|
52
|
+
};
|
53
|
+
option (google.api.method_signature) = "name";
|
54
|
+
}
|
55
|
+
|
56
|
+
// Gets a list of [Document][google.cloud.discoveryengine.v1.Document]s.
|
57
|
+
rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) {
|
58
|
+
option (google.api.http) = {
|
59
|
+
get: "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents"
|
60
|
+
additional_bindings {
|
61
|
+
get: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents"
|
62
|
+
}
|
63
|
+
};
|
64
|
+
option (google.api.method_signature) = "parent";
|
65
|
+
}
|
66
|
+
|
67
|
+
// Creates a [Document][google.cloud.discoveryengine.v1.Document].
|
68
|
+
rpc CreateDocument(CreateDocumentRequest) returns (Document) {
|
69
|
+
option (google.api.http) = {
|
70
|
+
post: "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents"
|
71
|
+
body: "document"
|
72
|
+
additional_bindings {
|
73
|
+
post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents"
|
74
|
+
body: "document"
|
75
|
+
}
|
76
|
+
};
|
77
|
+
option (google.api.method_signature) = "parent,document,document_id";
|
78
|
+
}
|
79
|
+
|
80
|
+
// Updates a [Document][google.cloud.discoveryengine.v1.Document].
|
81
|
+
rpc UpdateDocument(UpdateDocumentRequest) returns (Document) {
|
82
|
+
option (google.api.http) = {
|
83
|
+
patch: "/v1/{document.name=projects/*/locations/*/dataStores/*/branches/*/documents/*}"
|
84
|
+
body: "document"
|
85
|
+
additional_bindings {
|
86
|
+
patch: "/v1/{document.name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}"
|
87
|
+
body: "document"
|
88
|
+
}
|
89
|
+
};
|
90
|
+
}
|
91
|
+
|
92
|
+
// Deletes a [Document][google.cloud.discoveryengine.v1.Document].
|
93
|
+
rpc DeleteDocument(DeleteDocumentRequest) returns (google.protobuf.Empty) {
|
94
|
+
option (google.api.http) = {
|
95
|
+
delete: "/v1/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}"
|
96
|
+
additional_bindings {
|
97
|
+
delete: "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}"
|
98
|
+
}
|
99
|
+
};
|
100
|
+
option (google.api.method_signature) = "name";
|
101
|
+
}
|
102
|
+
|
103
|
+
// Bulk import of multiple
|
104
|
+
// [Document][google.cloud.discoveryengine.v1.Document]s. Request processing
|
105
|
+
// may be synchronous. Non-existing items will be created.
|
106
|
+
//
|
107
|
+
// Note: It is possible for a subset of the
|
108
|
+
// [Document][google.cloud.discoveryengine.v1.Document]s to be successfully
|
109
|
+
// updated.
|
110
|
+
rpc ImportDocuments(ImportDocumentsRequest)
|
111
|
+
returns (google.longrunning.Operation) {
|
112
|
+
option (google.api.http) = {
|
113
|
+
post: "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:import"
|
114
|
+
body: "*"
|
115
|
+
additional_bindings {
|
116
|
+
post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:import"
|
117
|
+
body: "*"
|
118
|
+
}
|
119
|
+
};
|
120
|
+
option (google.longrunning.operation_info) = {
|
121
|
+
response_type: "google.cloud.discoveryengine.v1.ImportDocumentsResponse"
|
122
|
+
metadata_type: "google.cloud.discoveryengine.v1.ImportDocumentsMetadata"
|
123
|
+
};
|
124
|
+
}
|
125
|
+
|
126
|
+
// Permanently deletes all selected
|
127
|
+
// [Document][google.cloud.discoveryengine.v1.Document]s in a branch.
|
128
|
+
//
|
129
|
+
// This process is asynchronous. Depending on the number of
|
130
|
+
// [Document][google.cloud.discoveryengine.v1.Document]s to be deleted, this
|
131
|
+
// operation can take hours to complete. Before the delete operation
|
132
|
+
// completes, some [Document][google.cloud.discoveryengine.v1.Document]s might
|
133
|
+
// still be returned by
|
134
|
+
// [DocumentService.GetDocument][google.cloud.discoveryengine.v1.DocumentService.GetDocument]
|
135
|
+
// or
|
136
|
+
// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1.DocumentService.ListDocuments].
|
137
|
+
//
|
138
|
+
// To get a list of the [Document][google.cloud.discoveryengine.v1.Document]s
|
139
|
+
// to be deleted, set
|
140
|
+
// [PurgeDocumentsRequest.force][google.cloud.discoveryengine.v1.PurgeDocumentsRequest.force]
|
141
|
+
// to false.
|
142
|
+
rpc PurgeDocuments(PurgeDocumentsRequest)
|
143
|
+
returns (google.longrunning.Operation) {
|
144
|
+
option (google.api.http) = {
|
145
|
+
post: "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:purge"
|
146
|
+
body: "*"
|
147
|
+
additional_bindings {
|
148
|
+
post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:purge"
|
149
|
+
body: "*"
|
150
|
+
}
|
151
|
+
};
|
152
|
+
option (google.longrunning.operation_info) = {
|
153
|
+
response_type: "google.cloud.discoveryengine.v1.PurgeDocumentsResponse"
|
154
|
+
metadata_type: "google.cloud.discoveryengine.v1.PurgeDocumentsMetadata"
|
155
|
+
};
|
156
|
+
}
|
157
|
+
}
|
158
|
+
|
159
|
+
// Request message for
|
160
|
+
// [DocumentService.GetDocument][google.cloud.discoveryengine.v1.DocumentService.GetDocument]
|
161
|
+
// method.
|
162
|
+
message GetDocumentRequest {
|
163
|
+
// Required. Full resource name of
|
164
|
+
// [Document][google.cloud.discoveryengine.v1.Document], such as
|
165
|
+
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
|
166
|
+
//
|
167
|
+
// If the caller does not have permission to access the
|
168
|
+
// [Document][google.cloud.discoveryengine.v1.Document], regardless of whether
|
169
|
+
// or not it exists, a `PERMISSION_DENIED` error is returned.
|
170
|
+
//
|
171
|
+
// If the requested [Document][google.cloud.discoveryengine.v1.Document] does
|
172
|
+
// not exist, a `NOT_FOUND` error is returned.
|
173
|
+
string name = 1 [
|
174
|
+
(google.api.field_behavior) = REQUIRED,
|
175
|
+
(google.api.resource_reference) = {
|
176
|
+
type: "discoveryengine.googleapis.com/Document"
|
177
|
+
}
|
178
|
+
];
|
179
|
+
}
|
180
|
+
|
181
|
+
// Request message for
|
182
|
+
// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1.DocumentService.ListDocuments]
|
183
|
+
// method.
|
184
|
+
message ListDocumentsRequest {
|
185
|
+
// Required. The parent branch resource name, such as
|
186
|
+
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
|
187
|
+
// Use `default_branch` as the branch ID, to list documents under the default
|
188
|
+
// branch.
|
189
|
+
//
|
190
|
+
// If the caller does not have permission to list [Documents][]s under this
|
191
|
+
// branch, regardless of whether or not this branch exists, a
|
192
|
+
// `PERMISSION_DENIED` error is returned.
|
193
|
+
string parent = 1 [
|
194
|
+
(google.api.field_behavior) = REQUIRED,
|
195
|
+
(google.api.resource_reference) = {
|
196
|
+
type: "discoveryengine.googleapis.com/Branch"
|
197
|
+
}
|
198
|
+
];
|
199
|
+
|
200
|
+
// Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to
|
201
|
+
// return. If unspecified, defaults to 100. The maximum allowed value is 1000.
|
202
|
+
// Values above 1000 will be coerced to 1000.
|
203
|
+
//
|
204
|
+
// If this field is negative, an `INVALID_ARGUMENT` error is returned.
|
205
|
+
int32 page_size = 2;
|
206
|
+
|
207
|
+
// A page token
|
208
|
+
// [ListDocumentsResponse.next_page_token][google.cloud.discoveryengine.v1.ListDocumentsResponse.next_page_token],
|
209
|
+
// received from a previous
|
210
|
+
// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1.DocumentService.ListDocuments]
|
211
|
+
// call. Provide this to retrieve the subsequent page.
|
212
|
+
//
|
213
|
+
// When paginating, all other parameters provided to
|
214
|
+
// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1.DocumentService.ListDocuments]
|
215
|
+
// must match the call that provided the page token. Otherwise, an
|
216
|
+
// `INVALID_ARGUMENT` error is returned.
|
217
|
+
string page_token = 3;
|
218
|
+
}
|
219
|
+
|
220
|
+
// Response message for
|
221
|
+
// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1.DocumentService.ListDocuments]
|
222
|
+
// method.
|
223
|
+
message ListDocumentsResponse {
|
224
|
+
// The [Document][google.cloud.discoveryengine.v1.Document]s.
|
225
|
+
repeated Document documents = 1;
|
226
|
+
|
227
|
+
// A token that can be sent as
|
228
|
+
// [ListDocumentsRequest.page_token][google.cloud.discoveryengine.v1.ListDocumentsRequest.page_token]
|
229
|
+
// to retrieve the next page. If this field is omitted, there are no
|
230
|
+
// subsequent pages.
|
231
|
+
string next_page_token = 2;
|
232
|
+
}
|
233
|
+
|
234
|
+
// Request message for
|
235
|
+
// [DocumentService.CreateDocument][google.cloud.discoveryengine.v1.DocumentService.CreateDocument]
|
236
|
+
// method.
|
237
|
+
message CreateDocumentRequest {
|
238
|
+
// Required. The parent resource name, such as
|
239
|
+
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
|
240
|
+
string parent = 1 [
|
241
|
+
(google.api.field_behavior) = REQUIRED,
|
242
|
+
(google.api.resource_reference) = {
|
243
|
+
type: "discoveryengine.googleapis.com/Branch"
|
244
|
+
}
|
245
|
+
];
|
246
|
+
|
247
|
+
// Required. The [Document][google.cloud.discoveryengine.v1.Document] to
|
248
|
+
// create.
|
249
|
+
Document document = 2 [(google.api.field_behavior) = REQUIRED];
|
250
|
+
|
251
|
+
// Required. The ID to use for the
|
252
|
+
// [Document][google.cloud.discoveryengine.v1.Document], which will become the
|
253
|
+
// final component of the
|
254
|
+
// [Document.name][google.cloud.discoveryengine.v1.Document.name].
|
255
|
+
//
|
256
|
+
// If the caller does not have permission to create the
|
257
|
+
// [Document][google.cloud.discoveryengine.v1.Document], regardless of whether
|
258
|
+
// or not it exists, a `PERMISSION_DENIED` error is returned.
|
259
|
+
//
|
260
|
+
// This field must be unique among all
|
261
|
+
// [Document][google.cloud.discoveryengine.v1.Document]s with the same
|
262
|
+
// [parent][google.cloud.discoveryengine.v1.CreateDocumentRequest.parent].
|
263
|
+
// Otherwise, an `ALREADY_EXISTS` error is returned.
|
264
|
+
//
|
265
|
+
// This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
|
266
|
+
// standard with a length limit of 63 characters. Otherwise, an
|
267
|
+
// `INVALID_ARGUMENT` error is returned.
|
268
|
+
string document_id = 3 [(google.api.field_behavior) = REQUIRED];
|
269
|
+
}
|
270
|
+
|
271
|
+
// Request message for
|
272
|
+
// [DocumentService.UpdateDocument][google.cloud.discoveryengine.v1.DocumentService.UpdateDocument]
|
273
|
+
// method.
|
274
|
+
message UpdateDocumentRequest {
|
275
|
+
// Required. The document to update/create.
|
276
|
+
//
|
277
|
+
// If the caller does not have permission to update the
|
278
|
+
// [Document][google.cloud.discoveryengine.v1.Document], regardless of whether
|
279
|
+
// or not it exists, a `PERMISSION_DENIED` error is returned.
|
280
|
+
//
|
281
|
+
// If the [Document][google.cloud.discoveryengine.v1.Document] to update does
|
282
|
+
// not exist and
|
283
|
+
// [allow_missing][google.cloud.discoveryengine.v1.UpdateDocumentRequest.allow_missing]
|
284
|
+
// is not set, a `NOT_FOUND` error is returned.
|
285
|
+
Document document = 1 [(google.api.field_behavior) = REQUIRED];
|
286
|
+
|
287
|
+
// If set to true, and the
|
288
|
+
// [Document][google.cloud.discoveryengine.v1.Document] is not found, a new
|
289
|
+
// [Document][google.cloud.discoveryengine.v1.Document] will be created.
|
290
|
+
bool allow_missing = 2;
|
291
|
+
}
|
292
|
+
|
293
|
+
// Request message for
|
294
|
+
// [DocumentService.DeleteDocument][google.cloud.discoveryengine.v1.DocumentService.DeleteDocument]
|
295
|
+
// method.
|
296
|
+
message DeleteDocumentRequest {
|
297
|
+
// Required. Full resource name of
|
298
|
+
// [Document][google.cloud.discoveryengine.v1.Document], such as
|
299
|
+
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
|
300
|
+
//
|
301
|
+
// If the caller does not have permission to delete the
|
302
|
+
// [Document][google.cloud.discoveryengine.v1.Document], regardless of whether
|
303
|
+
// or not it exists, a `PERMISSION_DENIED` error is returned.
|
304
|
+
//
|
305
|
+
// If the [Document][google.cloud.discoveryengine.v1.Document] to delete does
|
306
|
+
// not exist, a `NOT_FOUND` error is returned.
|
307
|
+
string name = 1 [
|
308
|
+
(google.api.field_behavior) = REQUIRED,
|
309
|
+
(google.api.resource_reference) = {
|
310
|
+
type: "discoveryengine.googleapis.com/Document"
|
311
|
+
}
|
312
|
+
];
|
313
|
+
}
|
@@ -0,0 +1,334 @@
|
|
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
|
+
|
15
|
+
syntax = "proto3";
|
16
|
+
|
17
|
+
package google.cloud.discoveryengine.v1;
|
18
|
+
|
19
|
+
import "google/api/field_behavior.proto";
|
20
|
+
import "google/api/resource.proto";
|
21
|
+
import "google/cloud/discoveryengine/v1/document.proto";
|
22
|
+
import "google/cloud/discoveryengine/v1/user_event.proto";
|
23
|
+
import "google/protobuf/timestamp.proto";
|
24
|
+
import "google/rpc/status.proto";
|
25
|
+
import "google/type/date.proto";
|
26
|
+
|
27
|
+
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1";
|
28
|
+
option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb";
|
29
|
+
option java_multiple_files = true;
|
30
|
+
option java_outer_classname = "ImportConfigProto";
|
31
|
+
option java_package = "com.google.cloud.discoveryengine.v1";
|
32
|
+
option objc_class_prefix = "DISCOVERYENGINE";
|
33
|
+
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1";
|
34
|
+
option ruby_package = "Google::Cloud::DiscoveryEngine::V1";
|
35
|
+
|
36
|
+
// Cloud Storage location for input content.
|
37
|
+
message GcsSource {
|
38
|
+
// Required. Cloud Storage URIs to input files. URI can be up to
|
39
|
+
// 2000 characters long. URIs can match the full object path (for example,
|
40
|
+
// `gs://bucket/directory/object.json`) or a pattern matching one or more
|
41
|
+
// files, such as `gs://bucket/directory/*.json`.
|
42
|
+
//
|
43
|
+
// A request can contain at most 100 files (or 100,000 files if `data_schema`
|
44
|
+
// is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
|
45
|
+
// `content`).
|
46
|
+
repeated string input_uris = 1 [(google.api.field_behavior) = REQUIRED];
|
47
|
+
|
48
|
+
// The schema to use when parsing the data from the source.
|
49
|
+
//
|
50
|
+
// Supported values for document imports:
|
51
|
+
//
|
52
|
+
// * `document` (default): One JSON
|
53
|
+
// [Document][google.cloud.discoveryengine.v1.Document] per line. Each
|
54
|
+
// document must
|
55
|
+
// have a valid [Document.id][google.cloud.discoveryengine.v1.Document.id].
|
56
|
+
// * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by
|
57
|
+
// `input_uris` will become a document, with the ID set to the first 128
|
58
|
+
// bits of SHA256(URI) encoded as a hex string.
|
59
|
+
// * `custom`: One custom data JSON per row in arbitrary format that conforms
|
60
|
+
// the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data
|
61
|
+
// store. This can only be used by the GENERIC Data Store vertical.
|
62
|
+
//
|
63
|
+
// Supported values for user even imports:
|
64
|
+
//
|
65
|
+
// * `user_event` (default): One JSON
|
66
|
+
// [UserEvent][google.cloud.discoveryengine.v1.UserEvent] per line.
|
67
|
+
string data_schema = 2;
|
68
|
+
}
|
69
|
+
|
70
|
+
// BigQuery source import data from.
|
71
|
+
message BigQuerySource {
|
72
|
+
// BigQuery table partition info. Leave this empty if the BigQuery table
|
73
|
+
// is not partitioned.
|
74
|
+
oneof partition {
|
75
|
+
// BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
|
76
|
+
google.type.Date partition_date = 5;
|
77
|
+
}
|
78
|
+
|
79
|
+
// The project ID (can be project # or ID) that the BigQuery source is in with
|
80
|
+
// a length limit of 128 characters. If not specified, inherits the project
|
81
|
+
// ID from the parent request.
|
82
|
+
string project_id = 1;
|
83
|
+
|
84
|
+
// Required. The BigQuery data set to copy the data from with a length limit
|
85
|
+
// of 1,024 characters.
|
86
|
+
string dataset_id = 2 [(google.api.field_behavior) = REQUIRED];
|
87
|
+
|
88
|
+
// Required. The BigQuery table to copy the data from with a length limit of
|
89
|
+
// 1,024 characters.
|
90
|
+
string table_id = 3 [(google.api.field_behavior) = REQUIRED];
|
91
|
+
|
92
|
+
// Intermediate Cloud Storage directory used for the import with a length
|
93
|
+
// limit of 2,000 characters. Can be specified if one wants to have the
|
94
|
+
// BigQuery export to a specific Cloud Storage directory.
|
95
|
+
string gcs_staging_dir = 4;
|
96
|
+
|
97
|
+
// The schema to use when parsing the data from the source.
|
98
|
+
//
|
99
|
+
// Supported values for user event imports:
|
100
|
+
//
|
101
|
+
// * `user_event` (default): One
|
102
|
+
// [UserEvent][google.cloud.discoveryengine.v1.UserEvent] per row.
|
103
|
+
//
|
104
|
+
// Supported values for document imports:
|
105
|
+
//
|
106
|
+
// * `document` (default): One
|
107
|
+
// [Document][google.cloud.discoveryengine.v1.Document] format per
|
108
|
+
// row. Each document must have a valid
|
109
|
+
// [Document.id][google.cloud.discoveryengine.v1.Document.id] and one of
|
110
|
+
// [Document.json_data][google.cloud.discoveryengine.v1.Document.json_data]
|
111
|
+
// or
|
112
|
+
// [Document.struct_data][google.cloud.discoveryengine.v1.Document.struct_data].
|
113
|
+
// * `custom`: One custom data per row in arbitrary format that conforms the
|
114
|
+
// defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data
|
115
|
+
// store. This can only be used by the GENERIC Data Store vertical.
|
116
|
+
string data_schema = 6;
|
117
|
+
}
|
118
|
+
|
119
|
+
// Configuration of destination for Import related errors.
|
120
|
+
message ImportErrorConfig {
|
121
|
+
// Required. Errors destination.
|
122
|
+
oneof destination {
|
123
|
+
// Cloud Storage prefix for import errors. This must be an empty,
|
124
|
+
// existing Cloud Storage directory. Import errors will be written to
|
125
|
+
// sharded files in this directory, one per line, as a JSON-encoded
|
126
|
+
// `google.rpc.Status` message.
|
127
|
+
string gcs_prefix = 1;
|
128
|
+
}
|
129
|
+
}
|
130
|
+
|
131
|
+
// Request message for the ImportUserEvents request.
|
132
|
+
message ImportUserEventsRequest {
|
133
|
+
// The inline source for the input config for ImportUserEvents method.
|
134
|
+
message InlineSource {
|
135
|
+
// Required. A list of user events to import. Recommended max of 10k items.
|
136
|
+
repeated UserEvent user_events = 1 [(google.api.field_behavior) = REQUIRED];
|
137
|
+
}
|
138
|
+
|
139
|
+
// The desired input source of the user event data.
|
140
|
+
oneof source {
|
141
|
+
// Required. The Inline source for the input content for UserEvents.
|
142
|
+
InlineSource inline_source = 2 [(google.api.field_behavior) = REQUIRED];
|
143
|
+
|
144
|
+
// Required. Cloud Storage location for the input content.
|
145
|
+
GcsSource gcs_source = 3 [(google.api.field_behavior) = REQUIRED];
|
146
|
+
|
147
|
+
// Required. BigQuery input source.
|
148
|
+
BigQuerySource bigquery_source = 4 [(google.api.field_behavior) = REQUIRED];
|
149
|
+
}
|
150
|
+
|
151
|
+
// Required. Parent DataStore resource name, of the form
|
152
|
+
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
|
153
|
+
string parent = 1 [
|
154
|
+
(google.api.field_behavior) = REQUIRED,
|
155
|
+
(google.api.resource_reference) = {
|
156
|
+
type: "discoveryengine.googleapis.com/DataStore"
|
157
|
+
}
|
158
|
+
];
|
159
|
+
|
160
|
+
// The desired location of errors incurred during the Import. Cannot be set
|
161
|
+
// for inline user event imports.
|
162
|
+
ImportErrorConfig error_config = 5;
|
163
|
+
}
|
164
|
+
|
165
|
+
// Response of the ImportUserEventsRequest. If the long running
|
166
|
+
// operation was successful, then this message is returned by the
|
167
|
+
// google.longrunning.Operations.response field if the operation was successful.
|
168
|
+
message ImportUserEventsResponse {
|
169
|
+
// A sample of errors encountered while processing the request.
|
170
|
+
repeated google.rpc.Status error_samples = 1;
|
171
|
+
|
172
|
+
// Echoes the destination for the complete errors if this field was set in
|
173
|
+
// the request.
|
174
|
+
ImportErrorConfig error_config = 2;
|
175
|
+
|
176
|
+
// Count of user events imported with complete existing Documents.
|
177
|
+
int64 joined_events_count = 3;
|
178
|
+
|
179
|
+
// Count of user events imported, but with Document information not found
|
180
|
+
// in the existing Branch.
|
181
|
+
int64 unjoined_events_count = 4;
|
182
|
+
}
|
183
|
+
|
184
|
+
// Metadata related to the progress of the Import operation. This will be
|
185
|
+
// returned by the google.longrunning.Operation.metadata field.
|
186
|
+
message ImportUserEventsMetadata {
|
187
|
+
// Operation create time.
|
188
|
+
google.protobuf.Timestamp create_time = 1;
|
189
|
+
|
190
|
+
// Operation last update time. If the operation is done, this is also the
|
191
|
+
// finish time.
|
192
|
+
google.protobuf.Timestamp update_time = 2;
|
193
|
+
|
194
|
+
// Count of entries that were processed successfully.
|
195
|
+
int64 success_count = 3;
|
196
|
+
|
197
|
+
// Count of entries that encountered errors while processing.
|
198
|
+
int64 failure_count = 4;
|
199
|
+
}
|
200
|
+
|
201
|
+
// Metadata related to the progress of the ImportDocuments operation. This will
|
202
|
+
// be returned by the google.longrunning.Operation.metadata field.
|
203
|
+
message ImportDocumentsMetadata {
|
204
|
+
// Operation create time.
|
205
|
+
google.protobuf.Timestamp create_time = 1;
|
206
|
+
|
207
|
+
// Operation last update time. If the operation is done, this is also the
|
208
|
+
// finish time.
|
209
|
+
google.protobuf.Timestamp update_time = 2;
|
210
|
+
|
211
|
+
// Count of entries that were processed successfully.
|
212
|
+
int64 success_count = 3;
|
213
|
+
|
214
|
+
// Count of entries that encountered errors while processing.
|
215
|
+
int64 failure_count = 4;
|
216
|
+
}
|
217
|
+
|
218
|
+
// Request message for Import methods.
|
219
|
+
message ImportDocumentsRequest {
|
220
|
+
// The inline source for the input config for ImportDocuments method.
|
221
|
+
message InlineSource {
|
222
|
+
// Required. A list of documents to update/create. Each document must have a
|
223
|
+
// valid [Document.id][google.cloud.discoveryengine.v1.Document.id].
|
224
|
+
// Recommended max of 100 items.
|
225
|
+
repeated Document documents = 1 [(google.api.field_behavior) = REQUIRED];
|
226
|
+
}
|
227
|
+
|
228
|
+
// Indicates how imported documents are reconciled with the existing documents
|
229
|
+
// created or imported before.
|
230
|
+
enum ReconciliationMode {
|
231
|
+
// Defaults to INCREMENTAL.
|
232
|
+
RECONCILIATION_MODE_UNSPECIFIED = 0;
|
233
|
+
|
234
|
+
// Inserts new documents or updates existing documents.
|
235
|
+
INCREMENTAL = 1;
|
236
|
+
|
237
|
+
// Calculates diff and replaces the entire document dataset. Existing
|
238
|
+
// documents may be deleted if they are not present in the source location.
|
239
|
+
FULL = 2;
|
240
|
+
}
|
241
|
+
|
242
|
+
// Required. The source of the input.
|
243
|
+
oneof source {
|
244
|
+
// The Inline source for the input content for documents.
|
245
|
+
InlineSource inline_source = 2;
|
246
|
+
|
247
|
+
// Cloud Storage location for the input content.
|
248
|
+
GcsSource gcs_source = 3;
|
249
|
+
|
250
|
+
// BigQuery input source.
|
251
|
+
BigQuerySource bigquery_source = 4;
|
252
|
+
}
|
253
|
+
|
254
|
+
// Required. The parent branch resource name, such as
|
255
|
+
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
|
256
|
+
// Requires create/update permission.
|
257
|
+
string parent = 1 [
|
258
|
+
(google.api.field_behavior) = REQUIRED,
|
259
|
+
(google.api.resource_reference) = {
|
260
|
+
type: "discoveryengine.googleapis.com/Branch"
|
261
|
+
}
|
262
|
+
];
|
263
|
+
|
264
|
+
// The desired location of errors incurred during the Import.
|
265
|
+
ImportErrorConfig error_config = 5;
|
266
|
+
|
267
|
+
// The mode of reconciliation between existing documents and the documents to
|
268
|
+
// be imported. Defaults to
|
269
|
+
// [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
|
270
|
+
ReconciliationMode reconciliation_mode = 6;
|
271
|
+
|
272
|
+
// Whether to automatically generate IDs for the documents if absent.
|
273
|
+
//
|
274
|
+
// If set to `true`,
|
275
|
+
// [Document.id][google.cloud.discoveryengine.v1.Document.id]s are
|
276
|
+
// automatically generated based on the hash of the payload, where IDs may not
|
277
|
+
// be consistent during multiple imports. In which case
|
278
|
+
// [ReconciliationMode.FULL][google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode.FULL]
|
279
|
+
// is highly recommended to avoid duplicate contents. If unset or set to
|
280
|
+
// `false`, [Document.id][google.cloud.discoveryengine.v1.Document.id]s have
|
281
|
+
// to be specified using
|
282
|
+
// [id_field][google.cloud.discoveryengine.v1.ImportDocumentsRequest.id_field],
|
283
|
+
// otherwises, documents without IDs will fail to be imported.
|
284
|
+
//
|
285
|
+
// Only set this field when using
|
286
|
+
// [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or
|
287
|
+
// [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource], and when
|
288
|
+
// [GcsSource.data_schema][google.cloud.discoveryengine.v1.GcsSource.data_schema]
|
289
|
+
// or
|
290
|
+
// [BigQuerySource.data_schema][google.cloud.discoveryengine.v1.BigQuerySource.data_schema]
|
291
|
+
// is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown.
|
292
|
+
bool auto_generate_ids = 8;
|
293
|
+
|
294
|
+
// The field in the Cloud Storage and BigQuery sources that indicates the
|
295
|
+
// unique IDs of the documents.
|
296
|
+
//
|
297
|
+
// For [GcsSource][google.cloud.discoveryengine.v1.GcsSource] it is the key of
|
298
|
+
// the JSON field. For instance, `my_id` for JSON `{"my_id": "some_uuid"}`.
|
299
|
+
// For [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource] it is
|
300
|
+
// the column name of the BigQuery table where the unique ids are stored.
|
301
|
+
//
|
302
|
+
// The values of the JSON field or the BigQuery column will be used as the
|
303
|
+
// [Document.id][google.cloud.discoveryengine.v1.Document.id]s. The JSON field
|
304
|
+
// or the BigQuery column must be of string type, and the values must be set
|
305
|
+
// as valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
|
306
|
+
// with 1-63 characters. Otherwise, documents without valid IDs will fail to
|
307
|
+
// be imported.
|
308
|
+
//
|
309
|
+
// Only set this field when using
|
310
|
+
// [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or
|
311
|
+
// [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource], and when
|
312
|
+
// [GcsSource.data_schema][google.cloud.discoveryengine.v1.GcsSource.data_schema]
|
313
|
+
// or
|
314
|
+
// [BigQuerySource.data_schema][google.cloud.discoveryengine.v1.BigQuerySource.data_schema]
|
315
|
+
// is `custom`. And only set this field when
|
316
|
+
// [auto_generate_ids][google.cloud.discoveryengine.v1.ImportDocumentsRequest.auto_generate_ids]
|
317
|
+
// is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown.
|
318
|
+
//
|
319
|
+
// If it is unset, a default value `_id` is used when importing from the
|
320
|
+
// allowed data sources.
|
321
|
+
string id_field = 9;
|
322
|
+
}
|
323
|
+
|
324
|
+
// Response of the
|
325
|
+
// [ImportDocumentsRequest][google.cloud.discoveryengine.v1.ImportDocumentsRequest].
|
326
|
+
// If the long running operation is done, then this message is returned by the
|
327
|
+
// google.longrunning.Operations.response field if the operation was successful.
|
328
|
+
message ImportDocumentsResponse {
|
329
|
+
// A sample of errors encountered while processing the request.
|
330
|
+
repeated google.rpc.Status error_samples = 1;
|
331
|
+
|
332
|
+
// Echoes the destination for the complete errors in the request if set.
|
333
|
+
ImportErrorConfig error_config = 2;
|
334
|
+
}
|