@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
@@ -175,55 +175,55 @@ export declare class RankServiceClient {
175
175
  rank(request: protos.google.cloud.discoveryengine.v1alpha.IRankRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1alpha.IRankResponse, protos.google.cloud.discoveryengine.v1alpha.IRankRequest | null | undefined, {} | null | undefined>): void;
176
176
  rank(request: protos.google.cloud.discoveryengine.v1alpha.IRankRequest, callback: Callback<protos.google.cloud.discoveryengine.v1alpha.IRankResponse, protos.google.cloud.discoveryengine.v1alpha.IRankRequest | null | undefined, {} | null | undefined>): void;
177
177
  /**
178
- * Gets information about a location.
179
- *
180
- * @param {Object} request
181
- * The request object that will be sent.
182
- * @param {string} request.name
183
- * Resource name for the location.
184
- * @param {object} [options]
185
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
186
- * @returns {Promise} - The promise which resolves to an array.
187
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
188
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
189
- * for more details and examples.
190
- * @example
191
- * ```
192
- * const [response] = await client.getLocation(request);
193
- * ```
194
- */
178
+ * Gets information about a location.
179
+ *
180
+ * @param {Object} request
181
+ * The request object that will be sent.
182
+ * @param {string} request.name
183
+ * Resource name for the location.
184
+ * @param {object} [options]
185
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
186
+ * @returns {Promise} - The promise which resolves to an array.
187
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
188
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
189
+ * for more details and examples.
190
+ * @example
191
+ * ```
192
+ * const [response] = await client.getLocation(request);
193
+ * ```
194
+ */
195
195
  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>;
196
196
  /**
197
- * Lists information about the supported locations for this service. Returns an iterable object.
198
- *
199
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
200
- * @param {Object} request
201
- * The request object that will be sent.
202
- * @param {string} request.name
203
- * The resource that owns the locations collection, if applicable.
204
- * @param {string} request.filter
205
- * The standard list filter.
206
- * @param {number} request.pageSize
207
- * The standard list page size.
208
- * @param {string} request.pageToken
209
- * The standard list page token.
210
- * @param {object} [options]
211
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
212
- * @returns {Object}
213
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
214
- * When you iterate the returned iterable, each element will be an object representing
215
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
216
- * so you can stop the iteration when you don't need more results.
217
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
218
- * for more details and examples.
219
- * @example
220
- * ```
221
- * const iterable = client.listLocationsAsync(request);
222
- * for await (const response of iterable) {
223
- * // process response
224
- * }
225
- * ```
226
- */
197
+ * Lists information about the supported locations for this service. Returns an iterable object.
198
+ *
199
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
200
+ * @param {Object} request
201
+ * The request object that will be sent.
202
+ * @param {string} request.name
203
+ * The resource that owns the locations collection, if applicable.
204
+ * @param {string} request.filter
205
+ * The standard list filter.
206
+ * @param {number} request.pageSize
207
+ * The standard list page size.
208
+ * @param {string} request.pageToken
209
+ * The standard list page token.
210
+ * @param {object} [options]
211
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
212
+ * @returns {Object}
213
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
214
+ * When you iterate the returned iterable, each element will be an object representing
215
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
216
+ * so you can stop the iteration when you don't need more results.
217
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
218
+ * for more details and examples.
219
+ * @example
220
+ * ```
221
+ * const iterable = client.listLocationsAsync(request);
222
+ * for await (const response of iterable) {
223
+ * // process response
224
+ * }
225
+ * ```
226
+ */
227
227
  listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
228
228
  /**
229
229
  * Return a fully-qualified aclConfig resource name string.
@@ -97,26 +97,17 @@ class RankServiceClient {
97
97
  constructor(opts, gaxInstance) {
98
98
  // Ensure that options include all the required fields.
99
99
  const staticMembers = this.constructor;
100
- if (opts?.universe_domain &&
101
- opts?.universeDomain &&
102
- opts?.universe_domain !== opts?.universeDomain) {
100
+ if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
103
101
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
104
102
  }
105
- const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
106
- ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
107
- : undefined;
108
- this._universeDomain =
109
- opts?.universeDomain ??
110
- opts?.universe_domain ??
111
- universeDomainEnvVar ??
112
- 'googleapis.com';
103
+ const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
104
+ this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
113
105
  this._servicePath = 'discoveryengine.' + this._universeDomain;
114
106
  const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
115
107
  this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
116
108
  const port = opts?.port || staticMembers.port;
117
109
  const clientConfig = opts?.clientConfig ?? {};
118
- const fallback = opts?.fallback ??
119
- (typeof window !== 'undefined' && typeof window?.fetch === 'function');
110
+ const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
120
111
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
121
112
  // Request numeric enum values if REST transport is used.
122
113
  opts.numericEnums = true;
@@ -146,7 +137,10 @@ class RankServiceClient {
146
137
  }
147
138
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
148
139
  // Determine the client header string.
149
- const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
140
+ const clientHeader = [
141
+ `gax/${this._gaxModule.version}`,
142
+ `gapic/${version}`,
143
+ ];
150
144
  if (typeof process === 'object' && 'versions' in process) {
151
145
  clientHeader.push(`gl-node/${process.versions.node}`);
152
146
  }
@@ -234,11 +228,10 @@ class RankServiceClient {
234
228
  }
235
229
  // Put together the "service stub" for
236
230
  // google.cloud.discoveryengine.v1alpha.RankService.
237
- this.rankServiceStub = this._gaxGrpc.createStub(this._opts.fallback
238
- ? this._protos.lookupService('google.cloud.discoveryengine.v1alpha.RankService')
239
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
240
- this._protos.google.cloud.discoveryengine.v1alpha
241
- .RankService, this._opts, this._providedCustomServicePath);
231
+ this.rankServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
232
+ this._protos.lookupService('google.cloud.discoveryengine.v1alpha.RankService') :
233
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
234
+ this._protos.google.cloud.discoveryengine.v1alpha.RankService, this._opts, this._providedCustomServicePath);
242
235
  // Iterate over each of the methods that the service provides
243
236
  // and create an API call method for each.
244
237
  const rankServiceStubMethods = ['rank'];
@@ -264,8 +257,7 @@ class RankServiceClient {
264
257
  * @returns {string} The DNS address for this service.
265
258
  */
266
259
  static get servicePath() {
267
- if (typeof process === 'object' &&
268
- typeof process.emitWarning === 'function') {
260
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
269
261
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
270
262
  }
271
263
  return 'discoveryengine.googleapis.com';
@@ -276,8 +268,7 @@ class RankServiceClient {
276
268
  * @returns {string} The DNS address for this service.
277
269
  */
278
270
  static get apiEndpoint() {
279
- if (typeof process === 'object' &&
280
- typeof process.emitWarning === 'function') {
271
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
281
272
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
282
273
  }
283
274
  return 'discoveryengine.googleapis.com';
@@ -305,7 +296,9 @@ class RankServiceClient {
305
296
  * @returns {string[]} List of default scopes.
306
297
  */
307
298
  static get scopes() {
308
- return ['https://www.googleapis.com/auth/cloud-platform'];
299
+ return [
300
+ 'https://www.googleapis.com/auth/cloud-platform'
301
+ ];
309
302
  }
310
303
  /**
311
304
  * Return the project ID used by this class.
@@ -331,13 +324,10 @@ class RankServiceClient {
331
324
  options = options || {};
332
325
  options.otherArgs = options.otherArgs || {};
333
326
  options.otherArgs.headers = options.otherArgs.headers || {};
334
- options.otherArgs.headers['x-goog-request-params'] =
335
- this._gaxModule.routingHeader.fromParams({
336
- ranking_config: request.rankingConfig ?? '',
337
- });
338
- this.initialize().catch(err => {
339
- throw err;
327
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
328
+ 'ranking_config': request.rankingConfig ?? '',
340
329
  });
330
+ this.initialize().catch(err => { throw err; });
341
331
  this._log.info('rank request %j', request);
342
332
  const wrappedCallback = callback
343
333
  ? (error, response, options, rawResponse) => {
@@ -345,65 +335,70 @@ class RankServiceClient {
345
335
  callback(error, response, options, rawResponse); // We verified callback above.
346
336
  }
347
337
  : undefined;
348
- return this.innerApiCalls
349
- .rank(request, options, wrappedCallback)
338
+ return this.innerApiCalls.rank(request, options, wrappedCallback)
350
339
  ?.then(([response, options, rawResponse]) => {
351
340
  this._log.info('rank response %j', response);
352
341
  return [response, options, rawResponse];
342
+ }).catch((error) => {
343
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
344
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
345
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
346
+ }
347
+ throw error;
353
348
  });
354
349
  }
355
350
  /**
356
- * Gets information about a location.
357
- *
358
- * @param {Object} request
359
- * The request object that will be sent.
360
- * @param {string} request.name
361
- * Resource name for the location.
362
- * @param {object} [options]
363
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
364
- * @returns {Promise} - The promise which resolves to an array.
365
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
366
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
367
- * for more details and examples.
368
- * @example
369
- * ```
370
- * const [response] = await client.getLocation(request);
371
- * ```
372
- */
351
+ * Gets information about a location.
352
+ *
353
+ * @param {Object} request
354
+ * The request object that will be sent.
355
+ * @param {string} request.name
356
+ * Resource name for the location.
357
+ * @param {object} [options]
358
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
359
+ * @returns {Promise} - The promise which resolves to an array.
360
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
361
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
362
+ * for more details and examples.
363
+ * @example
364
+ * ```
365
+ * const [response] = await client.getLocation(request);
366
+ * ```
367
+ */
373
368
  getLocation(request, options, callback) {
374
369
  return this.locationsClient.getLocation(request, options, callback);
375
370
  }
376
371
  /**
377
- * Lists information about the supported locations for this service. Returns an iterable object.
378
- *
379
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
380
- * @param {Object} request
381
- * The request object that will be sent.
382
- * @param {string} request.name
383
- * The resource that owns the locations collection, if applicable.
384
- * @param {string} request.filter
385
- * The standard list filter.
386
- * @param {number} request.pageSize
387
- * The standard list page size.
388
- * @param {string} request.pageToken
389
- * The standard list page token.
390
- * @param {object} [options]
391
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
392
- * @returns {Object}
393
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
394
- * When you iterate the returned iterable, each element will be an object representing
395
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
396
- * so you can stop the iteration when you don't need more results.
397
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
398
- * for more details and examples.
399
- * @example
400
- * ```
401
- * const iterable = client.listLocationsAsync(request);
402
- * for await (const response of iterable) {
403
- * // process response
404
- * }
405
- * ```
406
- */
372
+ * Lists information about the supported locations for this service. Returns an iterable object.
373
+ *
374
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
375
+ * @param {Object} request
376
+ * The request object that will be sent.
377
+ * @param {string} request.name
378
+ * The resource that owns the locations collection, if applicable.
379
+ * @param {string} request.filter
380
+ * The standard list filter.
381
+ * @param {number} request.pageSize
382
+ * The standard list page size.
383
+ * @param {string} request.pageToken
384
+ * The standard list page token.
385
+ * @param {object} [options]
386
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
387
+ * @returns {Object}
388
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
389
+ * When you iterate the returned iterable, each element will be an object representing
390
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
391
+ * so you can stop the iteration when you don't need more results.
392
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
393
+ * for more details and examples.
394
+ * @example
395
+ * ```
396
+ * const iterable = client.listLocationsAsync(request);
397
+ * for await (const response of iterable) {
398
+ * // process response
399
+ * }
400
+ * ```
401
+ */
407
402
  listLocationsAsync(request, options) {
408
403
  return this.locationsClient.listLocationsAsync(request, options);
409
404
  }
@@ -431,8 +426,7 @@ class RankServiceClient {
431
426
  * @returns {string} A string representing the project.
432
427
  */
433
428
  matchProjectFromAclConfigName(aclConfigName) {
434
- return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
435
- .project;
429
+ return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).project;
436
430
  }
437
431
  /**
438
432
  * Parse the location from AclConfig resource.
@@ -442,8 +436,7 @@ class RankServiceClient {
442
436
  * @returns {string} A string representing the location.
443
437
  */
444
438
  matchLocationFromAclConfigName(aclConfigName) {
445
- return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName)
446
- .location;
439
+ return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName).location;
447
440
  }
448
441
  /**
449
442
  * Return a fully-qualified engine resource name string.
@@ -525,8 +518,7 @@ class RankServiceClient {
525
518
  * @returns {string} A string representing the project.
526
519
  */
527
520
  matchProjectFromEvaluationName(evaluationName) {
528
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
529
- .project;
521
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project;
530
522
  }
531
523
  /**
532
524
  * Parse the location from Evaluation resource.
@@ -536,8 +528,7 @@ class RankServiceClient {
536
528
  * @returns {string} A string representing the location.
537
529
  */
538
530
  matchLocationFromEvaluationName(evaluationName) {
539
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
540
- .location;
531
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location;
541
532
  }
542
533
  /**
543
534
  * Parse the evaluation from Evaluation resource.
@@ -547,8 +538,7 @@ class RankServiceClient {
547
538
  * @returns {string} A string representing the evaluation.
548
539
  */
549
540
  matchEvaluationFromEvaluationName(evaluationName) {
550
- return this.pathTemplates.evaluationPathTemplate.match(evaluationName)
551
- .evaluation;
541
+ return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation;
552
542
  }
553
543
  /**
554
544
  * Return a fully-qualified project resource name string.
@@ -2613,8 +2603,7 @@ class RankServiceClient {
2613
2603
  * @returns {string} A string representing the project.
2614
2604
  */
2615
2605
  matchProjectFromRankingConfigName(rankingConfigName) {
2616
- return this.pathTemplates.rankingConfigPathTemplate.match(rankingConfigName)
2617
- .project;
2606
+ return this.pathTemplates.rankingConfigPathTemplate.match(rankingConfigName).project;
2618
2607
  }
2619
2608
  /**
2620
2609
  * Parse the location from RankingConfig resource.
@@ -2624,8 +2613,7 @@ class RankServiceClient {
2624
2613
  * @returns {string} A string representing the location.
2625
2614
  */
2626
2615
  matchLocationFromRankingConfigName(rankingConfigName) {
2627
- return this.pathTemplates.rankingConfigPathTemplate.match(rankingConfigName)
2628
- .location;
2616
+ return this.pathTemplates.rankingConfigPathTemplate.match(rankingConfigName).location;
2629
2617
  }
2630
2618
  /**
2631
2619
  * Parse the ranking_config from RankingConfig resource.
@@ -2635,8 +2623,7 @@ class RankServiceClient {
2635
2623
  * @returns {string} A string representing the ranking_config.
2636
2624
  */
2637
2625
  matchRankingConfigFromRankingConfigName(rankingConfigName) {
2638
- return this.pathTemplates.rankingConfigPathTemplate.match(rankingConfigName)
2639
- .ranking_config;
2626
+ return this.pathTemplates.rankingConfigPathTemplate.match(rankingConfigName).ranking_config;
2640
2627
  }
2641
2628
  /**
2642
2629
  * Return a fully-qualified sampleQuery resource name string.
@@ -2663,8 +2650,7 @@ class RankServiceClient {
2663
2650
  * @returns {string} A string representing the project.
2664
2651
  */
2665
2652
  matchProjectFromSampleQueryName(sampleQueryName) {
2666
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2667
- .project;
2653
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).project;
2668
2654
  }
2669
2655
  /**
2670
2656
  * Parse the location from SampleQuery resource.
@@ -2674,8 +2660,7 @@ class RankServiceClient {
2674
2660
  * @returns {string} A string representing the location.
2675
2661
  */
2676
2662
  matchLocationFromSampleQueryName(sampleQueryName) {
2677
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2678
- .location;
2663
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).location;
2679
2664
  }
2680
2665
  /**
2681
2666
  * Parse the sample_query_set from SampleQuery resource.
@@ -2685,8 +2670,7 @@ class RankServiceClient {
2685
2670
  * @returns {string} A string representing the sample_query_set.
2686
2671
  */
2687
2672
  matchSampleQuerySetFromSampleQueryName(sampleQueryName) {
2688
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2689
- .sample_query_set;
2673
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query_set;
2690
2674
  }
2691
2675
  /**
2692
2676
  * Parse the sample_query from SampleQuery resource.
@@ -2696,8 +2680,7 @@ class RankServiceClient {
2696
2680
  * @returns {string} A string representing the sample_query.
2697
2681
  */
2698
2682
  matchSampleQueryFromSampleQueryName(sampleQueryName) {
2699
- return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName)
2700
- .sample_query;
2683
+ return this.pathTemplates.sampleQueryPathTemplate.match(sampleQueryName).sample_query;
2701
2684
  }
