@google-cloud/discoveryengine 2.0.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +7 -2
  3. package/build/protos/google/cloud/discoveryengine/v1/answer.proto +54 -2
  4. package/build/protos/google/cloud/discoveryengine/v1/chunk.proto +2 -1
  5. package/build/protos/google/cloud/discoveryengine/v1/common.proto +35 -6
  6. package/build/protos/google/cloud/discoveryengine/v1/control.proto +113 -2
  7. package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +168 -2
  8. package/build/protos/google/cloud/discoveryengine/v1/data_store.proto +23 -4
  9. package/build/protos/google/cloud/discoveryengine/v1/document.proto +7 -2
  10. package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +1 -1
  11. package/build/protos/google/cloud/discoveryengine/v1/engine.proto +16 -3
  12. package/build/protos/google/cloud/discoveryengine/v1/grounded_generation_service.proto +70 -9
  13. package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +20 -1
  14. package/build/protos/google/cloud/discoveryengine/v1/purge_config.proto +9 -5
  15. package/build/protos/google/cloud/discoveryengine/v1/rank_service.proto +3 -1
  16. package/build/protos/google/cloud/discoveryengine/v1/recommendation_service.proto +2 -2
  17. package/build/protos/google/cloud/discoveryengine/v1/safety.proto +107 -0
  18. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +96 -8
  19. package/build/protos/google/cloud/discoveryengine/v1/serving_config.proto +271 -0
  20. package/build/protos/google/cloud/discoveryengine/v1/serving_config_service.proto +75 -0
  21. package/build/protos/google/cloud/discoveryengine/v1/session.proto +19 -0
  22. package/build/protos/google/cloud/discoveryengine/v1/site_search_engine.proto +27 -3
  23. package/build/protos/google/cloud/discoveryengine/v1/site_search_engine_service.proto +184 -5
  24. package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +34 -0
  25. package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +16 -4
  26. package/build/protos/protos.d.ts +4390 -300
  27. package/build/protos/protos.js +13785 -2922
  28. package/build/protos/protos.json +1355 -14
  29. package/build/src/index.d.ts +4 -1
  30. package/build/src/index.js +4 -21
  31. package/build/src/v1/completion_service_client.d.ts +313 -76
  32. package/build/src/v1/completion_service_client.js +451 -262
  33. package/build/src/v1/completion_service_proto_list.json +3 -0
  34. package/build/src/v1/control_service_client.d.ts +318 -81
  35. package/build/src/v1/control_service_client.js +422 -132
  36. package/build/src/v1/control_service_proto_list.json +3 -0
  37. package/build/src/v1/conversational_search_service_client.d.ts +341 -134
  38. package/build/src/v1/conversational_search_service_client.js +395 -223
  39. package/build/src/v1/conversational_search_service_client_config.json +5 -0
  40. package/build/src/v1/conversational_search_service_proto_list.json +3 -0
  41. package/build/src/v1/data_store_service_client.d.ts +359 -122
  42. package/build/src/v1/data_store_service_client.js +460 -280
  43. package/build/src/v1/data_store_service_proto_list.json +3 -0
  44. package/build/src/v1/document_service_client.d.ts +364 -121
  45. package/build/src/v1/document_service_client.js +469 -300
  46. package/build/src/v1/document_service_proto_list.json +3 -0
  47. package/build/src/v1/engine_service_client.d.ts +340 -103
  48. package/build/src/v1/engine_service_client.js +460 -279
  49. package/build/src/v1/engine_service_proto_list.json +3 -0
  50. package/build/src/v1/gapic_metadata.json +59 -0
  51. package/build/src/v1/grounded_generation_service_client.d.ts +286 -51
  52. package/build/src/v1/grounded_generation_service_client.js +405 -100
  53. package/build/src/v1/grounded_generation_service_proto_list.json +3 -0
  54. package/build/src/v1/index.d.ts +1 -0
  55. package/build/src/v1/index.js +3 -1
  56. package/build/src/v1/project_service_client.d.ts +313 -76
  57. package/build/src/v1/project_service_client.js +434 -222
  58. package/build/src/v1/project_service_proto_list.json +3 -0
  59. package/build/src/v1/rank_service_client.d.ts +285 -48
  60. package/build/src/v1/rank_service_client.js +398 -85
  61. package/build/src/v1/rank_service_proto_list.json +3 -0
  62. package/build/src/v1/recommendation_service_client.d.ts +142 -49
  63. package/build/src/v1/recommendation_service_client.js +198 -82
  64. package/build/src/v1/recommendation_service_proto_list.json +3 -0
  65. package/build/src/v1/schema_service_client.d.ts +348 -111
  66. package/build/src/v1/schema_service_client.js +457 -273
  67. package/build/src/v1/schema_service_proto_list.json +3 -0
  68. package/build/src/v1/search_service_client.d.ts +748 -559
  69. package/build/src/v1/search_service_client.js +302 -133
  70. package/build/src/v1/search_service_proto_list.json +3 -0
  71. package/build/src/v1/search_tuning_service_client.d.ts +314 -77
  72. package/build/src/v1/search_tuning_service_client.js +439 -235
  73. package/build/src/v1/search_tuning_service_proto_list.json +3 -0
  74. package/build/src/v1/serving_config_service_client.d.ts +1851 -0
  75. package/build/src/v1/serving_config_service_client.js +2642 -0
  76. package/build/src/v1/serving_config_service_client_config.json +30 -0
  77. package/build/src/v1/serving_config_service_proto_list.json +39 -0
  78. package/build/src/v1/site_search_engine_service_client.d.ts +504 -151
  79. package/build/src/v1/site_search_engine_service_client.js +625 -351
  80. package/build/src/v1/site_search_engine_service_client_config.json +12 -0
  81. package/build/src/v1/site_search_engine_service_proto_list.json +3 -0
  82. package/build/src/v1/user_event_service_client.d.ts +335 -86
  83. package/build/src/v1/user_event_service_client.js +447 -253
  84. package/build/src/v1/user_event_service_proto_list.json +3 -0
  85. package/build/src/v1alpha/acl_config_service_client.d.ts +49 -49
  86. package/build/src/v1alpha/acl_config_service_client.js +82 -106
  87. package/build/src/v1alpha/chunk_service_client.d.ts +88 -88
  88. package/build/src/v1alpha/chunk_service_client.js +92 -120
  89. package/build/src/v1alpha/completion_service_client.d.ts +77 -77
  90. package/build/src/v1alpha/completion_service_client.js +134 -280
  91. package/build/src/v1alpha/control_service_client.d.ts +85 -85
  92. package/build/src/v1alpha/control_service_client.js +105 -151
  93. package/build/src/v1alpha/conversational_search_service_client.d.ts +143 -143
  94. package/build/src/v1alpha/conversational_search_service_client.js +145 -237
  95. package/build/src/v1alpha/data_store_service_client.d.ts +126 -126
  96. package/build/src/v1alpha/data_store_service_client.js +151 -316
  97. package/build/src/v1alpha/document_service_client.d.ts +126 -126
  98. package/build/src/v1alpha/document_service_client.js +156 -328
  99. package/build/src/v1alpha/engine_service_client.d.ts +106 -106
  100. package/build/src/v1alpha/engine_service_client.js +155 -325
  101. package/build/src/v1alpha/estimate_billing_service_client.d.ts +76 -76
  102. package/build/src/v1alpha/estimate_billing_service_client.js +118 -243
  103. package/build/src/v1alpha/evaluation_service_client.d.ts +161 -161
  104. package/build/src/v1alpha/evaluation_service_client.js +143 -295
  105. package/build/src/v1alpha/grounded_generation_service_client.d.ts +48 -48
  106. package/build/src/v1alpha/grounded_generation_service_client.js +79 -100
  107. package/build/src/v1alpha/project_service_client.d.ts +78 -78
  108. package/build/src/v1alpha/project_service_client.js +126 -262
  109. package/build/src/v1alpha/rank_service_client.d.ts +47 -47
  110. package/build/src/v1alpha/rank_service_client.js +81 -104
  111. package/build/src/v1alpha/recommendation_service_client.d.ts +47 -47
  112. package/build/src/v1alpha/recommendation_service_client.js +79 -100
  113. package/build/src/v1alpha/sample_query_service_client.d.ts +123 -123
  114. package/build/src/v1alpha/sample_query_service_client.js +144 -301
  115. package/build/src/v1alpha/sample_query_set_service_client.d.ts +94 -94
  116. package/build/src/v1alpha/sample_query_set_service_client.js +106 -153
  117. package/build/src/v1alpha/schema_service_client.d.ts +112 -112
  118. package/build/src/v1alpha/schema_service_client.js +140 -292
  119. package/build/src/v1alpha/search_service_client.d.ts +327 -327
  120. package/build/src/v1alpha/search_service_client.js +88 -112
  121. package/build/src/v1alpha/search_tuning_service_client.d.ts +77 -77
  122. package/build/src/v1alpha/search_tuning_service_client.js +122 -253
  123. package/build/src/v1alpha/serving_config_service_client.d.ts +75 -75
  124. package/build/src/v1alpha/serving_config_service_client.js +97 -133
  125. package/build/src/v1alpha/site_search_engine_service_client.d.ts +151 -151
  126. package/build/src/v1alpha/site_search_engine_service_client.js +184 -387
  127. package/build/src/v1alpha/user_event_service_client.d.ts +78 -78
  128. package/build/src/v1alpha/user_event_service_client.js +130 -271
  129. package/build/src/v1beta/completion_service_client.d.ts +78 -78
  130. package/build/src/v1beta/completion_service_client.js +136 -279
  131. package/build/src/v1beta/control_service_client.d.ts +84 -84
  132. package/build/src/v1beta/control_service_client.js +103 -147
  133. package/build/src/v1beta/conversational_search_service_client.d.ts +142 -142
  134. package/build/src/v1beta/conversational_search_service_client.js +143 -233
  135. package/build/src/v1beta/data_store_service_client.d.ts +124 -124
  136. package/build/src/v1beta/data_store_service_client.js +141 -288
  137. package/build/src/v1beta/document_service_client.d.ts +124 -124
  138. package/build/src/v1beta/document_service_client.js +150 -309
  139. package/build/src/v1beta/engine_service_client.d.ts +106 -106
  140. package/build/src/v1beta/engine_service_client.js +153 -315
  141. package/build/src/v1beta/evaluation_service_client.d.ts +161 -161
  142. package/build/src/v1beta/evaluation_service_client.js +141 -285
  143. package/build/src/v1beta/grounded_generation_service_client.d.ts +49 -49
  144. package/build/src/v1beta/grounded_generation_service_client.js +86 -114
  145. package/build/src/v1beta/project_service_client.d.ts +76 -76
  146. package/build/src/v1beta/project_service_client.js +115 -231
  147. package/build/src/v1beta/rank_service_client.d.ts +47 -47
  148. package/build/src/v1beta/rank_service_client.js +79 -99
  149. package/build/src/v1beta/recommendation_service_client.d.ts +47 -47
  150. package/build/src/v1beta/recommendation_service_client.js +77 -96
  151. package/build/src/v1beta/sample_query_service_client.d.ts +123 -123
  152. package/build/src/v1beta/sample_query_service_client.js +142 -291
  153. package/build/src/v1beta/sample_query_set_service_client.d.ts +94 -94
  154. package/build/src/v1beta/sample_query_set_service_client.js +104 -149
  155. package/build/src/v1beta/schema_service_client.d.ts +111 -111
  156. package/build/src/v1beta/schema_service_client.js +138 -282
  157. package/build/src/v1beta/search_service_client.d.ts +665 -665
  158. package/build/src/v1beta/search_service_client.js +97 -128
  159. package/build/src/v1beta/search_tuning_service_client.d.ts +77 -77
  160. package/build/src/v1beta/search_tuning_service_client.js +120 -243
  161. package/build/src/v1beta/serving_config_service_client.d.ts +75 -75
  162. package/build/src/v1beta/serving_config_service_client.js +95 -129
  163. package/build/src/v1beta/site_search_engine_service_client.d.ts +151 -151
  164. package/build/src/v1beta/site_search_engine_service_client.js +186 -386
  165. package/build/src/v1beta/user_event_service_client.d.ts +78 -78
  166. package/build/src/v1beta/user_event_service_client.js +128 -261
  167. package/package.json +4 -4
