@google-cloud/discoveryengine 2.0.1 → 2.2.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 +14 -0
- package/README.md +7 -2
- package/build/protos/google/cloud/discoveryengine/v1/answer.proto +54 -2
- package/build/protos/google/cloud/discoveryengine/v1/chunk.proto +2 -1
- package/build/protos/google/cloud/discoveryengine/v1/common.proto +35 -6
- package/build/protos/google/cloud/discoveryengine/v1/control.proto +113 -2
- package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +168 -2
- package/build/protos/google/cloud/discoveryengine/v1/data_store.proto +23 -4
- package/build/protos/google/cloud/discoveryengine/v1/document.proto +7 -2
- package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +1 -1
- package/build/protos/google/cloud/discoveryengine/v1/engine.proto +16 -3
- package/build/protos/google/cloud/discoveryengine/v1/grounded_generation_service.proto +70 -9
- package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +20 -1
- package/build/protos/google/cloud/discoveryengine/v1/purge_config.proto +9 -5
- package/build/protos/google/cloud/discoveryengine/v1/rank_service.proto +3 -1
- package/build/protos/google/cloud/discoveryengine/v1/recommendation_service.proto +2 -2
- package/build/protos/google/cloud/discoveryengine/v1/safety.proto +107 -0
- package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +96 -8
- package/build/protos/google/cloud/discoveryengine/v1/serving_config.proto +271 -0
- package/build/protos/google/cloud/discoveryengine/v1/serving_config_service.proto +75 -0
- package/build/protos/google/cloud/discoveryengine/v1/session.proto +19 -0
- package/build/protos/google/cloud/discoveryengine/v1/site_search_engine.proto +27 -3
- package/build/protos/google/cloud/discoveryengine/v1/site_search_engine_service.proto +184 -5
- package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +34 -0
- package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +16 -4
- package/build/protos/protos.d.ts +4390 -300
- package/build/protos/protos.js +13785 -2922
- package/build/protos/protos.json +1355 -14
- package/build/src/index.d.ts +4 -1
- package/build/src/index.js +4 -21
- package/build/src/v1/completion_service_client.d.ts +313 -76
- package/build/src/v1/completion_service_client.js +451 -262
- package/build/src/v1/completion_service_proto_list.json +3 -0
- package/build/src/v1/control_service_client.d.ts +318 -81
- package/build/src/v1/control_service_client.js +422 -132
- package/build/src/v1/control_service_proto_list.json +3 -0
- package/build/src/v1/conversational_search_service_client.d.ts +341 -134
- package/build/src/v1/conversational_search_service_client.js +395 -223
- package/build/src/v1/conversational_search_service_client_config.json +5 -0
- package/build/src/v1/conversational_search_service_proto_list.json +3 -0
- package/build/src/v1/data_store_service_client.d.ts +359 -122
- package/build/src/v1/data_store_service_client.js +460 -280
- package/build/src/v1/data_store_service_proto_list.json +3 -0
- package/build/src/v1/document_service_client.d.ts +364 -121
- package/build/src/v1/document_service_client.js +469 -300
- package/build/src/v1/document_service_proto_list.json +3 -0
- package/build/src/v1/engine_service_client.d.ts +340 -103
- package/build/src/v1/engine_service_client.js +460 -279
- package/build/src/v1/engine_service_proto_list.json +3 -0
- package/build/src/v1/gapic_metadata.json +59 -0
- package/build/src/v1/grounded_generation_service_client.d.ts +286 -51
- package/build/src/v1/grounded_generation_service_client.js +405 -100
- package/build/src/v1/grounded_generation_service_proto_list.json +3 -0
- package/build/src/v1/index.d.ts +1 -0
- package/build/src/v1/index.js +3 -1
- package/build/src/v1/project_service_client.d.ts +313 -76
- package/build/src/v1/project_service_client.js +434 -222
- package/build/src/v1/project_service_proto_list.json +3 -0
- package/build/src/v1/rank_service_client.d.ts +285 -48
- package/build/src/v1/rank_service_client.js +398 -85
- package/build/src/v1/rank_service_proto_list.json +3 -0
- package/build/src/v1/recommendation_service_client.d.ts +142 -49
- package/build/src/v1/recommendation_service_client.js +198 -82
- package/build/src/v1/recommendation_service_proto_list.json +3 -0
- package/build/src/v1/schema_service_client.d.ts +348 -111
- package/build/src/v1/schema_service_client.js +457 -273
- package/build/src/v1/schema_service_proto_list.json +3 -0
- package/build/src/v1/search_service_client.d.ts +748 -559
- package/build/src/v1/search_service_client.js +302 -133
- package/build/src/v1/search_service_proto_list.json +3 -0
- package/build/src/v1/search_tuning_service_client.d.ts +314 -77
- package/build/src/v1/search_tuning_service_client.js +439 -235
- package/build/src/v1/search_tuning_service_proto_list.json +3 -0
- package/build/src/v1/serving_config_service_client.d.ts +1851 -0
- package/build/src/v1/serving_config_service_client.js +2642 -0
- package/build/src/v1/serving_config_service_client_config.json +30 -0
- package/build/src/v1/serving_config_service_proto_list.json +39 -0
- package/build/src/v1/site_search_engine_service_client.d.ts +504 -151
- package/build/src/v1/site_search_engine_service_client.js +625 -351
- package/build/src/v1/site_search_engine_service_client_config.json +12 -0
- package/build/src/v1/site_search_engine_service_proto_list.json +3 -0
- package/build/src/v1/user_event_service_client.d.ts +335 -86
- package/build/src/v1/user_event_service_client.js +447 -253
- package/build/src/v1/user_event_service_proto_list.json +3 -0
- package/build/src/v1alpha/acl_config_service_client.d.ts +49 -49
- package/build/src/v1alpha/acl_config_service_client.js +82 -106
- package/build/src/v1alpha/chunk_service_client.d.ts +88 -88
- package/build/src/v1alpha/chunk_service_client.js +92 -120
- package/build/src/v1alpha/completion_service_client.d.ts +77 -77
- package/build/src/v1alpha/completion_service_client.js +134 -280
- package/build/src/v1alpha/control_service_client.d.ts +85 -85
- package/build/src/v1alpha/control_service_client.js +105 -151
- package/build/src/v1alpha/conversational_search_service_client.d.ts +143 -143
- package/build/src/v1alpha/conversational_search_service_client.js +145 -237
- package/build/src/v1alpha/data_store_service_client.d.ts +126 -126
- package/build/src/v1alpha/data_store_service_client.js +151 -316
- package/build/src/v1alpha/document_service_client.d.ts +126 -126
- package/build/src/v1alpha/document_service_client.js +156 -328
- package/build/src/v1alpha/engine_service_client.d.ts +106 -106
- package/build/src/v1alpha/engine_service_client.js +155 -325
- package/build/src/v1alpha/estimate_billing_service_client.d.ts +76 -76
- package/build/src/v1alpha/estimate_billing_service_client.js +118 -243
- package/build/src/v1alpha/evaluation_service_client.d.ts +161 -161
- package/build/src/v1alpha/evaluation_service_client.js +143 -295
- package/build/src/v1alpha/grounded_generation_service_client.d.ts +48 -48
- package/build/src/v1alpha/grounded_generation_service_client.js +79 -100
- package/build/src/v1alpha/project_service_client.d.ts +78 -78
- package/build/src/v1alpha/project_service_client.js +126 -262
- package/build/src/v1alpha/rank_service_client.d.ts +47 -47
- package/build/src/v1alpha/rank_service_client.js +81 -104
- package/build/src/v1alpha/recommendation_service_client.d.ts +47 -47
- package/build/src/v1alpha/recommendation_service_client.js +79 -100
- package/build/src/v1alpha/sample_query_service_client.d.ts +123 -123
- package/build/src/v1alpha/sample_query_service_client.js +144 -301
- package/build/src/v1alpha/sample_query_set_service_client.d.ts +94 -94
- package/build/src/v1alpha/sample_query_set_service_client.js +106 -153
- package/build/src/v1alpha/schema_service_client.d.ts +112 -112
- package/build/src/v1alpha/schema_service_client.js +140 -292
- 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 +122 -253
- package/build/src/v1alpha/serving_config_service_client.d.ts +75 -75
- package/build/src/v1alpha/serving_config_service_client.js +97 -133
- package/build/src/v1alpha/site_search_engine_service_client.d.ts +151 -151
- package/build/src/v1alpha/site_search_engine_service_client.js +184 -387
- package/build/src/v1alpha/user_event_service_client.d.ts +78 -78
- package/build/src/v1alpha/user_event_service_client.js +130 -271
- package/build/src/v1beta/completion_service_client.d.ts +78 -78
- package/build/src/v1beta/completion_service_client.js +136 -279
- package/build/src/v1beta/control_service_client.d.ts +84 -84
- package/build/src/v1beta/control_service_client.js +103 -147
- package/build/src/v1beta/conversational_search_service_client.d.ts +142 -142
- package/build/src/v1beta/conversational_search_service_client.js +143 -233
- package/build/src/v1beta/data_store_service_client.d.ts +124 -124
- package/build/src/v1beta/data_store_service_client.js +141 -288
- package/build/src/v1beta/document_service_client.d.ts +124 -124
- package/build/src/v1beta/document_service_client.js +150 -309
- package/build/src/v1beta/engine_service_client.d.ts +106 -106
- package/build/src/v1beta/engine_service_client.js +153 -315
- package/build/src/v1beta/evaluation_service_client.d.ts +161 -161
- package/build/src/v1beta/evaluation_service_client.js +141 -285
- package/build/src/v1beta/grounded_generation_service_client.d.ts +49 -49
- package/build/src/v1beta/grounded_generation_service_client.js +86 -114
- package/build/src/v1beta/project_service_client.d.ts +76 -76
- package/build/src/v1beta/project_service_client.js +115 -231
- package/build/src/v1beta/rank_service_client.d.ts +47 -47
- package/build/src/v1beta/rank_service_client.js +79 -99
- package/build/src/v1beta/recommendation_service_client.d.ts +47 -47
- package/build/src/v1beta/recommendation_service_client.js +77 -96
- package/build/src/v1beta/sample_query_service_client.d.ts +123 -123
- package/build/src/v1beta/sample_query_service_client.js +142 -291
- package/build/src/v1beta/sample_query_set_service_client.d.ts +94 -94
- package/build/src/v1beta/sample_query_set_service_client.js +104 -149
- package/build/src/v1beta/schema_service_client.d.ts +111 -111
- package/build/src/v1beta/schema_service_client.js +138 -282
- 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 +120 -243
- package/build/src/v1beta/serving_config_service_client.d.ts +75 -75
- package/build/src/v1beta/serving_config_service_client.js +95 -129
- package/build/src/v1beta/site_search_engine_service_client.d.ts +151 -151
- package/build/src/v1beta/site_search_engine_service_client.js +186 -386
- package/build/src/v1beta/user_event_service_client.d.ts +78 -78
- package/build/src/v1beta/user_event_service_client.js +128 -261
- package/package.json +4 -4
@@ -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,8 +343,7 @@ 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];
|
@@ -372,13 +362,10 @@ class ChunkServiceClient {
|
|
372
362
|
options = options || {};
|
373
363
|
options.otherArgs = options.otherArgs || {};
|
374
364
|
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;
|
365
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
366
|
+
'parent': request.parent ?? '',
|
381
367
|
});
|
368
|
+
this.initialize().catch(err => { throw err; });
|
382
369
|
const wrappedCallback = callback
|
383
370
|
? (error, values, nextPageRequest, rawResponse) => {
|
384
371
|
this._log.info('listChunks values %j', values);
|
@@ -438,15 +425,12 @@ class ChunkServiceClient {
|
|
438
425
|
options = options || {};
|
439
426
|
options.otherArgs = options.otherArgs || {};
|
440
427
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
441
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
442
|
-
|
443
|
-
|
444
|
-
});
|
428
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
429
|
+
'parent': request.parent ?? '',
|
430
|
+
});
|
445
431
|
const defaultCallSettings = this._defaults['listChunks'];
|
446
432
|
const callSettings = defaultCallSettings.merge(options);
|
447
|
-
this.initialize().catch(err => {
|
448
|
-
throw err;
|
449
|
-
});
|
433
|
+
this.initialize().catch(err => { throw err; });
|
450
434
|
this._log.info('listChunks stream %j', request);
|
451
435
|
return this.descriptors.page.listChunks.createStream(this.innerApiCalls.listChunks, request, callSettings);
|
452
436
|
}
|
@@ -498,70 +482,67 @@ class ChunkServiceClient {
|
|
498
482
|
options = options || {};
|
499
483
|
options.otherArgs = options.otherArgs || {};
|
500
484
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
501
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
502
|
-
|
503
|
-
|
504
|
-
});
|
485
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
486
|
+
'parent': request.parent ?? '',
|
487
|
+
});
|
505
488
|
const defaultCallSettings = this._defaults['listChunks'];
|
506
489
|
const callSettings = defaultCallSettings.merge(options);
|
507
|
-
this.initialize().catch(err => {
|
508
|
-
throw err;
|
509
|
-
});
|
490
|
+
this.initialize().catch(err => { throw err; });
|
510
491
|
this._log.info('listChunks iterate %j', request);
|
511
492
|
return this.descriptors.page.listChunks.asyncIterate(this.innerApiCalls['listChunks'], request, callSettings);
|
512
493
|
}
|
513
494
|
/**
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
495
|
+
* Gets information about a location.
|
496
|
+
*
|
497
|
+
* @param {Object} request
|
498
|
+
* The request object that will be sent.
|
499
|
+
* @param {string} request.name
|
500
|
+
* Resource name for the location.
|
501
|
+
* @param {object} [options]
|
502
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
|
503
|
+
* @returns {Promise} - The promise which resolves to an array.
|
504
|
+
* The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
|
505
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
506
|
+
* for more details and examples.
|
507
|
+
* @example
|
508
|
+
* ```
|
509
|
+
* const [response] = await client.getLocation(request);
|
510
|
+
* ```
|
511
|
+
*/
|
531
512
|
getLocation(request, options, callback) {
|
532
513
|
return this.locationsClient.getLocation(request, options, callback);
|
533
514
|
}
|
534
515
|
/**
|
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
|
-
|
516
|
+
* Lists information about the supported locations for this service. Returns an iterable object.
|
517
|
+
*
|
518
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
519
|
+
* @param {Object} request
|
520
|
+
* The request object that will be sent.
|
521
|
+
* @param {string} request.name
|
522
|
+
* The resource that owns the locations collection, if applicable.
|
523
|
+
* @param {string} request.filter
|
524
|
+
* The standard list filter.
|
525
|
+
* @param {number} request.pageSize
|
526
|
+
* The standard list page size.
|
527
|
+
* @param {string} request.pageToken
|
528
|
+
* The standard list page token.
|
529
|
+
* @param {object} [options]
|
530
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
531
|
+
* @returns {Object}
|
532
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
533
|
+
* When you iterate the returned iterable, each element will be an object representing
|
534
|
+
* {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
|
535
|
+
* so you can stop the iteration when you don't need more results.
|
536
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
537
|
+
* for more details and examples.
|
538
|
+
* @example
|
539
|
+
* ```
|
540
|
+
* const iterable = client.listLocationsAsync(request);
|
541
|
+
* for await (const response of iterable) {
|
542
|
+
* // process response
|
543
|
+
* }
|
544
|
+
* ```
|
545
|
+
*/
|
565
546
|
listLocationsAsync(request, options) {
|
566
547
|
return this.locationsClient.listLocationsAsync(request, options);
|
567
548
|
}
|
@@ -589,8 +570,7 @@ class ChunkServiceClient {
|
|
589
570
|
* @returns {string} A string representing the project.
|
590
571
|
*/
|
591
572
|
matchProjectFromAclConfigName(aclConfigName) {
|
592
|
-
return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
|
593
|
-
.project;
|
573
|
+
return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).project;
|
594
574
|
}
|
595
575
|
/**
|
596
576
|
* Parse the location from AclConfig resource.
|
@@ -600,8 +580,7 @@ class ChunkServiceClient {
|
|
600
580
|
* @returns {string} A string representing the location.
|
601
581
|
*/
|
602
582
|
matchLocationFromAclConfigName(aclConfigName) {
|
603
|
-
return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
|
604
|
-
.location;
|
583
|
+
return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).location;
|
605
584
|
}
|
606
585
|
/**
|
607
586
|
* Return a fully-qualified engine resource name string.
|
@@ -683,8 +662,7 @@ class ChunkServiceClient {
|
|
683
662
|
* @returns {string} A string representing the project.
|
684
663
|
*/
|
685
664
|
matchProjectFromEvaluationName(evaluationName) {
|
686
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
687
|
-
.project;
|
665
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
|
688
666
|
}
|
689
667
|
/**
|
690
668
|
* Parse the location from Evaluation resource.
|
@@ -694,8 +672,7 @@ class ChunkServiceClient {
|
|
694
672
|
* @returns {string} A string representing the location.
|
695
673
|
*/
|
696
674
|
matchLocationFromEvaluationName(evaluationName) {
|
697
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
698
|
-
.location;
|
675
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
|
699
676
|
}
|
700
677
|
/**
|
701
678
|
* Parse the evaluation from Evaluation resource.
|
@@ -705,8 +682,7 @@ class ChunkServiceClient {
|
|
705
682
|
* @returns {string} A string representing the evaluation.
|
706
683
|
*/
|
707
684
|
matchEvaluationFromEvaluationName(evaluationName) {
|
708
|
-
return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
|
709
|
-
.evaluation;
|
685
|
+
return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
|
710
686
|
}
|
711
687
|
/**
|
712
688
|
* Return a fully-qualified project resource name string.
|
@@ -2773,8 +2749,7 @@ class ChunkServiceClient {
|
|
2773
2749
|
* @returns {string} A string representing the project.
|
2774
2750
|
*/
|
2775
2751
|
matchProjectFromSampleQueryName(sampleQueryName) {
|
2776
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2777
|
-
.project;
|
2752
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
|
2778
2753
|
}
|
2779
2754
|
/**
|
2780
2755
|
* Parse the location from SampleQuery resource.
|
@@ -2784,8 +2759,7 @@ class ChunkServiceClient {
|
|
2784
2759
|
* @returns {string} A string representing the location.
|
2785
2760
|
*/
|
2786
2761
|
matchLocationFromSampleQueryName(sampleQueryName) {
|
2787
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2788
|
-
.location;
|
2762
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
|
2789
2763
|
}
|
2790
2764
|
/**
|
2791
2765
|
* Parse the sample_query_set from SampleQuery resource.
|
@@ -2795,8 +2769,7 @@ class ChunkServiceClient {
|
|
2795
2769
|
* @returns {string} A string representing the sample_query_set.
|
2796
2770
|
*/
|
2797
2771
|
matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
|
2798
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2799
|
-
.sample_query_set;
|
2772
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
|
2800
2773
|
}
|
2801
2774
|
/**
|
2802
2775
|
* Parse the sample_query from SampleQuery resource.
|
@@ -2806,8 +2779,7 @@ class ChunkServiceClient {
|
|
2806
2779
|
* @returns {string} A string representing the sample_query.
|
2807
2780
|
*/
|
2808
2781
|
matchSampleQueryFromSampleQueryName(sampleQueryName) {
|
2809
|
-
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
|
2810
|
-
.sample_query;
|
2782
|
+
return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
|
2811
2783
|
}
|
2812
2784
|
/**
|
2813
2785
|
* Return a fully-qualified sampleQuerySet resource name string.
|
@@ -2866,7 +2838,7 @@ class ChunkServiceClient {
|
|
2866
2838
|
this._log.info('ending gRPC channel');
|
2867
2839
|
this._terminated = true;
|
2868
2840
|
stub.close();
|
2869
|
-
this.locationsClient.close();
|
2841
|
+
this.locationsClient.close().catch(err => { throw err; });
|
2870
2842
|
});
|
2871
2843
|
}
|
2872
2844
|
return Promise.resolve();
|