@google-cloud/discoveryengine 1.1.0 → 1.2.0

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