@@ -145,7 +145,7 @@ export declare class ServingConfigServiceClient {
145
145
  */
146
146
  updateServingConfig(request?: protos.google.cloud.discoveryengine.v1beta.IUpdateServingConfigRequest, options?: CallOptions): Promise<[
147
147
  protos.google.cloud.discoveryengine.v1beta.IServingConfig,
148
- (protos.google.cloud.discoveryengine.v1beta.IUpdateServingConfigRequest | undefined),
148
+ protos.google.cloud.discoveryengine.v1beta.IUpdateServingConfigRequest | undefined,
149
149
  {} | undefined
150
150
  ]>;
151
151
  updateServingConfig(request: protos.google.cloud.discoveryengine.v1beta.IUpdateServingConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IServingConfig, protos.google.cloud.discoveryengine.v1beta.IUpdateServingConfigRequest | null | undefined, {} | null | undefined>): void;
@@ -171,38 +171,38 @@ export declare class ServingConfigServiceClient {
171
171
  */
172
172
  getServingConfig(request?: protos.google.cloud.discoveryengine.v1beta.IGetServingConfigRequest, options?: CallOptions): Promise<[
173
173
  protos.google.cloud.discoveryengine.v1beta.IServingConfig,
174
- (protos.google.cloud.discoveryengine.v1beta.IGetServingConfigRequest | undefined),
174
+ protos.google.cloud.discoveryengine.v1beta.IGetServingConfigRequest | undefined,
175
175
  {} | undefined
176
176
  ]>;
177
177
  getServingConfig(request: protos.google.cloud.discoveryengine.v1beta.IGetServingConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IServingConfig, protos.google.cloud.discoveryengine.v1beta.IGetServingConfigRequest | null | undefined, {} | null | undefined>): void;
178
178
  getServingConfig(request: protos.google.cloud.discoveryengine.v1beta.IGetServingConfigRequest, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IServingConfig, protos.google.cloud.discoveryengine.v1beta.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}/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.v1beta.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}/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.v1beta.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.v1beta.IListServingConfigsRequest, options?: CallOptions): Promise<[
207
207
  protos.google.cloud.discoveryengine.v1beta.IServingConfig[],
208
208
  protos.google.cloud.discoveryengine.v1beta.IListServingConfigsRequest | null,
@@ -266,55 +266,55 @@ export declare class ServingConfigServiceClient {
266
266
  */
267
267
  listServingConfigsAsync(request?: protos.google.cloud.discoveryengine.v1beta.IListServingConfigsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.discoveryengine.v1beta.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 engine 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
  }
@@ -214,7 +208,7 @@ class ServingConfigServiceClient {
214
208
  // (e.g. 50 results at a time, with tokens to get subsequent
215
209
  // pages). Denote the keys used for pagination and results.
216
210
  this.descriptors.page = {
217
- listServingConfigs: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'servingConfigs'),
211
+ listServingConfigs: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'servingConfigs')
218
212
  };
219
213
  // Put together the default options sent with requests.
220
214
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1beta.ServingConfigService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -243,18 +237,13 @@ class ServingConfigServiceClient {
243
237
  }
244
238
  // Put together the "service stub" for
245
239
  // google.cloud.discoveryengine.v1beta.ServingConfigService.
246
- this.servingConfigServiceStub = this._gaxGrpc.createStub(this._opts.fallback
247
- ? this._protos.lookupService('google.cloud.discoveryengine.v1beta.ServingConfigService')
248
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
249
- this._protos.google.cloud.discoveryengine.v1beta
250
- .ServingConfigService, this._opts, this._providedCustomServicePath);
240
+ this.servingConfigServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
241
+ this._protos.lookupService('google.cloud.discoveryengine.v1beta.ServingConfigService') :
242
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
243
+ this._protos.google.cloud.discoveryengine.v1beta.ServingConfigService, this._opts, this._providedCustomServicePath);
251
244
  // Iterate over each of the methods that the service provides
