@google-cloud/discoveryengine 2.1.0 → 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.
Files changed (121) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/protos/protos.d.ts +31 -316
  3. package/build/protos/protos.js +146 -593
  4. package/build/protos/protos.json +25 -1
  5. package/build/src/index.d.ts +1 -1
  6. package/build/src/index.js +1 -21
  7. package/build/src/v1/completion_service_client.d.ts +76 -76
  8. package/build/src/v1/completion_service_client.js +125 -262
  9. package/build/src/v1/control_service_client.d.ts +81 -81
  10. package/build/src/v1/control_service_client.js +96 -132
  11. package/build/src/v1/conversational_search_service_client.d.ts +143 -143
  12. package/build/src/v1/conversational_search_service_client.js +138 -226
  13. package/build/src/v1/data_store_service_client.d.ts +122 -122
  14. package/build/src/v1/data_store_service_client.js +134 -280
  15. package/build/src/v1/document_service_client.d.ts +120 -120
  16. package/build/src/v1/document_service_client.js +143 -300
  17. package/build/src/v1/engine_service_client.d.ts +103 -103
  18. package/build/src/v1/engine_service_client.js +134 -279
  19. package/build/src/v1/grounded_generation_service_client.d.ts +48 -48
  20. package/build/src/v1/grounded_generation_service_client.js +79 -100
  21. package/build/src/v1/project_service_client.d.ts +76 -76
  22. package/build/src/v1/project_service_client.js +108 -222
  23. package/build/src/v1/rank_service_client.d.ts +47 -47
  24. package/build/src/v1/rank_service_client.js +72 -85
  25. package/build/src/v1/recommendation_service_client.d.ts +47 -47
  26. package/build/src/v1/recommendation_service_client.js +70 -82
  27. package/build/src/v1/schema_service_client.d.ts +111 -111
  28. package/build/src/v1/schema_service_client.js +131 -273
  29. package/build/src/v1/search_service_client.d.ts +545 -545
  30. package/build/src/v1/search_service_client.js +90 -113
  31. package/build/src/v1/search_tuning_service_client.d.ts +77 -77
  32. package/build/src/v1/search_tuning_service_client.js +113 -235
  33. package/build/src/v1/serving_config_service_client.d.ts +48 -48
  34. package/build/src/v1/serving_config_service_client.js +69 -80
  35. package/build/src/v1/site_search_engine_service_client.d.ts +148 -148
  36. package/build/src/v1/site_search_engine_service_client.js +179 -378
  37. package/build/src/v1/user_event_service_client.d.ts +77 -77
  38. package/build/src/v1/user_event_service_client.js +121 -253
  39. package/build/src/v1alpha/acl_config_service_client.d.ts +49 -49
  40. package/build/src/v1alpha/acl_config_service_client.js +82 -106
  41. package/build/src/v1alpha/chunk_service_client.d.ts +88 -88
  42. package/build/src/v1alpha/chunk_service_client.js +92 -120
  43. package/build/src/v1alpha/completion_service_client.d.ts +77 -77
  44. package/build/src/v1alpha/completion_service_client.js +134 -280
  45. package/build/src/v1alpha/control_service_client.d.ts +85 -85
  46. package/build/src/v1alpha/control_service_client.js +105 -151
  47. package/build/src/v1alpha/conversational_search_service_client.d.ts +143 -143
  48. package/build/src/v1alpha/conversational_search_service_client.js +145 -237
  49. package/build/src/v1alpha/data_store_service_client.d.ts +126 -126
  50. package/build/src/v1alpha/data_store_service_client.js +151 -316
  51. package/build/src/v1alpha/document_service_client.d.ts +126 -126
  52. package/build/src/v1alpha/document_service_client.js +156 -328
  53. package/build/src/v1alpha/engine_service_client.d.ts +106 -106
  54. package/build/src/v1alpha/engine_service_client.js +155 -325
  55. package/build/src/v1alpha/estimate_billing_service_client.d.ts +76 -76
  56. package/build/src/v1alpha/estimate_billing_service_client.js +118 -243
  57. package/build/src/v1alpha/evaluation_service_client.d.ts +161 -161
  58. package/build/src/v1alpha/evaluation_service_client.js +143 -295
  59. package/build/src/v1alpha/grounded_generation_service_client.d.ts +48 -48
  60. package/build/src/v1alpha/grounded_generation_service_client.js +79 -100
  61. package/build/src/v1alpha/project_service_client.d.ts +78 -78
  62. package/build/src/v1alpha/project_service_client.js +126 -262
  63. package/build/src/v1alpha/rank_service_client.d.ts +47 -47
  64. package/build/src/v1alpha/rank_service_client.js +81 -104
  65. package/build/src/v1alpha/recommendation_service_client.d.ts +47 -47
  66. package/build/src/v1alpha/recommendation_service_client.js +79 -100
  67. package/build/src/v1alpha/sample_query_service_client.d.ts +123 -123
  68. package/build/src/v1alpha/sample_query_service_client.js +144 -301
  69. package/build/src/v1alpha/sample_query_set_service_client.d.ts +94 -94
  70. package/build/src/v1alpha/sample_query_set_service_client.js +106 -153
  71. package/build/src/v1alpha/schema_service_client.d.ts +112 -112
  72. package/build/src/v1alpha/schema_service_client.js +140 -292
  73. package/build/src/v1alpha/search_service_client.d.ts +327 -327
  74. package/build/src/v1alpha/search_service_client.js +88 -112
  75. package/build/src/v1alpha/search_tuning_service_client.d.ts +77 -77
  76. package/build/src/v1alpha/search_tuning_service_client.js +122 -253
  77. package/build/src/v1alpha/serving_config_service_client.d.ts +75 -75
  78. package/build/src/v1alpha/serving_config_service_client.js +97 -133
  79. package/build/src/v1alpha/site_search_engine_service_client.d.ts +151 -151
  80. package/build/src/v1alpha/site_search_engine_service_client.js +184 -387
  81. package/build/src/v1alpha/user_event_service_client.d.ts +78 -78
  82. package/build/src/v1alpha/user_event_service_client.js +130 -271
  83. package/build/src/v1beta/completion_service_client.d.ts +78 -78
  84. package/build/src/v1beta/completion_service_client.js +136 -279
  85. package/build/src/v1beta/control_service_client.d.ts +84 -84
  86. package/build/src/v1beta/control_service_client.js +103 -147
  87. package/build/src/v1beta/conversational_search_service_client.d.ts +142 -142
  88. package/build/src/v1beta/conversational_search_service_client.js +143 -233
  89. package/build/src/v1beta/data_store_service_client.d.ts +124 -124
  90. package/build/src/v1beta/data_store_service_client.js +141 -288
  91. package/build/src/v1beta/document_service_client.d.ts +124 -124
  92. package/build/src/v1beta/document_service_client.js +150 -309
  93. package/build/src/v1beta/engine_service_client.d.ts +106 -106
  94. package/build/src/v1beta/engine_service_client.js +153 -315
  95. package/build/src/v1beta/evaluation_service_client.d.ts +161 -161
  96. package/build/src/v1beta/evaluation_service_client.js +141 -285
  97. package/build/src/v1beta/grounded_generation_service_client.d.ts +49 -49
  98. package/build/src/v1beta/grounded_generation_service_client.js +86 -114
  99. package/build/src/v1beta/project_service_client.d.ts +76 -76
  100. package/build/src/v1beta/project_service_client.js +115 -231
  101. package/build/src/v1beta/rank_service_client.d.ts +47 -47
  102. package/build/src/v1beta/rank_service_client.js +79 -99
  103. package/build/src/v1beta/recommendation_service_client.d.ts +47 -47
  104. package/build/src/v1beta/recommendation_service_client.js +77 -96
  105. package/build/src/v1beta/sample_query_service_client.d.ts +123 -123
  106. package/build/src/v1beta/sample_query_service_client.js +142 -291
  107. package/build/src/v1beta/sample_query_set_service_client.d.ts +94 -94
  108. package/build/src/v1beta/sample_query_set_service_client.js +104 -149
  109. package/build/src/v1beta/schema_service_client.d.ts +111 -111
  110. package/build/src/v1beta/schema_service_client.js +138 -282
  111. package/build/src/v1beta/search_service_client.d.ts +665 -665
  112. package/build/src/v1beta/search_service_client.js +97 -128
  113. package/build/src/v1beta/search_tuning_service_client.d.ts +77 -77
  114. package/build/src/v1beta/search_tuning_service_client.js +120 -243
  115. package/build/src/v1beta/serving_config_service_client.d.ts +75 -75
  116. package/build/src/v1beta/serving_config_service_client.js +95 -129
  117. package/build/src/v1beta/site_search_engine_service_client.d.ts +151 -151
  118. package/build/src/v1beta/site_search_engine_service_client.js +186 -386
  119. package/build/src/v1beta/user_event_service_client.d.ts +78 -78
  120. package/build/src/v1beta/user_event_service_client.js +128 -261
  121. package/package.json +1 -1