2702
2685
  /**
2703
2686
  * Return a fully-qualified sampleQuerySet resource name string.
@@ -2756,7 +2739,7 @@ class RankServiceClient {
2756
2739
  this._log.info('ending gRPC channel');
2757
2740
  this._terminated = true;
2758
2741
  stub.close();
2759
- this.locationsClient.close();
2742
+ this.locationsClient.close().catch(err => { throw err; });
2760
2743
  });
2761
2744
  }
2762
2745
  return Promise.resolve();
@@ -253,55 +253,55 @@ export declare class RecommendationServiceClient {
253
253
  recommend(request: protos.google.cloud.discoveryengine.v1alpha.IRecommendRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1alpha.IRecommendResponse, protos.google.cloud.discoveryengine.v1alpha.IRecommendRequest | null | undefined, {} | null | undefined>): void;
254
254
  recommend(request: protos.google.cloud.discoveryengine.v1alpha.IRecommendRequest, callback: Callback<protos.google.cloud.discoveryengine.v1alpha.IRecommendResponse, protos.google.cloud.discoveryengine.v1alpha.IRecommendRequest | null | undefined, {} | null | undefined>): void;
255
255
  /**
256
- * Gets information about a location.
257
- *
258
- * @param {Object} request
259
- * The request object that will be sent.
260
- * @param {string} request.name
261
- * Resource name for the location.
262
- * @param {object} [options]
263
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
264
- * @returns {Promise} - The promise which resolves to an array.
265
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
266
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
267
- * for more details and examples.
268
- * @example
269
- * ```
270
- * const [response] = await client.getLocation(request);
271
- * ```
272
- */
256
+ * Gets information about a location.
257
+ *
258
+ * @param {Object} request
259
+ * The request object that will be sent.
260
+ * @param {string} request.name
261
+ * Resource name for the location.
262
+ * @param {object} [options]
263
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
264
+ * @returns {Promise} - The promise which resolves to an array.
265
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
266
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
267
+ * for more details and examples.
268
+ * @example
269
+ * ```
270
+ * const [response] = await client.getLocation(request);
271
+ * ```
272
+ */
273
273
  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>;