252
245
  // and create an API call method for each.
253
- const servingConfigServiceStubMethods = [
254
- 'updateServingConfig',
255
- 'getServingConfig',
256
- 'listServingConfigs',
257
- ];
246
+ const servingConfigServiceStubMethods = ['updateServingConfig', 'getServingConfig', 'listServingConfigs'];
258
247
  for (const methodName of servingConfigServiceStubMethods) {
259
248
  const callPromise = this.servingConfigServiceStub.then(stub => (...args) => {
260
249
  if (this._terminated) {
@@ -265,7 +254,8 @@ class ServingConfigServiceClient {
265
254
  }, (err) => () => {
266
255
  throw err;
267
256
  });
268
- const descriptor = this.descriptors.page[methodName] || undefined;
257
+ const descriptor = this.descriptors.page[methodName] ||
258
+ undefined;
269
259
  const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
270
260
  this.innerApiCalls[methodName] = apiCall;
271
261
  }
@@ -277,8 +267,7 @@ class ServingConfigServiceClient {
277
267
  * @returns {string} The DNS address for this service.
278
268
  */
279
269
  static get servicePath() {
280
- if (typeof process === 'object' &&
281
- typeof process.emitWarning === 'function') {
270
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
282
271
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
283
272
  }
284
273
  return 'discoveryengine.googleapis.com';
@@ -289,8 +278,7 @@ class ServingConfigServiceClient {
289
278
  * @returns {string} The DNS address for this service.
290
279
  */
291
280
  static get apiEndpoint() {
292
- if (typeof process === 'object' &&
293
- typeof process.emitWarning === 'function') {
281
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
294
282
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
295
283
  }
296
284
  return 'discoveryengine.googleapis.com';
@@ -318,7 +306,9 @@ class ServingConfigServiceClient {
318
306
  * @returns {string[]} List of default scopes.
319
307
  */
320
308
  static get scopes() {
321
- return ['https://www.googleapis.com/auth/cloud-platform'];
309
+ return [
310
+ 'https://www.googleapis.com/auth/cloud-platform'
311
+ ];
322
312
  }
323
313
  /**
324
314
  * Return the project ID used by this class.
@@ -344,13 +334,10 @@ class ServingConfigServiceClient {
344
334
  options = options || {};
345
335
  options.otherArgs = options.otherArgs || {};
346
336
  options.otherArgs.headers = options.otherArgs.headers || {};
347
- options.otherArgs.headers['x-goog-request-params'] =
348
- this._gaxModule.routingHeader.fromParams({
349
- 'serving_config.name': request.servingConfig.name ?? '',
350
- });
351
- this.initialize().catch(err => {
352
- throw err;
337
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
338
+ 'serving_config.name': request.servingConfig.name ?? '',
353
339
  });
340
+ this.initialize().catch(err => { throw err; });
354
341
  this._log.info('updateServingConfig request %j', request);
355
342
  const wrappedCallback = callback
356
343
  ? (error, response, options, rawResponse) => {
@@ -358,8 +345,7 @@ class ServingConfigServiceClient {
358
345
  callback(error, response, options, rawResponse); // We verified callback above.
359
346
  }
360
347
  : undefined;
361
- return this.innerApiCalls
362
- .updateServingConfig(request, options, wrappedCallback)
348
+ return this.innerApiCalls.updateServingConfig(request, options, wrappedCallback)
363
349
  ?.then(([response, options, rawResponse]) => {
364
350
  this._log.info('updateServingConfig response %j', response);
365
351
  return [response, options, rawResponse];
@@ -378,13 +364,10 @@ class ServingConfigServiceClient {
378
364
  options = options || {};
379
365
  options.otherArgs = options.otherArgs || {};
380
366
  options.otherArgs.headers = options.otherArgs.headers || {};
381
- options.otherArgs.headers['x-goog-request-params'] =
382
- this._gaxModule.routingHeader.fromParams({
383
- name: request.name ?? '',
384
- });
385
- this.initialize().catch(err => {
386
- throw err;
367
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
368
+ 'name': request.name ?? '',
387
369
  });
370
+ this.initialize().catch(err => { throw err; });
388
371
  this._log.info('getServingConfig request %j', request);
389
372
  const wrappedCallback = callback
390
373
  ? (error, response, options, rawResponse) => {
@@ -392,8 +375,7 @@ class ServingConfigServiceClient {
392
375
  callback(error, response, options, rawResponse); // We verified callback above.
393
376
  }
394
377
  : undefined;
395
- return this.innerApiCalls
396
- .getServingConfig(request, options, wrappedCallback)
378
+ return this.innerApiCalls.getServingConfig(request, options, wrappedCallback)
397
379
  ?.then(([response, options, rawResponse]) => {
398
380
  this._log.info('getServingConfig response %j', response);
399
381
  return [response, options, rawResponse];
@@ -412,13 +394,10 @@ class ServingConfigServiceClient {
412
394
  options = options || {};
413
395
  options.otherArgs = options.otherArgs || {};
414
396
  options.otherArgs.headers = options.otherArgs.headers || {};
415
- options.otherArgs.headers['x-goog-request-params'] =
416
- this._gaxModule.routingHeader.fromParams({
417
- parent: request.parent ?? '',
418
- });
419
- this.initialize().catch(err => {
420
- throw err;
397
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
398
+ 'parent': request.parent ?? '',
421
399
  });
400
+ this.initialize().catch(err => { throw err; });
422
401
  const wrappedCallback = callback
423
402
  ? (error, values, nextPageRequest, rawResponse) => {
424
403
  this._log.info('listServingConfigs values %j', values);
@@ -463,15 +442,12 @@ class ServingConfigServiceClient {
463
442
  options = options || {};
464
443
  options.otherArgs = options.otherArgs || {};
465
444
  options.otherArgs.headers = options.otherArgs.headers || {};
466
- options.otherArgs.headers['x-goog-request-params'] =
467
- this._gaxModule.routingHeader.fromParams({
468
- parent: request.parent ?? '',
469
- });
445
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
446
+ 'parent': request.parent ?? '',
447
+ });
470
448
  const defaultCallSettings = this._defaults['listServingConfigs'];
471
449
  const callSettings = defaultCallSettings.merge(options);
472
- this.initialize().catch(err => {
473
- throw err;
474
- });
450
+ this.initialize().catch(err => { throw err; });
475
451
  this._log.info('listServingConfigs stream %j', request);
476
452
  return this.descriptors.page.listServingConfigs.createStream(this.innerApiCalls.listServingConfigs, request, callSettings);
477
453
  }
@@ -508,70 +484,67 @@ class ServingConfigServiceClient {
508
484
  options = options || {};
509
485
  options.otherArgs = options.otherArgs || {};
510
486
  options.otherArgs.headers = options.otherArgs.headers || {};
511
- options.otherArgs.headers['x-goog-request-params'] =
512
- this._gaxModule.routingHeader.fromParams({
513
- parent: request.parent ?? '',
514
- });
487
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
488
+ 'parent': request.parent ?? '',
489
+ });
515
490
  const defaultCallSettings = this._defaults['listServingConfigs'];
516
491
  const callSettings = defaultCallSettings.merge(options);
517
- this.initialize().catch(err => {
518
- throw err;
519
- });
492
+ this.initialize().catch(err => { throw err; });
520
493
  this._log.info('listServingConfigs iterate %j', request);
521
494
  return this.descriptors.page.listServingConfigs.asyncIterate(this.innerApiCalls['listServingConfigs'], request, callSettings);
522
495
  }
523
496
  /**
524
- * Gets information about a location.
525
- *
526
- * @param {Object} request
527
- * The request object that will be sent.
528
- * @param {string} request.name
529
- * Resource name for the location.
530
- * @param {object} [options]
531
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
532
- * @returns {Promise} - The promise which resolves to an array.
533
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
534
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
535
- * for more details and examples.
536
- * @example
537
- * ```
538
- * const [response] = await client.getLocation(request);
539
- * ```
540
- */
497
+ * Gets information about a location.
498
+ *
499
+ * @param {Object} request
500
+ * The request object that will be sent.
501
+ * @param {string} request.name
502
+ * Resource name for the location.
503
+ * @param {object} [options]
504
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
505
+ * @returns {Promise} - The promise which resolves to an array.
506
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
507
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
508
+ * for more details and examples.
509
+ * @example
510
+ * ```
511
+ * const [response] = await client.getLocation(request);
512
+ * ```
513
+ */
541
514
  getLocation(request, options, callback) {
542
515
  return this.locationsClient.getLocation(request, options, callback);
543
516
  }
544
517
  /**
545
- * Lists information about the supported locations for this service. Returns an iterable object.
546
- *
547
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
548
- * @param {Object} request
549
- * The request object that will be sent.
550
- * @param {string} request.name
551
- * The resource that owns the locations collection, if applicable.
552
- * @param {string} request.filter
553
- * The standard list filter.
554
- * @param {number} request.pageSize
555
- * The standard list page size.
556
- * @param {string} request.pageToken
557
- * The standard list page token.
558
- * @param {object} [options]
559
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
560
- * @returns {Object}
561
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
562
- * When you iterate the returned iterable, each element will be an object representing
563
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
564
- * so you can stop the iteration when you don't need more results.
565
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
566
- * for more details and examples.
567
- * @example
568
- * ```
569
- * const iterable = client.listLocationsAsync(request);
570
- * for await (const response of iterable) {
571
- * // process response
572
- * }
573
- * ```
574
- */
518
+ * Lists information about the supported locations for this service. Returns an iterable object.
519
+ *
520
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
521
+ * @param {Object} request
522
+ * The request object that will be sent.
523
+ * @param {string} request.name
524
+ * The resource that owns the locations collection, if applicable.
525
+ * @param {string} request.filter
526
+ * The standard list filter.
527
+ * @param {number} request.pageSize
528
+ * The standard list page size.
529
+ * @param {string} request.pageToken
530
+ * The standard list page token.
531
+ * @param {object} [options]
532
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
533
+ * @returns {Object}
534
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
535
+ * When you iterate the returned iterable, each element will be an object representing
536
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
537
+ * so you can stop the iteration when you don't need more results.
538
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
539
+ * for more details and examples.
540
+ * @example
541
+ * ```
542
+ * const iterable = client.listLocationsAsync(request);
543
+ * for await (const response of iterable) {
544
+ * // process response
545
+ * }
546
+ * ```
547
+ */
575
548
  listLocationsAsync(request, options) {
576
549
  return this.locationsClient.listLocationsAsync(request, options);
577
550
  }
@@ -658,8 +631,7 @@ class ServingConfigServiceClient {
658
631
  * @returns {string} A string representing the project.
659
632
  */
660
633
  matchProjectFromEvaluationName(evaluationName) {
661
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
662
- .project;
634
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
663
635
  }
664
636
  /**
665
637
  * Parse the location from Evaluation resource.
@@ -669,8 +641,7 @@ class ServingConfigServiceClient {
669
641
  * @returns {string} A string representing the location.
670
642
  */
671
643
  matchLocationFromEvaluationName(evaluationName) {
672
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
673
- .location;
644
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
674
645
  }
675
646
  /**
676
647
  * Parse the evaluation from Evaluation resource.
@@ -680,8 +651,7 @@ class ServingConfigServiceClient {
680
651
  * @returns {string} A string representing the evaluation.
681
652
  */
682
653
  matchEvaluationFromEvaluationName(evaluationName) {
683
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
684
- .evaluation;
654
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
685
655
  }
686
656
  /**
687
657
  * Return a fully-qualified groundingConfig resource name string.
@@ -2952,8 +2922,7 @@ class ServingConfigServiceClient {
2952
2922
  * @returns {string} A string representing the project.
2953
2923
  */
2954
2924
  matchProjectFromSampleQueryName(sampleQueryName) {
2955
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2956
- .project;
2925
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
2957
2926
  }
2958
2927
  /**
2959
2928
  * Parse the location from SampleQuery resource.
@@ -2963,8 +2932,7 @@ class ServingConfigServiceClient {
2963
2932
  * @returns {string} A string representing the location.
2964
2933
  */
2965
2934
  matchLocationFromSampleQueryName(sampleQueryName) {
2966
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2967
- .location;
2935
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
2968
2936
  }
2969
2937
  /**
2970
2938
  * Parse the sample_query_set from SampleQuery resource.
@@ -2974,8 +2942,7 @@ class ServingConfigServiceClient {
2974
2942
  * @returns {string} A string representing the sample_query_set.
2975
2943
  */
2976
2944
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
2977
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2978
- .sample_query_set;
2945
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
2979
2946
  }
2980
2947
  /**
2981
2948
  * Parse the sample_query from SampleQuery resource.
@@ -2985,8 +2952,7 @@ class ServingConfigServiceClient {
2985
2952
  * @returns {string} A string representing the sample_query.
2986
2953
  */
2987
2954
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
2988
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2989
- .sample_query;
2955
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
2990
2956
  }
2991
2957
  /**
2992
2958
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -3045,7 +3011,7 @@ class ServingConfigServiceClient {
3045
3011
  this._log.info('ending gRPC channel');
3046
3012
  this._terminated = true;
3047
3013
  stub.close();
3048
- this.locationsClient.close();
3014
+ this.locationsClient.close().catch(err => { throw err; });
3049
3015
  });
3050
3016
  }
3051
3017
  return Promise.resolve();