@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.
Files changed (172) hide show
  1. package/README.md +13 -0
  2. package/build/protos/google/cloud/discoveryengine/v1/answer.proto +17 -0
  3. package/build/protos/google/cloud/discoveryengine/v1/chunk.proto +52 -0
  4. package/build/protos/google/cloud/discoveryengine/v1/cmek_config_service.proto +300 -0
  5. package/build/protos/google/cloud/discoveryengine/v1/common.proto +67 -0
  6. package/build/protos/google/cloud/discoveryengine/v1/control.proto +1 -3
  7. package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +3 -0
  8. package/build/protos/google/cloud/discoveryengine/v1/data_store.proto +54 -2
  9. package/build/protos/google/cloud/discoveryengine/v1/data_store_service.proto +14 -0
  10. package/build/protos/google/cloud/discoveryengine/v1/document.proto +95 -4
  11. package/build/protos/google/cloud/discoveryengine/v1/document_processing_config.proto +28 -1
  12. package/build/protos/google/cloud/discoveryengine/v1/engine.proto +131 -6
  13. package/build/protos/google/cloud/discoveryengine/v1/grounded_generation_service.proto +8 -0
  14. package/build/protos/google/cloud/discoveryengine/v1/grounding.proto +9 -0
  15. package/build/protos/google/cloud/discoveryengine/v1/identity_mapping_store.proto +84 -0
  16. package/build/protos/google/cloud/discoveryengine/v1/identity_mapping_store_service.proto +375 -0
  17. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +6 -0
  18. package/build/protos/google/cloud/discoveryengine/v1/site_search_engine.proto +6 -0
  19. package/build/protos/google/cloud/discoveryengine/v1/user_license.proto +98 -0
  20. package/build/protos/google/cloud/discoveryengine/v1/user_license_service.proto +191 -0
  21. package/build/protos/protos.d.ts +5415 -578
  22. package/build/protos/protos.js +77830 -63391
  23. package/build/protos/protos.json +1537 -92
  24. package/build/src/index.d.ts +10 -1
  25. package/build/src/index.js +8 -22
  26. package/build/src/v1/cmek_config_service_client.d.ts +2287 -0
  27. package/build/src/v1/cmek_config_service_client.js +3274 -0
  28. package/build/src/v1/cmek_config_service_client_config.json +42 -0
  29. package/build/src/v1/cmek_config_service_proto_list.json +44 -0
  30. package/build/src/v1/completion_service_client.d.ts +166 -76
  31. package/build/src/v1/completion_service_client.js +258 -263
  32. package/build/src/v1/completion_service_proto_list.json +6 -1
  33. package/build/src/v1/control_service_client.d.ts +171 -81
  34. package/build/src/v1/control_service_client.js +246 -132
  35. package/build/src/v1/control_service_proto_list.json +6 -1
  36. package/build/src/v1/conversational_search_service_client.d.ts +233 -143
  37. package/build/src/v1/conversational_search_service_client.js +330 -226
  38. package/build/src/v1/conversational_search_service_proto_list.json +6 -1
  39. package/build/src/v1/data_store_service_client.d.ts +218 -122
  40. package/build/src/v1/data_store_service_client.js +273 -281
  41. package/build/src/v1/data_store_service_proto_list.json +6 -1
  42. package/build/src/v1/document_service_client.d.ts +210 -120
  43. package/build/src/v1/document_service_client.js +300 -301
  44. package/build/src/v1/document_service_proto_list.json +6 -1
  45. package/build/src/v1/engine_service_client.d.ts +193 -103
  46. package/build/src/v1/engine_service_client.js +273 -280
  47. package/build/src/v1/engine_service_proto_list.json +6 -1
  48. package/build/src/v1/gapic_metadata.json +184 -0
  49. package/build/src/v1/grounded_generation_service_client.d.ts +138 -48
  50. package/build/src/v1/grounded_generation_service_client.js +217 -100
  51. package/build/src/v1/grounded_generation_service_proto_list.json +6 -1
  52. package/build/src/v1/identity_mapping_store_service_client.d.ts +2470 -0
  53. package/build/src/v1/identity_mapping_store_service_client.js +3449 -0
  54. package/build/src/v1/identity_mapping_store_service_client_config.json +54 -0
  55. package/build/src/v1/identity_mapping_store_service_proto_list.json +44 -0
  56. package/build/src/v1/index.d.ts +3 -0
  57. package/build/src/v1/index.js +7 -1
  58. package/build/src/v1/project_service_client.d.ts +166 -76
  59. package/build/src/v1/project_service_client.js +235 -223
  60. package/build/src/v1/project_service_proto_list.json +6 -1
  61. package/build/src/v1/rank_service_client.d.ts +137 -47
  62. package/build/src/v1/rank_service_client.js +204 -85
  63. package/build/src/v1/rank_service_proto_list.json +6 -1
  64. package/build/src/v1/recommendation_service_client.d.ts +137 -47
  65. package/build/src/v1/recommendation_service_client.js +202 -82
  66. package/build/src/v1/recommendation_service_proto_list.json +6 -1
  67. package/build/src/v1/schema_service_client.d.ts +201 -111
  68. package/build/src/v1/schema_service_client.js +264 -274
  69. package/build/src/v1/schema_service_proto_list.json +6 -1
  70. package/build/src/v1/search_service_client.d.ts +661 -571
  71. package/build/src/v1/search_service_client.js +216 -113
  72. package/build/src/v1/search_service_proto_list.json +6 -1
  73. package/build/src/v1/search_tuning_service_client.d.ts +167 -77
  74. package/build/src/v1/search_tuning_service_client.js +246 -236
  75. package/build/src/v1/search_tuning_service_proto_list.json +6 -1
  76. package/build/src/v1/serving_config_service_client.d.ts +138 -48
  77. package/build/src/v1/serving_config_service_client.js +201 -80
  78. package/build/src/v1/serving_config_service_proto_list.json +6 -1
  79. package/build/src/v1/site_search_engine_service_client.d.ts +238 -148
  80. package/build/src/v1/site_search_engine_service_client.js +324 -379
  81. package/build/src/v1/site_search_engine_service_proto_list.json +6 -1
  82. package/build/src/v1/user_event_service_client.d.ts +167 -77
  83. package/build/src/v1/user_event_service_client.js +260 -254
  84. package/build/src/v1/user_event_service_proto_list.json +6 -1
  85. package/build/src/v1/user_license_service_client.d.ts +2256 -0
  86. package/build/src/v1/user_license_service_client.js +3194 -0
  87. package/build/src/v1/user_license_service_client_config.json +34 -0
  88. package/build/src/v1/user_license_service_proto_list.json +44 -0
  89. package/build/src/v1alpha/acl_config_service_client.d.ts +49 -49
  90. package/build/src/v1alpha/acl_config_service_client.js +94 -106
  91. package/build/src/v1alpha/chunk_service_client.d.ts +88 -88
  92. package/build/src/v1alpha/chunk_service_client.js +98 -120
  93. package/build/src/v1alpha/completion_service_client.d.ts +77 -77
  94. package/build/src/v1alpha/completion_service_client.js +141 -281
  95. package/build/src/v1alpha/control_service_client.d.ts +85 -85
  96. package/build/src/v1alpha/control_service_client.js +129 -151
  97. package/build/src/v1alpha/conversational_search_service_client.d.ts +143 -143
  98. package/build/src/v1alpha/conversational_search_service_client.js +211 -237
  99. package/build/src/v1alpha/data_store_service_client.d.ts +126 -126
  100. package/build/src/v1alpha/data_store_service_client.js +176 -317
  101. package/build/src/v1alpha/document_service_client.d.ts +126 -126
  102. package/build/src/v1alpha/document_service_client.js +193 -329
  103. package/build/src/v1alpha/engine_service_client.d.ts +106 -106
  104. package/build/src/v1alpha/engine_service_client.js +180 -326
  105. package/build/src/v1alpha/estimate_billing_service_client.d.ts +76 -76
  106. package/build/src/v1alpha/estimate_billing_service_client.js +119 -244
  107. package/build/src/v1alpha/evaluation_service_client.d.ts +161 -161
  108. package/build/src/v1alpha/evaluation_service_client.js +150 -296
  109. package/build/src/v1alpha/grounded_generation_service_client.d.ts +48 -48
  110. package/build/src/v1alpha/grounded_generation_service_client.js +85 -100
  111. package/build/src/v1alpha/project_service_client.d.ts +78 -78
  112. package/build/src/v1alpha/project_service_client.js +139 -263
  113. package/build/src/v1alpha/rank_service_client.d.ts +47 -47
  114. package/build/src/v1alpha/rank_service_client.js +87 -104
  115. package/build/src/v1alpha/recommendation_service_client.d.ts +47 -47
  116. package/build/src/v1alpha/recommendation_service_client.js +85 -100
  117. package/build/src/v1alpha/sample_query_service_client.d.ts +123 -123
  118. package/build/src/v1alpha/sample_query_service_client.js +169 -302
  119. package/build/src/v1alpha/sample_query_set_service_client.d.ts +94 -94
  120. package/build/src/v1alpha/sample_query_set_service_client.js +130 -153
  121. package/build/src/v1alpha/schema_service_client.d.ts +112 -112
  122. package/build/src/v1alpha/schema_service_client.js +147 -293
  123. package/build/src/v1alpha/search_service_client.d.ts +327 -327
  124. package/build/src/v1alpha/search_service_client.js +88 -112
  125. package/build/src/v1alpha/search_tuning_service_client.d.ts +77 -77
  126. package/build/src/v1alpha/search_tuning_service_client.js +129 -254
  127. package/build/src/v1alpha/serving_config_service_client.d.ts +75 -75
  128. package/build/src/v1alpha/serving_config_service_client.js +109 -133
  129. package/build/src/v1alpha/site_search_engine_service_client.d.ts +151 -151
  130. package/build/src/v1alpha/site_search_engine_service_client.js +203 -388
  131. package/build/src/v1alpha/user_event_service_client.d.ts +78 -78
  132. package/build/src/v1alpha/user_event_service_client.js +143 -272
  133. package/build/src/v1beta/completion_service_client.d.ts +78 -78
  134. package/build/src/v1beta/completion_service_client.js +149 -280
  135. package/build/src/v1beta/control_service_client.d.ts +84 -84
  136. package/build/src/v1beta/control_service_client.js +127 -147
  137. package/build/src/v1beta/conversational_search_service_client.d.ts +142 -142
  138. package/build/src/v1beta/conversational_search_service_client.js +209 -233
  139. package/build/src/v1beta/data_store_service_client.d.ts +124 -124
  140. package/build/src/v1beta/data_store_service_client.js +154 -289
  141. package/build/src/v1beta/document_service_client.d.ts +124 -124
  142. package/build/src/v1beta/document_service_client.js +181 -310
  143. package/build/src/v1beta/engine_service_client.d.ts +106 -106
  144. package/build/src/v1beta/engine_service_client.js +178 -316
  145. package/build/src/v1beta/evaluation_service_client.d.ts +161 -161
  146. package/build/src/v1beta/evaluation_service_client.js +148 -286
  147. package/build/src/v1beta/grounded_generation_service_client.d.ts +49 -49
  148. package/build/src/v1beta/grounded_generation_service_client.js +98 -114
  149. package/build/src/v1beta/project_service_client.d.ts +76 -76
  150. package/build/src/v1beta/project_service_client.js +116 -232
  151. package/build/src/v1beta/rank_service_client.d.ts +47 -47
  152. package/build/src/v1beta/rank_service_client.js +85 -99
  153. package/build/src/v1beta/recommendation_service_client.d.ts +47 -47
  154. package/build/src/v1beta/recommendation_service_client.js +83 -96
  155. package/build/src/v1beta/sample_query_service_client.d.ts +123 -123
  156. package/build/src/v1beta/sample_query_service_client.js +167 -292
  157. package/build/src/v1beta/sample_query_set_service_client.d.ts +94 -94
  158. package/build/src/v1beta/sample_query_set_service_client.js +128 -149
  159. package/build/src/v1beta/schema_service_client.d.ts +111 -111
  160. package/build/src/v1beta/schema_service_client.js +145 -283
  161. package/build/src/v1beta/search_service_client.d.ts +665 -665
  162. package/build/src/v1beta/search_service_client.js +97 -128
  163. package/build/src/v1beta/search_tuning_service_client.d.ts +77 -77
  164. package/build/src/v1beta/search_tuning_service_client.js +127 -244
  165. package/build/src/v1beta/serving_config_service_client.d.ts +75 -75
  166. package/build/src/v1beta/serving_config_service_client.js +107 -129
  167. package/build/src/v1beta/site_search_engine_service_client.d.ts +151 -151
  168. package/build/src/v1beta/site_search_engine_service_client.js +205 -387
  169. package/build/src/v1beta/user_event_service_client.d.ts +78 -78
  170. package/build/src/v1beta/user_event_service_client.js +141 -262
  171. package/package.json +7 -7
  172. 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
- * 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,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
- this._gaxModule.routingHeader.fromParams({
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
- this._gaxModule.routingHeader.fromParams({
443
- parent: request.parent ?? '',
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
- this._gaxModule.routingHeader.fromParams({
503
- parent: request.parent ?? '',
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
- * 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
- */
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
- * 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
- */
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();