@@ -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
- * 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
- */
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
- * 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
- */
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
- * 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
- */
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
- ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
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 = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
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
- ? this._protos.lookupService('google.cloud.discoveryengine.v1alpha.ChunkService')
246
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
247
- this._protos.google.cloud.discoveryengine.v1alpha
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] || undefined;
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 ['https://www.googleapis.com/auth/cloud-platform'];
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
- this._gaxModule.routingHeader.fromParams({
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
- this._gaxModule.routingHeader.fromParams({
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
- this._gaxModule.routingHeader.fromParams({
443
- parent: request.parent ?? '',
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
- this._gaxModule.routingHeader.fromParams({
503
- parent: request.parent ?? '',
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
- * Gets information about a location.
515
- *
516
- * @param {Object} request
517
- * The request object that will be sent.
518
- * @param {string} request.name
519
- * Resource name for the location.
520
- * @param {object} [options]
521
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
522
- * @returns {Promise} - The promise which resolves to an array.
523
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
524
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
525
- * for more details and examples.
526
- * @example
527
- * ```
528
- * const [response] = await client.getLocation(request);
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
- * Lists information about the supported locations for this service. Returns an iterable object.
536
- *
537
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
538
- * @param {Object} request
539
- * The request object that will be sent.
540
- * @param {string} request.name
541
- * The resource that owns the locations collection, if applicable.
542
- * @param {string} request.filter
543
- * The standard list filter.
544
- * @param {number} request.pageSize
545
- * The standard list page size.
546
- * @param {string} request.pageToken
547
- * The standard list page token.
548
- * @param {object} [options]
549
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
550
- * @returns {Object}
551
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
552
- * When you iterate the returned iterable, each element will be an object representing
553
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
554
- * so you can stop the iteration when you don't need more results.
555
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
556
- * for more details and examples.
557
- * @example
558
- * ```
559
- * const iterable = client.listLocationsAsync(request);
560
- * for await (const response of iterable) {
561
- * // process response
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();