@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
@@ -145,7 +145,7 @@ export declare class ServingConfigServiceClient {
145
145
  */
146
146
  updateServingConfig(request?: protos.google.cloud.discoveryengine.v1alpha.IUpdateServingConfigRequest, options?: CallOptions): Promise<[
147
147
  protos.google.cloud.discoveryengine.v1alpha.IServingConfig,
148
- (protos.google.cloud.discoveryengine.v1alpha.IUpdateServingConfigRequest | undefined),
148
+ protos.google.cloud.discoveryengine.v1alpha.IUpdateServingConfigRequest | undefined,
149
149
  {} | undefined
150
150
  ]>;
151
151
  updateServingConfig(request: protos.google.cloud.discoveryengine.v1alpha.IUpdateServingConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1alpha.IServingConfig, protos.google.cloud.discoveryengine.v1alpha.IUpdateServingConfigRequest | null | undefined, {} | null | undefined>): void;
@@ -171,38 +171,38 @@ export declare class ServingConfigServiceClient {
171
171
  */
172
172
  getServingConfig(request?: protos.google.cloud.discoveryengine.v1alpha.IGetServingConfigRequest, options?: CallOptions): Promise<[
173
173
  protos.google.cloud.discoveryengine.v1alpha.IServingConfig,
174
- (protos.google.cloud.discoveryengine.v1alpha.IGetServingConfigRequest | undefined),
174
+ protos.google.cloud.discoveryengine.v1alpha.IGetServingConfigRequest | undefined,
175
175
  {} | undefined
176
176
  ]>;
177
177
  getServingConfig(request: protos.google.cloud.discoveryengine.v1alpha.IGetServingConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1alpha.IServingConfig, protos.google.cloud.discoveryengine.v1alpha.IGetServingConfigRequest | null | undefined, {} | null | undefined>): void;
178
178
  getServingConfig(request: protos.google.cloud.discoveryengine.v1alpha.IGetServingConfigRequest, callback: Callback<protos.google.cloud.discoveryengine.v1alpha.IServingConfig, protos.google.cloud.discoveryengine.v1alpha.IGetServingConfigRequest | null | undefined, {} | null | undefined>): void;
179
179
  /**
180
- * Lists all ServingConfigs linked to this dataStore.
181
- *
182
- * @param {Object} request
183
- * The request object that will be sent.
184
- * @param {string} request.parent
185
- * Required. Full resource name of the parent resource. Format:
186
- * `projects/{project_number}/locations/{location}/collections/{collection}/engines/{engine}`
187
- * @param {number} [request.pageSize]
188
- * Optional. Maximum number of results to return. If unspecified, defaults
189
- * to 100. If a value greater than 100 is provided, at most 100 results are
190
- * returned.
191
- * @param {string} [request.pageToken]
192
- * Optional. A page token, received from a previous `ListServingConfigs` call.
193
- * Provide this to retrieve the subsequent page.
194
- * @param {object} [options]
195
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
196
- * @returns {Promise} - The promise which resolves to an array.
197
- * The first element of the array is Array of {@link protos.google.cloud.discoveryengine.v1alpha.ServingConfig|ServingConfig}.
198
- * The client library will perform auto-pagination by default: it will call the API as many
199
- * times as needed and will merge results from all the pages into this array.
200
- * Note that it can affect your quota.
201
- * We recommend using `listServingConfigsAsync()`
202
- * method described below for async iteration which you can stop as needed.
203
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
204
- * for more details and examples.
205
- */
180
+ * Lists all ServingConfigs linked to this dataStore.
181
+ *
182
+ * @param {Object} request
183
+ * The request object that will be sent.
184
+ * @param {string} request.parent
185
+ * Required. Full resource name of the parent resource. Format:
186
+ * `projects/{project_number}/locations/{location}/collections/{collection}/engines/{engine}`
187
+ * @param {number} [request.pageSize]
188
+ * Optional. Maximum number of results to return. If unspecified, defaults
189
+ * to 100. If a value greater than 100 is provided, at most 100 results are
190
+ * returned.
191
+ * @param {string} [request.pageToken]
192
+ * Optional. A page token, received from a previous `ListServingConfigs` call.
193
+ * Provide this to retrieve the subsequent page.
194
+ * @param {object} [options]
195
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
196
+ * @returns {Promise} - The promise which resolves to an array.
197
+ * The first element of the array is Array of {@link protos.google.cloud.discoveryengine.v1alpha.ServingConfig|ServingConfig}.
198
+ * The client library will perform auto-pagination by default: it will call the API as many
199
+ * times as needed and will merge results from all the pages into this array.
200
+ * Note that it can affect your quota.
201
+ * We recommend using `listServingConfigsAsync()`
202
+ * method described below for async iteration which you can stop as needed.
203
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
204
+ * for more details and examples.
205
+ */
206
206
  listServingConfigs(request?: protos.google.cloud.discoveryengine.v1alpha.IListServingConfigsRequest, options?: CallOptions): Promise<[
207
207
  protos.google.cloud.discoveryengine.v1alpha.IServingConfig[],
208
208
  protos.google.cloud.discoveryengine.v1alpha.IListServingConfigsRequest | null,
@@ -266,55 +266,55 @@ export declare class ServingConfigServiceClient {
266
266
  */
267
267
  listServingConfigsAsync(request?: protos.google.cloud.discoveryengine.v1alpha.IListServingConfigsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.discoveryengine.v1alpha.IServingConfig>;
268
268
  /**
269
- * Gets information about a location.
270
- *
271
- * @param {Object} request
272
- * The request object that will be sent.
273
- * @param {string} request.name
274
- * Resource name for the location.
275
- * @param {object} [options]
276
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
277
- * @returns {Promise} - The promise which resolves to an array.
278
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
279
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
280
- * for more details and examples.
281
- * @example
282
- * ```
283
- * const [response] = await client.getLocation(request);
284
- * ```
285
- */
269
+ * Gets information about a location.
270
+ *
271
+ * @param {Object} request
272
+ * The request object that will be sent.
273
+ * @param {string} request.name
274
+ * Resource name for the location.
275
+ * @param {object} [options]
276
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
277
+ * @returns {Promise} - The promise which resolves to an array.
278
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
279
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
280
+ * for more details and examples.
281
+ * @example
282
+ * ```
283
+ * const [response] = await client.getLocation(request);
284
+ * ```
285
+ */
286
286
  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>;
287
287
  /**
288
- * Lists information about the supported locations for this service. Returns an iterable object.
289
- *
290
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
291
- * @param {Object} request
292
- * The request object that will be sent.
293
- * @param {string} request.name
294
- * The resource that owns the locations collection, if applicable.
295
- * @param {string} request.filter
296
- * The standard list filter.
297
- * @param {number} request.pageSize
298
- * The standard list page size.
299
- * @param {string} request.pageToken
300
- * The standard list page token.
301
- * @param {object} [options]
302
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
303
- * @returns {Object}
304
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
305
- * When you iterate the returned iterable, each element will be an object representing
306
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
307
- * so you can stop the iteration when you don't need more results.
308
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
309
- * for more details and examples.
310
- * @example
311
- * ```
312
- * const iterable = client.listLocationsAsync(request);
313
- * for await (const response of iterable) {
314
- * // process response
315
- * }
316
- * ```
317
- */
288
+ * Lists information about the supported locations for this service. Returns an iterable object.
289
+ *
290
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
291
+ * @param {Object} request
292
+ * The request object that will be sent.
293
+ * @param {string} request.name
294
+ * The resource that owns the locations collection, if applicable.
295
+ * @param {string} request.filter
296
+ * The standard list filter.
297
+ * @param {number} request.pageSize
298
+ * The standard list page size.
299
+ * @param {string} request.pageToken
300
+ * The standard list page token.
301
+ * @param {object} [options]
302
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
303
+ * @returns {Object}
304
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
305
+ * When you iterate the returned iterable, each element will be an object representing
306
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
307
+ * so you can stop the iteration when you don't need more results.
308
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
309
+ * for more details and examples.
310
+ * @example
311
+ * ```
312
+ * const iterable = client.listLocationsAsync(request);
313
+ * for await (const response of iterable) {
314
+ * // process response
315
+ * }
316
+ * ```
317
+ */
318
318
  listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
319
319
  /**
320
320
  * Return a fully-qualified aclConfig resource name string.
@@ -98,26 +98,17 @@ class ServingConfigServiceClient {
98
98
  constructor(opts, gaxInstance) {
99
99
  // Ensure that options include all the required fields.
100
100
  const staticMembers = this.constructor;
101
- if (opts?.universe_domain &&
102
- opts?.universeDomain &&
103
- opts?.universe_domain !== opts?.universeDomain) {
101
+ if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
104
102
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
105
103
  }
106
- const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
107
- ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
108
- : undefined;
109
- this._universeDomain =
110
- opts?.universeDomain ??
111
- opts?.universe_domain ??
112
- universeDomainEnvVar ??
113
- 'googleapis.com';
104
+ const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
105
+ this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
114
106
  this._servicePath = 'discoveryengine.' + this._universeDomain;
115
107
  const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
116
108
  this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
117
109
  const port = opts?.port || staticMembers.port;
118
110
  const clientConfig = opts?.clientConfig ?? {};
119
- const fallback = opts?.fallback ??
120
- (typeof window !== 'undefined' && typeof window?.fetch === 'function');
111
+ const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
121
112
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
122
113
  // Request numeric enum values if REST transport is used.
123
114
  opts.numericEnums = true;
@@ -147,7 +138,10 @@ class ServingConfigServiceClient {
147
138
  }
148
139
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
149
140
  // Determine the client header string.
150
- const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
141
+ const clientHeader = [
142
+ `gax/${this._gaxModule.version}`,
143
+ `gapic/${version}`,
144
+ ];
151
145
  if (typeof process === 'object' && 'versions' in process) {
152
146
  clientHeader.push(`gl-node/${process.versions.node}`);
153
147
  }
@@ -212,7 +206,7 @@ class ServingConfigServiceClient {
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
- listServingConfigs: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'servingConfigs'),
209
+ listServingConfigs: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'servingConfigs')
216
210
  };
217
211
  // Put together the default options sent with requests.
218
212
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1alpha.ServingConfigService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -241,18 +235,13 @@ class ServingConfigServiceClient {
241
235
  }
242
236
  // Put together the "service stub" for
243
237
  // google.cloud.discoveryengine.v1alpha.ServingConfigService.
244
- this.servingConfigServiceStub = this._gaxGrpc.createStub(this._opts.fallback
245
- ? this._protos.lookupService('google.cloud.discoveryengine.v1alpha.ServingConfigService')
246
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
247
- this._protos.google.cloud.discoveryengine.v1alpha
248
- .ServingConfigService, this._opts, this._providedCustomServicePath);
238
+ this.servingConfigServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
239
+ this._protos.lookupService('google.cloud.discoveryengine.v1alpha.ServingConfigService') :
240
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
241
+ this._protos.google.cloud.discoveryengine.v1alpha.ServingConfigService, 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
- const servingConfigServiceStubMethods = [
252
- 'updateServingConfig',
253
- 'getServingConfig',
254
- 'listServingConfigs',
255
- ];
244
+ const servingConfigServiceStubMethods = ['updateServingConfig', 'getServingConfig', 'listServingConfigs'];
256
245
  for (const methodName of servingConfigServiceStubMethods) {
257
246
  const callPromise = this.servingConfigServiceStub.then(stub => (...args) => {
258
247
  if (this._terminated) {
@@ -263,7 +252,8 @@ class ServingConfigServiceClient {
263
252
  }, (err) => () => {
264
253
  throw err;
265
254
  });
266
- const descriptor = this.descriptors.page[methodName] || undefined;
255
+ const descriptor = this.descriptors.page[methodName] ||
256
+ undefined;
267
257
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
268
258
  this.innerApiCalls[methodName] = apiCall;
269
259
  }
@@ -275,8 +265,7 @@ class ServingConfigServiceClient {
275
265
  * @returns {string} The DNS address for this service.
276
266
  */
277
267
  static get servicePath() {
278
- if (typeof process === 'object' &&
279
- typeof process.emitWarning === 'function') {
268
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
280
269
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
281
270
  }
282
271
  return 'discoveryengine.googleapis.com';
@@ -287,8 +276,7 @@ class ServingConfigServiceClient {
287
276
  * @returns {string} The DNS address for this service.
288
277
  */
289
278
  static get apiEndpoint() {
290
- if (typeof process === 'object' &&
291
- typeof process.emitWarning === 'function') {
279
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
292
280
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
293
281
  }
294
282
  return 'discoveryengine.googleapis.com';
@@ -316,7 +304,9 @@ class ServingConfigServiceClient {
316
304
  * @returns {string[]} List of default scopes.
317
305
  */
318
306
  static get scopes() {
319
- return ['https://www.googleapis.com/auth/cloud-platform'];
307
+ return [
308
+ 'https://www.googleapis.com/auth/cloud-platform'
309
+ ];
320
310
  }
321
311
  /**
322
312
  * Return the project ID used by this class.
@@ -342,13 +332,10 @@ class ServingConfigServiceClient {
342
332
  options = options || {};
343
333
  options.otherArgs = options.otherArgs || {};
344
334
  options.otherArgs.headers = options.otherArgs.headers || {};
345
- options.otherArgs.headers['x-goog-request-params'] =
346
- this._gaxModule.routingHeader.fromParams({
347
- 'serving_config.name': request.servingConfig.name ?? '',
348
- });
349
- this.initialize().catch(err => {
350
- throw err;
335
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
336
+ 'serving_config.name': request.servingConfig.name ?? '',
351
337
  });
338
+ this.initialize().catch(err => { throw err; });
352
339
  this._log.info('updateServingConfig request %j', request);
353
340
  const wrappedCallback = callback
354
341
  ? (error, response, options, rawResponse) => {
@@ -356,11 +343,16 @@ class ServingConfigServiceClient {
356
343
  callback(error, response, options, rawResponse); // We verified callback above.
357
344
  }
358
345
  : undefined;
359
- return this.innerApiCalls
360
- .updateServingConfig(request, options, wrappedCallback)
346
+ return this.innerApiCalls.updateServingConfig(request, options, wrappedCallback)
361
347
  ?.then(([response, options, rawResponse]) => {
362
348
  this._log.info('updateServingConfig response %j', response);
363
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;
364
356
  });
365
357
  }
366
358
  getServingConfig(request, optionsOrCallback, callback) {
@@ -376,13 +368,10 @@ class ServingConfigServiceClient {
376
368
  options = options || {};
377
369
  options.otherArgs = options.otherArgs || {};
378
370
  options.otherArgs.headers = options.otherArgs.headers || {};
379
- options.otherArgs.headers['x-goog-request-params'] =
380
- this._gaxModule.routingHeader.fromParams({
381
- name: request.name ?? '',
382
- });
383
- this.initialize().catch(err => {
384
- throw err;
371
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
372
+ 'name': request.name ?? '',
385
373
  });
374
+ this.initialize().catch(err => { throw err; });
386
375
  this._log.info('getServingConfig request %j', request);
387
376
  const wrappedCallback = callback
388
377
  ? (error, response, options, rawResponse) => {
@@ -390,11 +379,16 @@ class ServingConfigServiceClient {
390
379
  callback(error, response, options, rawResponse); // We verified callback above.
391
380
  }
392
381
  : undefined;
393
- return this.innerApiCalls
394
- .getServingConfig(request, options, wrappedCallback)
382
+ return this.innerApiCalls.getServingConfig(request, options, wrappedCallback)
395
383
  ?.then(([response, options, rawResponse]) => {
396
384
  this._log.info('getServingConfig response %j', response);
397
385
  return [response, options, rawResponse];
386
+ }).catch((error) => {
387
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
388
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
389
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
390
+ }
391
+ throw error;
398
392
  });
399
393
  }
400
394
  listServingConfigs(request, optionsOrCallback, callback) {
@@ -410,13 +404,10 @@ class ServingConfigServiceClient {
410
404
  options = options || {};
411
405
  options.otherArgs = options.otherArgs || {};
412
406
  options.otherArgs.headers = options.otherArgs.headers || {};
413
- options.otherArgs.headers['x-goog-request-params'] =
414
- this._gaxModule.routingHeader.fromParams({
415
- parent: request.parent ?? '',
416
- });
417
- this.initialize().catch(err => {
418
- throw err;
407
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
408
+ 'parent': request.parent ?? '',
419
409
  });
410
+ this.initialize().catch(err => { throw err; });
420
411
  const wrappedCallback = callback
421
412
  ? (error, values, nextPageRequest, rawResponse) => {
422
413
  this._log.info('listServingConfigs values %j', values);
@@ -461,15 +452,12 @@ class ServingConfigServiceClient {
461
452
  options = options || {};
462
453
  options.otherArgs = options.otherArgs || {};
463
454
  options.otherArgs.headers = options.otherArgs.headers || {};
464
- options.otherArgs.headers['x-goog-request-params'] =
465
- this._gaxModule.routingHeader.fromParams({
466
- parent: request.parent ?? '',
467
- });
455
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
456
+ 'parent': request.parent ?? '',
457
+ });
468
458
  const defaultCallSettings = this._defaults['listServingConfigs'];
469
459
  const callSettings = defaultCallSettings.merge(options);
470
- this.initialize().catch(err => {
471
- throw err;
472
- });
460
+ this.initialize().catch(err => { throw err; });
473
461
  this._log.info('listServingConfigs stream %j', request);
474
462
  return this.descriptors.page.listServingConfigs.createStream(this.innerApiCalls.listServingConfigs, request, callSettings);
475
463
  }
@@ -506,70 +494,67 @@ class ServingConfigServiceClient {
506
494
  options = options || {};
507
495
  options.otherArgs = options.otherArgs || {};
508
496
  options.otherArgs.headers = options.otherArgs.headers || {};
509
- options.otherArgs.headers['x-goog-request-params'] =
510
- this._gaxModule.routingHeader.fromParams({
511
- parent: request.parent ?? '',
512
- });
497
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
498
+ 'parent': request.parent ?? '',
499
+ });
513
500
  const defaultCallSettings = this._defaults['listServingConfigs'];
514
501
  const callSettings = defaultCallSettings.merge(options);
515
- this.initialize().catch(err => {
516
- throw err;
517
- });
502
+ this.initialize().catch(err => { throw err; });
518
503
  this._log.info('listServingConfigs iterate %j', request);
519
504
  return this.descriptors.page.listServingConfigs.asyncIterate(this.innerApiCalls['listServingConfigs'], request, callSettings);
520
505
  }
521
506
  /**
522
- * Gets information about a location.
523
- *
524
- * @param {Object} request
525
- * The request object that will be sent.
526
- * @param {string} request.name
527
- * Resource name for the location.
528
- * @param {object} [options]
529
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
530
- * @returns {Promise} - The promise which resolves to an array.
531
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
532
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
533
- * for more details and examples.
534
- * @example
535
- * ```
536
- * const [response] = await client.getLocation(request);
537
- * ```
538
- */
507
+ * Gets information about a location.
508
+ *
509
+ * @param {Object} request
510
+ * The request object that will be sent.
511
+ * @param {string} request.name
512
+ * Resource name for the location.
513
+ * @param {object} [options]
514
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
515
+ * @returns {Promise} - The promise which resolves to an array.
516
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
517
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
518
+ * for more details and examples.
519
+ * @example
520
+ * ```
521
+ * const [response] = await client.getLocation(request);
522
+ * ```
523
+ */
539
524
  getLocation(request, options, callback) {
540
525
  return this.locationsClient.getLocation(request, options, callback);
541
526
  }
542
527
  /**
543
- * Lists information about the supported locations for this service. Returns an iterable object.
544
- *
545
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
546
- * @param {Object} request
547
- * The request object that will be sent.
548
- * @param {string} request.name
549
- * The resource that owns the locations collection, if applicable.
550
- * @param {string} request.filter
551
- * The standard list filter.
552
- * @param {number} request.pageSize
553
- * The standard list page size.
554
- * @param {string} request.pageToken
555
- * The standard list page token.
556
- * @param {object} [options]
557
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
558
- * @returns {Object}
559
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
560
- * When you iterate the returned iterable, each element will be an object representing
561
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
562
- * so you can stop the iteration when you don't need more results.
563
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
564
- * for more details and examples.
565
- * @example
566
- * ```
567
- * const iterable = client.listLocationsAsync(request);
568
- * for await (const response of iterable) {
569
- * // process response
570
- * }
571
- * ```
572
- */
528
+ * Lists information about the supported locations for this service. Returns an iterable object.
529
+ *
530
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
531
+ * @param {Object} request
532
+ * The request object that will be sent.
533
+ * @param {string} request.name
534
+ * The resource that owns the locations collection, if applicable.
535
+ * @param {string} request.filter
536
+ * The standard list filter.
537
+ * @param {number} request.pageSize
538
+ * The standard list page size.
539
+ * @param {string} request.pageToken
540
+ * The standard list page token.
541
+ * @param {object} [options]
542
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
543
+ * @returns {Object}
544
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
545
+ * When you iterate the returned iterable, each element will be an object representing
546
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
547
+ * so you can stop the iteration when you don't need more results.
548
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
549
+ * for more details and examples.
550
+ * @example
551
+ * ```
552
+ * const iterable = client.listLocationsAsync(request);
553
+ * for await (const response of iterable) {
554
+ * // process response
555
+ * }
556
+ * ```
557
+ */
573
558
  listLocationsAsync(request, options) {
574
559
  return this.locationsClient.listLocationsAsync(request, options);
575
560
  }
@@ -597,8 +582,7 @@ class ServingConfigServiceClient {
597
582
  * @returns {string} A string representing the project.
598
583
  */
599
584
  matchProjectFromAclConfigName(aclConfigName) {
600
- return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
601
- .project;
585
+ return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).project;
602
586
  }
603
587
  /**
604
588
  * Parse the location from AclConfig resource.
@@ -608,8 +592,7 @@ class ServingConfigServiceClient {
608
592
  * @returns {string} A string representing the location.
609
593
  */
610
594
  matchLocationFromAclConfigName(aclConfigName) {
611
- return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
612
- .location;
595
+ return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).location;
613
596
  }
614
597
  /**
615
598
  * Return a fully-qualified engine resource name string.
@@ -691,8 +674,7 @@ class ServingConfigServiceClient {
691
674
  * @returns {string} A string representing the project.
692
675
  */
693
676
  matchProjectFromEvaluationName(evaluationName) {
694
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
695
- .project;
677
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
696
678
  }
697
679
  /**
698
680
  * Parse the location from Evaluation resource.
@@ -702,8 +684,7 @@ class ServingConfigServiceClient {
702
684
  * @returns {string} A string representing the location.
703
685
  */
704
686
  matchLocationFromEvaluationName(evaluationName) {
705
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
706
- .location;
687
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
707
688
  }
708
689
  /**
709
690
  * Parse the evaluation from Evaluation resource.
@@ -713,8 +694,7 @@ class ServingConfigServiceClient {
713
694
  * @returns {string} A string representing the evaluation.
714
695
  */
715
696
  matchEvaluationFromEvaluationName(evaluationName) {
716
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
717
- .evaluation;
697
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
718
698
  }
719
699
  /**
720
700
  * Return a fully-qualified location resource name string.
@@ -2814,8 +2794,7 @@ class ServingConfigServiceClient {
2814
2794
  * @returns {string} A string representing the project.
2815
2795
  */
2816
2796
  matchProjectFromSampleQueryName(sampleQueryName) {
2817
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2818
- .project;
2797
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
2819
2798
  }
2820
2799
  /**
2821
2800
  * Parse the location from SampleQuery resource.
@@ -2825,8 +2804,7 @@ class ServingConfigServiceClient {
2825
2804
  * @returns {string} A string representing the location.
2826
2805
  */
2827
2806
  matchLocationFromSampleQueryName(sampleQueryName) {
2828
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2829
- .location;
2807
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
2830
2808
  }
2831
2809
  /**
2832
2810
  * Parse the sample_query_set from SampleQuery resource.
@@ -2836,8 +2814,7 @@ class ServingConfigServiceClient {
2836
2814
  * @returns {string} A string representing the sample_query_set.
2837
2815
  */
2838
2816
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
2839
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2840
- .sample_query_set;
2817
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
2841
2818
  }
2842
2819
  /**
2843
2820
  * Parse the sample_query from SampleQuery resource.
@@ -2847,8 +2824,7 @@ class ServingConfigServiceClient {
2847
2824
  * @returns {string} A string representing the sample_query.
2848
2825
  */
2849
2826
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
2850
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2851
- .sample_query;
2827
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
2852
2828
  }
2853
2829
  /**
2854
2830
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -2907,7 +2883,7 @@ class ServingConfigServiceClient {
2907
2883
  this._log.info('ending gRPC channel');
2908
2884
  this._terminated = true;
2909
2885
  stub.close();
2910
- this.locationsClient.close();
2886
+ this.locationsClient.close().catch(err => { throw err; });
2911
2887
  });
2912
2888
  }
2913
2889
  return Promise.resolve();