274
274
  /**
275
- * Lists information about the supported locations for this service. Returns an iterable object.
276
- *
277
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
278
- * @param {Object} request
279
- * The request object that will be sent.
280
- * @param {string} request.name
281
- * The resource that owns the locations collection, if applicable.
282
- * @param {string} request.filter
283
- * The standard list filter.
284
- * @param {number} request.pageSize
285
- * The standard list page size.
286
- * @param {string} request.pageToken
287
- * The standard list page token.
288
- * @param {object} [options]
289
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
290
- * @returns {Object}
291
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
292
- * When you iterate the returned iterable, each element will be an object representing
293
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
294
- * so you can stop the iteration when you don't need more results.
295
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
296
- * for more details and examples.
297
- * @example
298
- * ```
299
- * const iterable = client.listLocationsAsync(request);
300
- * for await (const response of iterable) {
301
- * // process response
302
- * }
303
- * ```
304
- */
275
+ * Lists information about the supported locations for this service. Returns an iterable object.
276
+ *
277
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
278
+ * @param {Object} request
279
+ * The request object that will be sent.
280
+ * @param {string} request.name
281
+ * The resource that owns the locations collection, if applicable.
282
+ * @param {string} request.filter
283
+ * The standard list filter.
284
+ * @param {number} request.pageSize
285
+ * The standard list page size.
286
+ * @param {string} request.pageToken
287
+ * The standard list page token.
288
+ * @param {object} [options]
289
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
290
+ * @returns {Object}
291
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
292
+ * When you iterate the returned iterable, each element will be an object representing
293
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
294
+ * so you can stop the iteration when you don't need more results.
295
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
296
+ * for more details and examples.
297
+ * @example
298
+ * ```
299
+ * const iterable = client.listLocationsAsync(request);
300
+ * for await (const response of iterable) {
301
+ * // process response
302
+ * }
303
+ * ```
304
+ */
305
305
  listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
306
306
  /**
307
307
  * Return a fully-qualified aclConfig resource name string.