@google-cloud/discoveryengine 2.1.0 → 2.3.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/README.md +13 -0
- package/build/protos/google/cloud/discoveryengine/v1/answer.proto +17 -0
- package/build/protos/google/cloud/discoveryengine/v1/chunk.proto +52 -0
- package/build/protos/google/cloud/discoveryengine/v1/cmek_config_service.proto +300 -0
- package/build/protos/google/cloud/discoveryengine/v1/common.proto +67 -0
- package/build/protos/google/cloud/discoveryengine/v1/control.proto +1 -3
- package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +3 -0
- package/build/protos/google/cloud/discoveryengine/v1/data_store.proto +54 -2
- package/build/protos/google/cloud/discoveryengine/v1/data_store_service.proto +14 -0
- package/build/protos/google/cloud/discoveryengine/v1/document.proto +95 -4
- package/build/protos/google/cloud/discoveryengine/v1/document_processing_config.proto +28 -1
- package/build/protos/google/cloud/discoveryengine/v1/engine.proto +131 -6
- package/build/protos/google/cloud/discoveryengine/v1/grounded_generation_service.proto +8 -0
- package/build/protos/google/cloud/discoveryengine/v1/grounding.proto +9 -0
- package/build/protos/google/cloud/discoveryengine/v1/identity_mapping_store.proto +84 -0
- package/build/protos/google/cloud/discoveryengine/v1/identity_mapping_store_service.proto +375 -0
- package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +6 -0
- package/build/protos/google/cloud/discoveryengine/v1/site_search_engine.proto +6 -0
- package/build/protos/google/cloud/discoveryengine/v1/user_license.proto +98 -0
- package/build/protos/google/cloud/discoveryengine/v1/user_license_service.proto +191 -0
- package/build/protos/protos.d.ts +5415 -578
- package/build/protos/protos.js +77830 -63391
- package/build/protos/protos.json +1537 -92
- package/build/src/index.d.ts +10 -1
- package/build/src/index.js +8 -22
- package/build/src/v1/cmek_config_service_client.d.ts +2287 -0
- package/build/src/v1/cmek_config_service_client.js +3274 -0
- package/build/src/v1/cmek_config_service_client_config.json +42 -0
- package/build/src/v1/cmek_config_service_proto_list.json +44 -0
- package/build/src/v1/completion_service_client.d.ts +166 -76
- package/build/src/v1/completion_service_client.js +258 -263
- package/build/src/v1/completion_service_proto_list.json +6 -1
- package/build/src/v1/control_service_client.d.ts +171 -81
- package/build/src/v1/control_service_client.js +246 -132
- package/build/src/v1/control_service_proto_list.json +6 -1
- package/build/src/v1/conversational_search_service_client.d.ts +233 -143
- package/build/src/v1/conversational_search_service_client.js +330 -226
- package/build/src/v1/conversational_search_service_proto_list.json +6 -1
- package/build/src/v1/data_store_service_client.d.ts +218 -122
- package/build/src/v1/data_store_service_client.js +273 -281
- package/build/src/v1/data_store_service_proto_list.json +6 -1
- package/build/src/v1/document_service_client.d.ts +210 -120
- package/build/src/v1/document_service_client.js +300 -301
- package/build/src/v1/document_service_proto_list.json +6 -1
- package/build/src/v1/engine_service_client.d.ts +193 -103
- package/build/src/v1/engine_service_client.js +273 -280
- package/build/src/v1/engine_service_proto_list.json +6 -1
- package/build/src/v1/gapic_metadata.json +184 -0
- package/build/src/v1/grounded_generation_service_client.d.ts +138 -48
- package/build/src/v1/grounded_generation_service_client.js +217 -100
- package/build/src/v1/grounded_generation_service_proto_list.json +6 -1
- package/build/src/v1/identity_mapping_store_service_client.d.ts +2470 -0
- package/build/src/v1/identity_mapping_store_service_client.js +3449 -0
- package/build/src/v1/identity_mapping_store_service_client_config.json +54 -0
- package/build/src/v1/identity_mapping_store_service_proto_list.json +44 -0
- package/build/src/v1/index.d.ts +3 -0
- package/build/src/v1/index.js +7 -1
- package/build/src/v1/project_service_client.d.ts +166 -76
- package/build/src/v1/project_service_client.js +235 -223
- package/build/src/v1/project_service_proto_list.json +6 -1
- package/build/src/v1/rank_service_client.d.ts +137 -47
- package/build/src/v1/rank_service_client.js +204 -85
- package/build/src/v1/rank_service_proto_list.json +6 -1
- package/build/src/v1/recommendation_service_client.d.ts +137 -47
- package/build/src/v1/recommendation_service_client.js +202 -82
- package/build/src/v1/recommendation_service_proto_list.json +6 -1
- package/build/src/v1/schema_service_client.d.ts +201 -111
- package/build/src/v1/schema_service_client.js +264 -274
- package/build/src/v1/schema_service_proto_list.json +6 -1
- package/build/src/v1/search_service_client.d.ts +661 -571
- package/build/src/v1/search_service_client.js +216 -113
- package/build/src/v1/search_service_proto_list.json +6 -1
- package/build/src/v1/search_tuning_service_client.d.ts +167 -77
- package/build/src/v1/search_tuning_service_client.js +246 -236
- package/build/src/v1/search_tuning_service_proto_list.json +6 -1
- package/build/src/v1/serving_config_service_client.d.ts +138 -48
- package/build/src/v1/serving_config_service_client.js +201 -80
- package/build/src/v1/serving_config_service_proto_list.json +6 -1
- package/build/src/v1/site_search_engine_service_client.d.ts +238 -148
- package/build/src/v1/site_search_engine_service_client.js +324 -379
- package/build/src/v1/site_search_engine_service_proto_list.json +6 -1
- package/build/src/v1/user_event_service_client.d.ts +167 -77
- package/build/src/v1/user_event_service_client.js +260 -254
- package/build/src/v1/user_event_service_proto_list.json +6 -1
- package/build/src/v1/user_license_service_client.d.ts +2256 -0
- package/build/src/v1/user_license_service_client.js +3194 -0
- package/build/src/v1/user_license_service_client_config.json +34 -0
- package/build/src/v1/user_license_service_proto_list.json +44 -0
- package/build/src/v1alpha/acl_config_service_client.d.ts +49 -49
- package/build/src/v1alpha/acl_config_service_client.js +94 -106
- package/build/src/v1alpha/chunk_service_client.d.ts +88 -88
- package/build/src/v1alpha/chunk_service_client.js +98 -120
- package/build/src/v1alpha/completion_service_client.d.ts +77 -77
- package/build/src/v1alpha/completion_service_client.js +141 -281
- package/build/src/v1alpha/control_service_client.d.ts +85 -85
- package/build/src/v1alpha/control_service_client.js +129 -151
- package/build/src/v1alpha/conversational_search_service_client.d.ts +143 -143
- package/build/src/v1alpha/conversational_search_service_client.js +211 -237
- package/build/src/v1alpha/data_store_service_client.d.ts +126 -126
- package/build/src/v1alpha/data_store_service_client.js +176 -317
- package/build/src/v1alpha/document_service_client.d.ts +126 -126
- package/build/src/v1alpha/document_service_client.js +193 -329
- package/build/src/v1alpha/engine_service_client.d.ts +106 -106
- package/build/src/v1alpha/engine_service_client.js +180 -326
- package/build/src/v1alpha/estimate_billing_service_client.d.ts +76 -76
- package/build/src/v1alpha/estimate_billing_service_client.js +119 -244
- package/build/src/v1alpha/evaluation_service_client.d.ts +161 -161
- package/build/src/v1alpha/evaluation_service_client.js +150 -296
- package/build/src/v1alpha/grounded_generation_service_client.d.ts +48 -48
- package/build/src/v1alpha/grounded_generation_service_client.js +85 -100
- package/build/src/v1alpha/project_service_client.d.ts +78 -78
- package/build/src/v1alpha/project_service_client.js +139 -263
- package/build/src/v1alpha/rank_service_client.d.ts +47 -47
- package/build/src/v1alpha/rank_service_client.js +87 -104
- package/build/src/v1alpha/recommendation_service_client.d.ts +47 -47
- package/build/src/v1alpha/recommendation_service_client.js +85 -100
- package/build/src/v1alpha/sample_query_service_client.d.ts +123 -123
- package/build/src/v1alpha/sample_query_service_client.js +169 -302
- package/build/src/v1alpha/sample_query_set_service_client.d.ts +94 -94
- package/build/src/v1alpha/sample_query_set_service_client.js +130 -153
- package/build/src/v1alpha/schema_service_client.d.ts +112 -112
- package/build/src/v1alpha/schema_service_client.js +147 -293
- package/build/src/v1alpha/search_service_client.d.ts +327 -327
- package/build/src/v1alpha/search_service_client.js +88 -112
- package/build/src/v1alpha/search_tuning_service_client.d.ts +77 -77
- package/build/src/v1alpha/search_tuning_service_client.js +129 -254
- package/build/src/v1alpha/serving_config_service_client.d.ts +75 -75
- package/build/src/v1alpha/serving_config_service_client.js +109 -133
- package/build/src/v1alpha/site_search_engine_service_client.d.ts +151 -151
- package/build/src/v1alpha/site_search_engine_service_client.js +203 -388
- package/build/src/v1alpha/user_event_service_client.d.ts +78 -78
- package/build/src/v1alpha/user_event_service_client.js +143 -272
- package/build/src/v1beta/completion_service_client.d.ts +78 -78
- package/build/src/v1beta/completion_service_client.js +149 -280
- package/build/src/v1beta/control_service_client.d.ts +84 -84
- package/build/src/v1beta/control_service_client.js +127 -147
- package/build/src/v1beta/conversational_search_service_client.d.ts +142 -142
- package/build/src/v1beta/conversational_search_service_client.js +209 -233
- package/build/src/v1beta/data_store_service_client.d.ts +124 -124
- package/build/src/v1beta/data_store_service_client.js +154 -289
- package/build/src/v1beta/document_service_client.d.ts +124 -124
- package/build/src/v1beta/document_service_client.js +181 -310
- package/build/src/v1beta/engine_service_client.d.ts +106 -106
- package/build/src/v1beta/engine_service_client.js +178 -316
- package/build/src/v1beta/evaluation_service_client.d.ts +161 -161
- package/build/src/v1beta/evaluation_service_client.js +148 -286
- package/build/src/v1beta/grounded_generation_service_client.d.ts +49 -49
- package/build/src/v1beta/grounded_generation_service_client.js +98 -114
- package/build/src/v1beta/project_service_client.d.ts +76 -76
- package/build/src/v1beta/project_service_client.js +116 -232
- package/build/src/v1beta/rank_service_client.d.ts +47 -47
- package/build/src/v1beta/rank_service_client.js +85 -99
- package/build/src/v1beta/recommendation_service_client.d.ts +47 -47
- package/build/src/v1beta/recommendation_service_client.js +83 -96
- package/build/src/v1beta/sample_query_service_client.d.ts +123 -123
- package/build/src/v1beta/sample_query_service_client.js +167 -292
- package/build/src/v1beta/sample_query_set_service_client.d.ts +94 -94
- package/build/src/v1beta/sample_query_set_service_client.js +128 -149
- package/build/src/v1beta/schema_service_client.d.ts +111 -111
- package/build/src/v1beta/schema_service_client.js +145 -283
- package/build/src/v1beta/search_service_client.d.ts +665 -665
- package/build/src/v1beta/search_service_client.js +97 -128
- package/build/src/v1beta/search_tuning_service_client.d.ts +77 -77
- package/build/src/v1beta/search_tuning_service_client.js +127 -244
- package/build/src/v1beta/serving_config_service_client.d.ts +75 -75
- package/build/src/v1beta/serving_config_service_client.js +107 -129
- package/build/src/v1beta/site_search_engine_service_client.d.ts +151 -151
- package/build/src/v1beta/site_search_engine_service_client.js +205 -387
- package/build/src/v1beta/user_event_service_client.d.ts +78 -78
- package/build/src/v1beta/user_event_service_client.js +141 -262
- package/package.json +7 -7
- package/CHANGELOG.md +0 -267
@@ -151,47 +151,47 @@ export declare class ChunkServiceClient {
|
|
151
151
|
getChunk(request: protos.google.cloud.discoveryengine.v1alpha.IGetChunkRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1alpha.IChunk, protos.google.cloud.discoveryengine.v1alpha.IGetChunkRequest | null | undefined, {} | null | undefined>): void;
|
152
152
|
getChunk(request: protos.google.cloud.discoveryengine.v1alpha.IGetChunkRequest, callback: Callback<protos.google.cloud.discoveryengine.v1alpha.IChunk, protos.google.cloud.discoveryengine.v1alpha.IGetChunkRequest | null | undefined, {} | null | undefined>): void;
|
153
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
|
-
|
154
|
+
* Gets a list of {@link protos.google.cloud.discoveryengine.v1alpha.Chunk|Chunk}s.
|
155
|
+
*
|
156
|
+
* @param {Object} request
|
157
|
+
* The request object that will be sent.
|
158
|
+
* @param {string} request.parent
|
159
|
+
* Required. The parent document resource name, such as
|
160
|
+
* `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
|
161
|
+
*
|
162
|
+
* If the caller does not have permission to list
|
163
|
+
* {@link protos.google.cloud.discoveryengine.v1alpha.Chunk|Chunk}s under this document,
|
164
|
+
* regardless of whether or not this document exists, a `PERMISSION_DENIED`
|
165
|
+
* error is returned.
|
166
|
+
* @param {number} request.pageSize
|
167
|
+
* Maximum number of {@link protos.google.cloud.discoveryengine.v1alpha.Chunk|Chunk}s to
|
168
|
+
* return. If unspecified, defaults to 100. The maximum allowed value is 1000.
|
169
|
+
* Values above 1000 will be coerced to 1000.
|
170
|
+
*
|
171
|
+
* If this field is negative, an `INVALID_ARGUMENT` error is returned.
|
172
|
+
* @param {string} request.pageToken
|
173
|
+
* A page token
|
174
|
+
* {@link protos.google.cloud.discoveryengine.v1alpha.ListChunksResponse.next_page_token|ListChunksResponse.next_page_token},
|
175
|
+
* received from a previous
|
176
|
+
* {@link protos.google.cloud.discoveryengine.v1alpha.ChunkService.ListChunks|ChunkService.ListChunks}
|
177
|
+
* call. Provide this to retrieve the subsequent page.
|
178
|
+
*
|
179
|
+
* When paginating, all other parameters provided to
|
180
|
+
* {@link protos.google.cloud.discoveryengine.v1alpha.ChunkService.ListChunks|ChunkService.ListChunks}
|
181
|
+
* must match the call that provided the page token. Otherwise, an
|
182
|
+
* `INVALID_ARGUMENT` error is returned.
|
183
|
+
* @param {object} [options]
|
184
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
185
|
+
* @returns {Promise} - The promise which resolves to an array.
|
186
|
+
* The first element of the array is Array of {@link protos.google.cloud.discoveryengine.v1alpha.Chunk|Chunk}.
|
187
|
+
* The client library will perform auto-pagination by default: it will call the API as many
|
188
|
+
* times as needed and will merge results from all the pages into this array.
|
189
|
+
* Note that it can affect your quota.
|
190
|
+
* We recommend using `listChunksAsync()`
|
191
|
+
* method described below for async iteration which you can stop as needed.
|
192
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
193
|
+
* for more details and examples.
|
194
|
+
*/
|
195
195
|
listChunks(request?: protos.google.cloud.discoveryengine.v1alpha.IListChunksRequest, options?: CallOptions): Promise<[
|
196
196
|
protos.google.cloud.discoveryengine.v1alpha.IChunk[],
|
197
197
|
protos.google.cloud.discoveryengine.v1alpha.IListChunksRequest | null,
|
@@ -285,55 +285,55 @@ export declare class ChunkServiceClient {
|
|
285
285
|
*/
|
286
286
|
listChunksAsync(request?: protos.google.cloud.discoveryengine.v1alpha.IListChunksRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.discoveryengine.v1alpha.IChunk>;
|
287
287
|
/**
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
288
|
+
* Gets information about a location.
|
289
|
+
*
|
290
|
+
* @param {Object} request
|
291
|
+
* The request object that will be sent.
|
292
|
+
* @param {string} request.name
|
293
|
+
* Resource name for the location.
|
294
|
+
* @param {object} [options]
|
295
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
296
|
+
* @returns {Promise} - The promise which resolves to an array.
|
297
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
298
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
299
|
+
* for more details and examples.
|
300
|
+
* @example
|
301
|
+
* ```
|
302
|
+
* const [response] = await client.getLocation(request);
|
303
|
+
* ```
|
304
|
+
*/
|
305
305
|
getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;
|
306
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
|
-
|
307
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
308
|
+
*
|
309
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
310
|
+
* @param {Object} request
|
311
|
+
* The request object that will be sent.
|
312
|
+
* @param {string} request.name
|
313
|
+
* The resource that owns the locations collection, if applicable.
|
314
|
+
* @param {string} request.filter
|
315
|
+
* The standard list filter.
|
316
|
+
* @param {number} request.pageSize
|
317
|
+
* The standard list page size.
|
318
|
+
* @param {string} request.pageToken
|
319
|
+
* The standard list page token.
|
320
|
+
* @param {object} [options]
|
321
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
322
|
+
* @returns {Object}
|
323
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
324
|
+
* When you iterate the returned iterable, each element will be an object representing
|
325
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
326
|
+
* so you can stop the iteration when you don't need more results.
|
327
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
328
|
+
* for more details and examples.
|
329
|
+
* @example
|
330
|
+
* ```
|
331
|
+
* const iterable = client.listLocationsAsync(request);
|
332
|
+
* for await (const response of iterable) {
|
333
|
+
* // process response
|
334
|
+
* }
|
335
|
+
* ```
|
336
|
+
*/
|
337
337
|
listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
|
338
338
|
/**
|
339
339
|
* Return a fully-qualified aclConfig resource name string.
|
@@ -99,26 +99,17 @@ class ChunkServiceClient {
|
|
99
99
|
constructor(opts, gaxInstance) {
|
100
100
|
// Ensure that options include all the required fields.
|
101
101
|
const staticMembers = this.constructor;
|
102
|
-
if (opts?.universe_domain &&
|
103
|
-
opts?.universeDomain &&
|
104
|
-
opts?.universe_domain !== opts?.universeDomain) {
|
102
|
+
if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
|
105
103
|
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
106
104
|
}
|
107
|
-
const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
|
108
|
-
|
109
|
-
: undefined;
|
110
|
-
this._universeDomain =
|
111
|
-
opts?.universeDomain ??
|
112
|
-
opts?.universe_domain ??
|
113
|
-
universeDomainEnvVar ??
|
114
|
-
'googleapis.com';
|
105
|
+
const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
|
106
|
+
this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
|
115
107
|
this._servicePath = 'discoveryengine.' + this._universeDomain;
|
116
108
|
const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
|
117
109
|
this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
|
118
110
|
const port = opts?.port || staticMembers.port;
|
119
111
|
const clientConfig = opts?.clientConfig ?? {};
|
120
|
-
const fallback = opts?.fallback ??
|
121
|
-
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
112
|
+
const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
122
113
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
123
114
|
// Request numeric enum values if REST transport is used.
|
124
115
|
opts.numericEnums = true;
|
@@ -148,7 +139,10 @@ class ChunkServiceClient {
|
|
148
139
|
}
|
149
140
|
this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
|
150
141
|
// Determine the client header string.
|
151
|
-
const clientHeader = [
|
142
|
+
const clientHeader = [
|
143
|
+
`gax/${this._gaxModule.version}`,
|
144
|
+
`gapic/${version}`,
|
145
|
+
];
|
152
146
|
if (typeof process === 'object' && 'versions' in process) {
|
153
147
|
clientHeader.push(`gl-node/${process.versions.node}`);
|
154
148
|
}
|
@@ -212,7 +206,7 @@ class ChunkServiceClient {
|
|
212
206
|
// (e.g. 50 results at a time, with tokens to get subsequent
|
213
207
|
// pages). Denote the keys used for pagination and results.
|
214
208
|
this.descriptors.page = {
|
215
|
-
listChunks: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'chunks')
|
209
|
+
listChunks: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'chunks')
|
216
210
|
};
|
217
211
|
// Put together the default options sent with requests.
|
218
212
|
this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1alpha.ChunkService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
@@ -241,11 +235,10 @@ class ChunkServiceClient {
|
|
241
235
|
}
|
242
236
|
// Put together the "service stub" for
|
243
237
|
// google.cloud.discoveryengine.v1alpha.ChunkService.
|
244
|
-
this.chunkServiceStub = this._gaxGrpc.createStub(this._opts.fallback
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
.ChunkService, this._opts, this._providedCustomServicePath);
|
238
|
+
this.chunkServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
|
239
|
+
this._protos.lookupService('google.cloud.discoveryengine.v1alpha.ChunkService') :
|
240
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
241
|
+
this._protos.google.cloud.discoveryengine.v1alpha.ChunkService, this._opts, this._providedCustomServicePath);
|
249
242
|
// Iterate over each of the methods that the service provides
|
250
243
|
// and create an API call method for each.
|
251
244
|
const chunkServiceStubMethods = ['getChunk', 'listChunks'];
|
@@ -259,7 +252,8 @@ class ChunkServiceClient {
|
|
259
252
|
}, (err) => () => {
|
260
253
|
throw err;
|
261
254
|
});
|
262
|
-
const descriptor = this.descriptors.page[methodName] ||
|
255
|
+
const descriptor = this.descriptors.page[methodName] ||
|
256
|
+
undefined;
|
263
257
|
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
|
264
258
|
this.innerApiCalls[methodName] = apiCall;
|
265
259
|
}
|
@@ -271,8 +265,7 @@ class ChunkServiceClient {
|
|
271
265
|
* @returns {string} The DNS address for this service.
|
272
266
|
*/
|
273
267
|
static get servicePath() {
|
274
|
-
if (typeof process === 'object' &&
|
275
|
-
typeof process.emitWarning === 'function') {
|
268
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
276
269
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
277
270
|
}
|
278
271
|
return 'discoveryengine.googleapis.com';
|
@@ -283,8 +276,7 @@ class ChunkServiceClient {
|
|
283
276
|
* @returns {string} The DNS address for this service.
|
284
277
|
*/
|
285
278
|
static get apiEndpoint() {
|
286
|
-
if (typeof process === 'object' &&
|
287
|
-
typeof process.emitWarning === 'function') {
|
279
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
288
280
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
289
281
|
}
|
290
282
|
return 'discoveryengine.googleapis.com';
|
@@ -312,7 +304,9 @@ class ChunkServiceClient {
|
|
312
304
|
* @returns {string[]} List of default scopes.
|
313
305
|
*/
|
314
306
|
static get scopes() {
|
315
|
-
return [
|
307
|
+
return [
|
308
|
+
'https://www.googleapis.com/auth/cloud-platform'
|
309
|
+
];
|
316
310
|
}
|
317
311
|
/**
|
318
312
|
* Return the project ID used by this class.
|
@@ -338,13 +332,10 @@ class ChunkServiceClient {
|
|
338
332
|
options = options || {};
|
339
333
|
options.otherArgs = options.otherArgs || {};
|
340
334
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
341
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
342
|
-
|
343
|
-
name: request.name ?? '',
|
344
|
-
});
|
345
|
-
this.initialize().catch(err => {
|
346
|
-
throw err;
|
335
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
336
|
+
'name': request.name ?? '',
|
347
337
|
});
|
338
|
+
this.initialize().catch(err => { throw err; });
|
348
339
|
this._log.info('getChunk request %j', request);
|
349
340
|
const wrappedCallback = callback
|
350
341
|
? (error, response, options, rawResponse) => {
|
@@ -352,11 +343,16 @@ class ChunkServiceClient {
|
|
352
343
|
callback(error, response, options, rawResponse); // We verified callback above.
|
353
344
|
}
|
354
345
|
: undefined;
|
355
|
-
return this.innerApiCalls
|
356
|
-
.getChunk(request, options, wrappedCallback)
|
346
|
+
return this.innerApiCalls.getChunk(request, options, wrappedCallback)
|
357
347
|
?.then(([response, options, rawResponse]) => {
|
358
348
|
this._log.info('getChunk response %j', response);
|
359
349
|
return [response, options, rawResponse];
|
350
|
+
}).catch((error) => {
|
351
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
352
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
353
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
354
|
+
}
|
355
|
+
throw error;
|
360
356
|
});
|
361
357
|
}
|
362
358
|
listChunks(request, optionsOrCallback, callback) {
|
@@ -372,13 +368,10 @@ class ChunkServiceClient {
|
|
372
368
|
options = options || {};
|
373
369
|
options.otherArgs = options.otherArgs || {};
|
374
370
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
375
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
376
|
-
|
377
|
-
parent: request.parent ?? '',
|
378
|
-
});
|
379
|
-
this.initialize().catch(err => {
|
380
|
-
throw err;
|
371
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
372
|
+
'parent': request.parent ?? '',
|
381
373
|
});
|
374
|
+
this.initialize().catch(err => { throw err; });
|
382
375
|
const wrappedCallback = callback
|
383
376
|
? (error, values, nextPageRequest, rawResponse) => {
|
384
377
|
this._log.info('listChunks values %j', values);
|
@@ -438,15 +431,12 @@ class ChunkServiceClient {
|
|
438
431
|
options = options || {};
|
439
432
|
options.otherArgs = options.otherArgs || {};
|
440
433
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
441
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
442
|
-
|
443
|
-
|
444
|
-
});
|
434
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
435
|
+
'parent': request.parent ?? '',
|
436
|
+
});
|
445
437
|
const defaultCallSettings = this._defaults['listChunks'];
|
446
438
|
const callSettings = defaultCallSettings.merge(options);
|
447
|
-
this.initialize().catch(err => {
|
448
|
-
throw err;
|
449
|
-
});
|
439
|
+
this.initialize().catch(err => { throw err; });
|
450
440
|
this._log.info('listChunks stream %j', request);
|
451
441
|
return this.descriptors.page.listChunks.createStream(this.innerApiCalls.listChunks, request, callSettings);
|
452
442
|
}
|
@@ -498,70 +488,67 @@ class ChunkServiceClient {
|
|
498
488
|
options = options || {};
|
499
489
|
options.otherArgs = options.otherArgs || {};
|
500
490
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
501
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
502
|
-
|
503
|
-
|
504
|
-
});
|
491
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
492
|
+
'parent': request.parent ?? '',
|
493
|
+
});
|
505
494
|
const defaultCallSettings = this._defaults['listChunks'];
|
506
495
|
const callSettings = defaultCallSettings.merge(options);
|
507
|
-
this.initialize().catch(err => {
|
508
|
-
throw err;
|
509
|
-
});
|
496
|
+
this.initialize().catch(err => { throw err; });
|
510
497
|
this._log.info('listChunks iterate %j', request);
|
511
498
|
return this.descriptors.page.listChunks.asyncIterate(this.innerApiCalls['listChunks'], request, callSettings);
|
512
499
|
}
|
513
500
|
/**
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
501
|
+
* Gets information about a location.
|
502
|
+
*
|
503
|
+
* @param {Object} request
|
504
|
+
* The request object that will be sent.
|
505
|
+
* @param {string} request.name
|
506
|
+
* Resource name for the location.
|
507
|
+
* @param {object} [options]
|
508
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
509
|
+
* @returns {Promise} - The promise which resolves to an array.
|
510
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
511
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
512
|
+
* for more details and examples.
|
513
|
+
* @example
|
514
|
+
* ```
|
515
|
+
* const [response] = await client.getLocation(request);
|
516
|
+
* ```
|
517
|
+
*/
|
531
518
|
getLocation(request, options, callback) {
|
532
519
|
return this.locationsClient.getLocation(request, options, callback);
|
533
520
|
}
|
534
521
|
/**
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
522
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
523
|
+
*
|
524
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
525
|
+
* @param {Object} request
|
526
|
+
* The request object that will be sent.
|
527
|
+
* @param {string} request.name
|
528
|
+
* The resource that owns the locations collection, if applicable.
|
529
|
+
* @param {string} request.filter
|
530
|
+
* The standard list filter.
|
531
|
+
* @param {number} request.pageSize
|
532
|
+
* The standard list page size.
|
533
|
+
* @param {string} request.pageToken
|
534
|
+
* The standard list page token.
|
535
|
+
* @param {object} [options]
|
536
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
537
|
+
* @returns {Object}
|
538
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
539
|
+
* When you iterate the returned iterable, each element will be an object representing
|
540
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
541
|
+
* so you can stop the iteration when you don't need more results.
|
542
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
543
|
+
* for more details and examples.
|
544
|
+
* @example
|
545
|
+
* ```
|
546
|
+
* const iterable = client.listLocationsAsync(request);
|
547
|
+
* for await (const response of iterable) {
|
548
|
+
* // process response
|
549
|
+
* }
|
550
|
+
* ```
|
551
|
+
*/
|
565
552
|
listLocationsAsync(request, options) {
|
566
553
|
return this.locationsClient.listLocationsAsync(request, options);
|
567
554
|
}
|
@@ -589,8 +576,7 @@ class ChunkServiceClient {
|
|
589
576
|
* @returns {string} A string representing the project.
|
590
577
|
*/
|
591
578
|
matchProjectFromAclConfigName(aclConfigName) {
|
592
|
-
return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
|
593
|
-
.project;
|
579
|
+
return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).project;
|
594
580
|
}
|
595
581
|
/**
|
596
582
|
* Parse the location from AclConfig resource.
|
@@ -600,8 +586,7 @@ class ChunkServiceClient {
|
|
600
586
|
* @returns {string} A string representing the location.
|
601
587
|
*/
|
602
588
|
matchLocationFromAclConfigName(aclConfigName) {
|
603
|
-
return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
|
604
|
-
.location;
|
589
|
+
return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).location;
|
605
590
|
}
|
606
591
|
/**
|
607
592
|
* Return a fully-qualified engine resource name string.
|
@@ -683,8 +668,7 @@ class ChunkServiceClient {
|
|
683
668
|
* @returns {string} A string representing the project.
|
684
669
|
*/
|
685
670
|
matchProjectFromEvaluationName(evaluationName) {
|
686
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
687
|
-
.project;
|
671
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
|
688
672
|
}
|
689
673
|
/**
|
690
674
|
* Parse the location from Evaluation resource.
|
@@ -694,8 +678,7 @@ class ChunkServiceClient {
|
|
694
678
|
* @returns {string} A string representing the location.
|
695
679
|
*/
|
696
680
|
matchLocationFromEvaluationName(evaluationName) {
|
697
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
698
|
-
.location;
|
681
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
|
699
682
|
}
|
700
683
|
/**
|
701
684
|
* Parse the evaluation from Evaluation resource.
|
@@ -705,8 +688,7 @@ class ChunkServiceClient {
|
|
705
688
|
* @returns {string} A string representing the evaluation.
|
706
689
|
*/
|
707
690
|
matchEvaluationFromEvaluationName(evaluationName) {
|
708
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
709
|
-
.evaluation;
|
691
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
|
710
692
|
}
|
711
693
|
/**
|
712
694
|
* Return a fully-qualified project resource name string.
|
@@ -2773,8 +2755,7 @@ class ChunkServiceClient {
|
|
2773
2755
|
* @returns {string} A string representing the project.
|
2774
2756
|
*/
|
2775
2757
|
matchProjectFromSampleQueryName(sampleQueryName) {
|
2776
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2777
|
-
.project;
|
2758
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
|
2778
2759
|
}
|
2779
2760
|
/**
|
2780
2761
|
* Parse the location from SampleQuery resource.
|
@@ -2784,8 +2765,7 @@ class ChunkServiceClient {
|
|
2784
2765
|
* @returns {string} A string representing the location.
|
2785
2766
|
*/
|
2786
2767
|
matchLocationFromSampleQueryName(sampleQueryName) {
|
2787
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2788
|
-
.location;
|
2768
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
|
2789
2769
|
}
|
2790
2770
|
/**
|
2791
2771
|
* Parse the sample_query_set from SampleQuery resource.
|
@@ -2795,8 +2775,7 @@ class ChunkServiceClient {
|
|
2795
2775
|
* @returns {string} A string representing the sample_query_set.
|
2796
2776
|
*/
|
2797
2777
|
matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
|
2798
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2799
|
-
.sample_query_set;
|
2778
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
|
2800
2779
|
}
|
2801
2780
|
/**
|
2802
2781
|
* Parse the sample_query from SampleQuery resource.
|
@@ -2806,8 +2785,7 @@ class ChunkServiceClient {
|
|
2806
2785
|
* @returns {string} A string representing the sample_query.
|
2807
2786
|
*/
|
2808
2787
|
matchSampleQueryFromSampleQueryName(sampleQueryName) {
|
2809
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2810
|
-
.sample_query;
|
2788
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
|
2811
2789
|
}
|
2812
2790
|
/**
|
2813
2791
|
* Return a fully-qualified sampleQuerySet resource name string.
|
@@ -2866,7 +2844,7 @@ class ChunkServiceClient {
|
|
2866
2844
|
this._log.info('ending gRPC channel');
|
2867
2845
|
this._terminated = true;
|
2868
2846
|
stub.close();
|
2869
|
-
this.locationsClient.close();
|
2847
|
+
this.locationsClient.close().catch(err => { throw err; });
|
2870
2848
|
});
|
2871
2849
|
}
|
2872
2850
|
return Promise.resolve();
|