@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
@@ -99,26 +99,17 @@ class DocumentServiceClient {
99
99
  constructor(opts, gaxInstance) {
100
100
  // Ensure that options include all the required fields.
101
101
  const staticMembers = this.constructor;
102
- if (opts?.universe_domain &&
103
- opts?.universeDomain &&
104
- opts?.universe_domain !== opts?.universeDomain) {
102
+ if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
105
103
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
106
104
  }
107
- const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
108
- ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
109
- : undefined;
110
- this._universeDomain =
111
- opts?.universeDomain ??
112
- opts?.universe_domain ??
113
- universeDomainEnvVar ??
114
- 'googleapis.com';
105
+ const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
106
+ this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
115
107
  this._servicePath = 'discoveryengine.' + this._universeDomain;
116
108
  const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
117
109
  this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
118
110
  const port = opts?.port || staticMembers.port;
119
111
  const clientConfig = opts?.clientConfig ?? {};
120
- const fallback = opts?.fallback ??
121
- (typeof window !== 'undefined' && typeof window?.fetch === 'function');
112
+ const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
122
113
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
123
114
  // Request numeric enum values if REST transport is used.
124
115
  opts.numericEnums = true;
@@ -148,7 +139,10 @@ class DocumentServiceClient {
148
139
  }
149
140
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
150
141
  // Determine the client header string.
151
- const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
142
+ const clientHeader = [
143
+ `gax/${this._gaxModule.version}`,
144
+ `gapic/${version}`,
145
+ ];
152
146
  if (typeof process === 'object' && 'versions' in process) {
153
147
  clientHeader.push(`gl-node/${process.versions.node}`);
154
148
  }
@@ -171,7 +165,10 @@ class DocumentServiceClient {
171
165
  // Create useful helper objects for these.
172
166
  this.pathTemplates = {
173
167
  enginePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/engines/{engine}'),
168
+ identityMappingStorePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/identityMappingStores/{identity_mapping_store}'),
174
169
  projectPathTemplate: new this._gaxModule.PathTemplate('projects/{project}'),
170
+ projectLocationCmekConfigPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/cmekConfig'),
171
+ projectLocationCmekConfigsPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/cmekConfigs/{cmek_config}'),
175
172
  projectLocationCollectionDataStorePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}'),
176
173
  projectLocationCollectionDataStoreBranchPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}'),
177
174
  projectLocationCollectionDataStoreBranchDocumentPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}'),
@@ -212,136 +209,31 @@ class DocumentServiceClient {
212
209
  // (e.g. 50 results at a time, with tokens to get subsequent
213
210
  // pages). Denote the keys used for pagination and results.
214
211
  this.descriptors.page = {
215
- listDocuments: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'documents'),
212
+ listDocuments: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'documents')
216
213
  };
217
- const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
214
+ const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos);
218
215
  // This API contains "long-running operations", which return a
219
216
  // an Operation object that allows for tracking of the operation,
220
217
  // rather than holding a request open.
221
218
  const lroOptions = {
222
219
  auth: this.auth,
223
- grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
220
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
224
221
  };
225
222
  if (opts.fallback) {
226
223
  lroOptions.protoJson = protoFilesRoot;
227
- lroOptions.httpRules = [
228
- {
229
- selector: 'google.longrunning.Operations.CancelOperation',
230
- post: '/v1/{name=projects/*/operations/*}:cancel',
231
- body: '*',
232
- additional_bindings: [
233
- {
234
- post: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel',
235
- body: '*',
236
- },
237
- {
238
- post: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel',
239
- body: '*',
240
- },
241
- ],
242
- },
243
- {
244
- selector: 'google.longrunning.Operations.GetOperation',
245
- get: '/v1/{name=projects/*/operations/*}',
246
- additional_bindings: [
247
- {
248
- get: '/v1/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}',
249
- },
250
- {
251
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
252
- },
253
- {
254
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
255
- },
256
- {
257
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
258
- },
259
- {
260
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
261
- },
262
- {
263
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
264
- },
265
- {
266
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
267
- },
268
- {
269
- get: '/v1/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
270
- },
271
- {
272
- get: '/v1/{name=projects/*/locations/*/collections/*/operations/*}',
273
- },
274
- {
275
- get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
276
- },
277
- {
278
- get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
279
- },
280
- {
281
- get: '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}',
282
- },
283
- {
284
- get: '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}',
285
- },
286
- { get: '/v1/{name=projects/*/locations/*/operations/*}' },
287
- { get: '/v1/{name=projects/*/operations/*}' },
288
- ],
289
- },
290
- {
291
- selector: 'google.longrunning.Operations.ListOperations',
292
- get: '/v1/{name=projects/*}/operations',
293
- additional_bindings: [
294
- {
295
- get: '/v1/{name=projects/*/locations/*/collections/*/dataConnector}/operations',
296
- },
297
- {
298
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
299
- },
300
- {
301
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
302
- },
303
- {
304
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
305
- },
306
- {
307
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
308
- },
309
- {
310
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
311
- },
312
- {
313
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
314
- },
315
- {
316
- get: '/v1/{name=projects/*/locations/*/collections/*/engines/*}/operations',
317
- },
318
- { get: '/v1/{name=projects/*/locations/*/collections/*}/operations' },
319
- {
320
- get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
321
- },
322
- {
323
- get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
324
- },
325
- { get: '/v1/{name=projects/*/locations/*/dataStores/*}/operations' },
326
- {
327
- get: '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations',
328
- },
329
- { get: '/v1/{name=projects/*/locations/*}/operations' },
330
- { get: '/v1/{name=projects/*}/operations' },
331
- ],
332
- },
333
- ];
224
+ lroOptions.httpRules = [{ selector: 'google.longrunning.Operations.CancelOperation', post: '/v1/{name=projects/*/operations/*}:cancel', body: '*', additional_bindings: [{ post: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', }, { post: '/v1/{name=projects/*/locations/*/collections/*/engines/*/operations/*}:cancel', body: '*', }, { post: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}:cancel', body: '*', }],
225
+ }, { selector: 'google.longrunning.Operations.GetOperation', get: '/v1/{name=projects/*/operations/*}', additional_bindings: [{ get: '/v1/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/engines/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/collections/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}', }, { get: '/v1/{name=projects/*/locations/*/operations/*}', }, { get: '/v1/{name=projects/*/operations/*}', }],
226
+ }, { selector: 'google.longrunning.Operations.ListOperations', get: '/v1/{name=projects/*}/operations', additional_bindings: [{ get: '/v1/{name=projects/*/locations/*/collections/*/dataConnector}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*/engines/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/collections/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/dataStores/*}/operations', }, { get: '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations', }, { get: '/v1/{name=projects/*/locations/*}/operations', }, { get: '/v1/{name=projects/*}/operations', }],
227
+ }];
334
228
  }
335
- this.operationsClient = this._gaxModule
336
- .lro(lroOptions)
337
- .operationsClient(opts);
229
+ this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
338
230
  const importDocumentsResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.ImportDocumentsResponse');
339
231
  const importDocumentsMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.ImportDocumentsMetadata');
340
232
  const purgeDocumentsResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.PurgeDocumentsResponse');
341
233
  const purgeDocumentsMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.PurgeDocumentsMetadata');
342
234
  this.descriptors.longrunning = {
343
235
  importDocuments: new this._gaxModule.LongrunningDescriptor(this.operationsClient, importDocumentsResponse.decode.bind(importDocumentsResponse), importDocumentsMetadata.decode.bind(importDocumentsMetadata)),
344
- purgeDocuments: new this._gaxModule.LongrunningDescriptor(this.operationsClient, purgeDocumentsResponse.decode.bind(purgeDocumentsResponse), purgeDocumentsMetadata.decode.bind(purgeDocumentsMetadata)),
236
+ purgeDocuments: new this._gaxModule.LongrunningDescriptor(this.operationsClient, purgeDocumentsResponse.decode.bind(purgeDocumentsResponse), purgeDocumentsMetadata.decode.bind(purgeDocumentsMetadata))
345
237
  };
346
238
  // Put together the default options sent with requests.
347
239
  this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1.DocumentService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
@@ -370,22 +262,13 @@ class DocumentServiceClient {
370
262
  }
371
263
  // Put together the "service stub" for
372
264
  // google.cloud.discoveryengine.v1.DocumentService.
373
- this.documentServiceStub = this._gaxGrpc.createStub(this._opts.fallback
374
- ? this._protos.lookupService('google.cloud.discoveryengine.v1.DocumentService')
375
- : // eslint-disable-next-line @typescript-eslint/no-explicit-any
376
- this._protos.google.cloud.discoveryengine.v1.DocumentService, this._opts, this._providedCustomServicePath);
265
+ this.documentServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
266
+ this._protos.lookupService('google.cloud.discoveryengine.v1.DocumentService') :
267
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
268
+ this._protos.google.cloud.discoveryengine.v1.DocumentService, this._opts, this._providedCustomServicePath);
377
269
  // Iterate over each of the methods that the service provides
378
270
  // and create an API call method for each.
379
- const documentServiceStubMethods = [
380
- 'getDocument',
381
- 'listDocuments',
382
- 'createDocument',
383
- 'updateDocument',
384
- 'deleteDocument',
385
- 'importDocuments',
386
- 'purgeDocuments',
387
- 'batchGetDocumentsMetadata',
388
- ];
271
+ const documentServiceStubMethods = ['getDocument', 'listDocuments', 'createDocument', 'updateDocument', 'deleteDocument', 'importDocuments', 'purgeDocuments', 'batchGetDocumentsMetadata'];
389
272
  for (const methodName of documentServiceStubMethods) {
390
273
  const callPromise = this.documentServiceStub.then(stub => (...args) => {
391
274
  if (this._terminated) {
@@ -410,8 +293,7 @@ class DocumentServiceClient {
410
293
  * @returns {string} The DNS address for this service.
411
294
  */
412
295
  static get servicePath() {
413
- if (typeof process === 'object' &&
414
- typeof process.emitWarning === 'function') {
296
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
415
297
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
416
298
  }
417
299
  return 'discoveryengine.googleapis.com';
@@ -422,8 +304,7 @@ class DocumentServiceClient {
422
304
  * @returns {string} The DNS address for this service.
423
305
  */
424
306
  static get apiEndpoint() {
425
- if (typeof process === 'object' &&
426
- typeof process.emitWarning === 'function') {
307
+ if (typeof process === 'object' && typeof process.emitWarning === 'function') {
427
308
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
428
309
  }
429
310
  return 'discoveryengine.googleapis.com';
@@ -451,7 +332,9 @@ class DocumentServiceClient {
451
332
  * @returns {string[]} List of default scopes.
452
333
  */
453
334
  static get scopes() {
454
- return ['https://www.googleapis.com/auth/cloud-platform'];
335
+ return [
336
+ 'https://www.googleapis.com/auth/cloud-platform'
337
+ ];
455
338
  }
456
339
  /**
457
340
  * Return the project ID used by this class.
@@ -477,13 +360,10 @@ class DocumentServiceClient {
477
360
  options = options || {};
478
361
  options.otherArgs = options.otherArgs || {};
479
362
  options.otherArgs.headers = options.otherArgs.headers || {};
480
- options.otherArgs.headers['x-goog-request-params'] =
481
- this._gaxModule.routingHeader.fromParams({
482
- name: request.name ?? '',
483
- });
484
- this.initialize().catch(err => {
485
- throw err;
363
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
364
+ 'name': request.name ?? '',
486
365
  });
366
+ this.initialize().catch(err => { throw err; });
487
367
  this._log.info('getDocument request %j', request);
488
368
  const wrappedCallback = callback
489
369
  ? (error, response, options, rawResponse) => {
@@ -491,11 +371,16 @@ class DocumentServiceClient {
491
371
  callback(error, response, options, rawResponse); // We verified callback above.
492
372
  }
493
373
  : undefined;
494
- return this.innerApiCalls
495
- .getDocument(request, options, wrappedCallback)
374
+ return this.innerApiCalls.getDocument(request, options, wrappedCallback)
496
375
  ?.then(([response, options, rawResponse]) => {
497
376
  this._log.info('getDocument response %j', response);
498
377
  return [response, options, rawResponse];
378
+ }).catch((error) => {
379
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
380
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
381
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
382
+ }
383
+ throw error;
499
384
  });
500
385
  }
501
386
  createDocument(request, optionsOrCallback, callback) {
@@ -511,13 +396,10 @@ class DocumentServiceClient {
511
396
  options = options || {};
512
397
  options.otherArgs = options.otherArgs || {};
513
398
  options.otherArgs.headers = options.otherArgs.headers || {};
514
- options.otherArgs.headers['x-goog-request-params'] =
515
- this._gaxModule.routingHeader.fromParams({
516
- parent: request.parent ?? '',
517
- });
518
- this.initialize().catch(err => {
519
- throw err;
399
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
400
+ 'parent': request.parent ?? '',
520
401
  });
402
+ this.initialize().catch(err => { throw err; });
521
403
  this._log.info('createDocument request %j', request);
522
404
  const wrappedCallback = callback
523
405
  ? (error, response, options, rawResponse) => {
@@ -525,11 +407,16 @@ class DocumentServiceClient {
525
407
  callback(error, response, options, rawResponse); // We verified callback above.
526
408
  }
527
409
  : undefined;
528
- return this.innerApiCalls
529
- .createDocument(request, options, wrappedCallback)
410
+ return this.innerApiCalls.createDocument(request, options, wrappedCallback)
530
411
  ?.then(([response, options, rawResponse]) => {
531
412
  this._log.info('createDocument response %j', response);
532
413
  return [response, options, rawResponse];
414
+ }).catch((error) => {
415
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
416
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
417
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
418
+ }
419
+ throw error;
533
420
  });
534
421
  }
535
422
  updateDocument(request, optionsOrCallback, callback) {
@@ -545,13 +432,10 @@ class DocumentServiceClient {
545
432
  options = options || {};
546
433
  options.otherArgs = options.otherArgs || {};
547
434
  options.otherArgs.headers = options.otherArgs.headers || {};
548
- options.otherArgs.headers['x-goog-request-params'] =
549
- this._gaxModule.routingHeader.fromParams({
550
- 'document.name': request.document.name ?? '',
551
- });
552
- this.initialize().catch(err => {
553
- throw err;
435
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
436
+ 'document.name': request.document.name ?? '',
554
437
  });
438
+ this.initialize().catch(err => { throw err; });
555
439
  this._log.info('updateDocument request %j', request);
556
440
  const wrappedCallback = callback
557
441
  ? (error, response, options, rawResponse) => {
@@ -559,11 +443,16 @@ class DocumentServiceClient {
559
443
  callback(error, response, options, rawResponse); // We verified callback above.
560
444
  }
561
445
  : undefined;
562
- return this.innerApiCalls
563
- .updateDocument(request, options, wrappedCallback)
446
+ return this.innerApiCalls.updateDocument(request, options, wrappedCallback)
564
447
  ?.then(([response, options, rawResponse]) => {
565
448
  this._log.info('updateDocument response %j', response);
566
449
  return [response, options, rawResponse];
450
+ }).catch((error) => {
451
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
452
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
453
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
454
+ }
455
+ throw error;
567
456
  });
568
457
  }
569
458
  deleteDocument(request, optionsOrCallback, callback) {
@@ -579,13 +468,10 @@ class DocumentServiceClient {
579
468
  options = options || {};
580
469
  options.otherArgs = options.otherArgs || {};
581
470
  options.otherArgs.headers = options.otherArgs.headers || {};
582
- options.otherArgs.headers['x-goog-request-params'] =
583
- this._gaxModule.routingHeader.fromParams({
584
- name: request.name ?? '',
585
- });
586
- this.initialize().catch(err => {
587
- throw err;
471
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
472
+ 'name': request.name ?? '',
588
473
  });
474
+ this.initialize().catch(err => { throw err; });
589
475
  this._log.info('deleteDocument request %j', request);
590
476
  const wrappedCallback = callback
591
477
  ? (error, response, options, rawResponse) => {
@@ -593,11 +479,16 @@ class DocumentServiceClient {
593
479
  callback(error, response, options, rawResponse); // We verified callback above.
594
480
  }
595
481
  : undefined;
596
- return this.innerApiCalls
597
- .deleteDocument(request, options, wrappedCallback)
482
+ return this.innerApiCalls.deleteDocument(request, options, wrappedCallback)
598
483
  ?.then(([response, options, rawResponse]) => {
599
484
  this._log.info('deleteDocument response %j', response);
600
485
  return [response, options, rawResponse];
486
+ }).catch((error) => {
487
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
488
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
489
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
490
+ }
491
+ throw error;
601
492
  });
602
493
  }
603
494
  batchGetDocumentsMetadata(request, optionsOrCallback, callback) {
@@ -613,13 +504,10 @@ class DocumentServiceClient {
613
504
  options = options || {};
614
505
  options.otherArgs = options.otherArgs || {};
615
506
  options.otherArgs.headers = options.otherArgs.headers || {};
616
- options.otherArgs.headers['x-goog-request-params'] =
617
- this._gaxModule.routingHeader.fromParams({
618
- parent: request.parent ?? '',
619
- });
620
- this.initialize().catch(err => {
621
- throw err;
507
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
508
+ 'parent': request.parent ?? '',
622
509
  });
510
+ this.initialize().catch(err => { throw err; });
623
511
  this._log.info('batchGetDocumentsMetadata request %j', request);
624
512
  const wrappedCallback = callback
625
513
  ? (error, response, options, rawResponse) => {
@@ -627,11 +515,16 @@ class DocumentServiceClient {
627
515
  callback(error, response, options, rawResponse); // We verified callback above.
628
516
  }
629
517
  : undefined;
630
- return this.innerApiCalls
631
- .batchGetDocumentsMetadata(request, options, wrappedCallback)
518
+ return this.innerApiCalls.batchGetDocumentsMetadata(request, options, wrappedCallback)
632
519
  ?.then(([response, options, rawResponse]) => {
633
520
  this._log.info('batchGetDocumentsMetadata response %j', response);
634
521
  return [response, options, rawResponse];
522
+ }).catch((error) => {
523
+ if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
524
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
525
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
526
+ }
527
+ throw error;
635
528
  });
636
529
  }
637
530
  importDocuments(request, optionsOrCallback, callback) {
@@ -647,13 +540,10 @@ class DocumentServiceClient {
647
540
  options = options || {};
648
541
  options.otherArgs = options.otherArgs || {};
649
542
  options.otherArgs.headers = options.otherArgs.headers || {};
650
- options.otherArgs.headers['x-goog-request-params'] =
651
- this._gaxModule.routingHeader.fromParams({
652
- parent: request.parent ?? '',
653
- });
654
- this.initialize().catch(err => {
655
- throw err;
543
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
544
+ 'parent': request.parent ?? '',
656
545
  });
546
+ this.initialize().catch(err => { throw err; });
657
547
  const wrappedCallback = callback
658
548
  ? (error, response, rawResponse, _) => {
659
549
  this._log.info('importDocuments response %j', rawResponse);
@@ -661,8 +551,7 @@ class DocumentServiceClient {
661
551
  }
662
552
  : undefined;
663
553
  this._log.info('importDocuments request %j', request);
664
- return this.innerApiCalls
665
- .importDocuments(request, options, wrappedCallback)
554
+ return this.innerApiCalls.importDocuments(request, options, wrappedCallback)
666
555
  ?.then(([response, rawResponse, _]) => {
667
556
  this._log.info('importDocuments response %j', rawResponse);
668
557
  return [response, rawResponse, _];
@@ -699,13 +588,10 @@ class DocumentServiceClient {
699
588
  options = options || {};
700
589
  options.otherArgs = options.otherArgs || {};
701
590
  options.otherArgs.headers = options.otherArgs.headers || {};
702
- options.otherArgs.headers['x-goog-request-params'] =
703
- this._gaxModule.routingHeader.fromParams({
704
- parent: request.parent ?? '',
705
- });
706
- this.initialize().catch(err => {
707
- throw err;
591
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
592
+ 'parent': request.parent ?? '',
708
593
  });
594
+ this.initialize().catch(err => { throw err; });
709
595
  const wrappedCallback = callback
710
596
  ? (error, response, rawResponse, _) => {
711
597
  this._log.info('purgeDocuments response %j', rawResponse);
@@ -713,8 +599,7 @@ class DocumentServiceClient {
713
599
  }
714
600
  : undefined;
715
601
  this._log.info('purgeDocuments request %j', request);
716
- return this.innerApiCalls
717
- .purgeDocuments(request, options, wrappedCallback)
602
+ return this.innerApiCalls.purgeDocuments(request, options, wrappedCallback)
718
603
  ?.then(([response, rawResponse, _]) => {
719
604
  this._log.info('purgeDocuments response %j', rawResponse);
720
605
  return [response, rawResponse, _];
@@ -751,13 +636,10 @@ class DocumentServiceClient {
751
636
  options = options || {};
752
637
  options.otherArgs = options.otherArgs || {};
753
638
  options.otherArgs.headers = options.otherArgs.headers || {};
754
- options.otherArgs.headers['x-goog-request-params'] =
755
- this._gaxModule.routingHeader.fromParams({
756
- parent: request.parent ?? '',
757
- });
758
- this.initialize().catch(err => {
759
- throw err;
639
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
640
+ 'parent': request.parent ?? '',
760
641
  });
642
+ this.initialize().catch(err => { throw err; });
761
643
  const wrappedCallback = callback
762
644
  ? (error, values, nextPageRequest, rawResponse) => {
763
645
  this._log.info('listDocuments values %j', values);
@@ -819,15 +701,12 @@ class DocumentServiceClient {
819
701
  options = options || {};
820
702
  options.otherArgs = options.otherArgs || {};
821
703
  options.otherArgs.headers = options.otherArgs.headers || {};
822
- options.otherArgs.headers['x-goog-request-params'] =
823
- this._gaxModule.routingHeader.fromParams({
824
- parent: request.parent ?? '',
825
- });
704
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
705
+ 'parent': request.parent ?? '',
706
+ });
826
707
  const defaultCallSettings = this._defaults['listDocuments'];
827
708
  const callSettings = defaultCallSettings.merge(options);
828
- this.initialize().catch(err => {
829
- throw err;
830
- });
709
+ this.initialize().catch(err => { throw err; });
831
710
  this._log.info('listDocuments stream %j', request);
832
711
  return this.descriptors.page.listDocuments.createStream(this.innerApiCalls.listDocuments, request, callSettings);
833
712
  }
@@ -881,103 +760,100 @@ class DocumentServiceClient {
881
760
  options = options || {};
882
761
  options.otherArgs = options.otherArgs || {};
883
762
  options.otherArgs.headers = options.otherArgs.headers || {};
884
- options.otherArgs.headers['x-goog-request-params'] =
885
- this._gaxModule.routingHeader.fromParams({
886
- parent: request.parent ?? '',
887
- });
763
+ options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
764
+ 'parent': request.parent ?? '',
765
+ });
888
766
  const defaultCallSettings = this._defaults['listDocuments'];
889
767
  const callSettings = defaultCallSettings.merge(options);
890
- this.initialize().catch(err => {
891
- throw err;
892
- });
768
+ this.initialize().catch(err => { throw err; });
893
769
  this._log.info('listDocuments iterate %j', request);
894
770
  return this.descriptors.page.listDocuments.asyncIterate(this.innerApiCalls['listDocuments'], request, callSettings);
895
771
  }
896
772
  /**
897
- * Gets information about a location.
898
- *
899
- * @param {Object} request
900
- * The request object that will be sent.
901
- * @param {string} request.name
902
- * Resource name for the location.
903
- * @param {object} [options]
904
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
905
- * @returns {Promise} - The promise which resolves to an array.
906
- * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
907
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
908
- * for more details and examples.
909
- * @example
910
- * ```
911
- * const [response] = await client.getLocation(request);
912
- * ```
913
- */
773
+ * Gets information about a location.
774
+ *
775
+ * @param {Object} request
776
+ * The request object that will be sent.
777
+ * @param {string} request.name
778
+ * Resource name for the location.
779
+ * @param {object} [options]
780
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
781
+ * @returns {Promise} - The promise which resolves to an array.
782
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
783
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
784
+ * for more details and examples.
785
+ * @example
786
+ * ```
787
+ * const [response] = await client.getLocation(request);
788
+ * ```
789
+ */
914
790
  getLocation(request, options, callback) {
915
791
  return this.locationsClient.getLocation(request, options, callback);
916
792
  }
917
793
  /**
918
- * Lists information about the supported locations for this service. Returns an iterable object.
919
- *
920
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
921
- * @param {Object} request
922
- * The request object that will be sent.
923
- * @param {string} request.name
924
- * The resource that owns the locations collection, if applicable.
925
- * @param {string} request.filter
926
- * The standard list filter.
927
- * @param {number} request.pageSize
928
- * The standard list page size.
929
- * @param {string} request.pageToken
930
- * The standard list page token.
931
- * @param {object} [options]
932
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
933
- * @returns {Object}
934
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
935
- * When you iterate the returned iterable, each element will be an object representing
936
- * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
937
- * so you can stop the iteration when you don't need more results.
938
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
939
- * for more details and examples.
940
- * @example
941
- * ```
942
- * const iterable = client.listLocationsAsync(request);
943
- * for await (const response of iterable) {
944
- * // process response
945
- * }
946
- * ```
947
- */
794
+ * Lists information about the supported locations for this service. Returns an iterable object.
795
+ *
796
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
797
+ * @param {Object} request
798
+ * The request object that will be sent.
799
+ * @param {string} request.name
800
+ * The resource that owns the locations collection, if applicable.
801
+ * @param {string} request.filter
802
+ * The standard list filter.
803
+ * @param {number} request.pageSize
804
+ * The standard list page size.
805
+ * @param {string} request.pageToken
806
+ * The standard list page token.
807
+ * @param {object} [options]
808
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
809
+ * @returns {Object}
810
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
811
+ * When you iterate the returned iterable, each element will be an object representing
812
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
813
+ * so you can stop the iteration when you don't need more results.
814
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
815
+ * for more details and examples.
816
+ * @example
817
+ * ```
818
+ * const iterable = client.listLocationsAsync(request);
819
+ * for await (const response of iterable) {
820
+ * // process response
821
+ * }
822
+ * ```
823
+ */
948
824
  listLocationsAsync(request, options) {
949
825
  return this.locationsClient.listLocationsAsync(request, options);
950
826
  }
951
827
  /**
952
- * Gets the latest state of a long-running operation. Clients can use this
953
- * method to poll the operation result at intervals as recommended by the API
954
- * service.
955
- *
956
- * @param {Object} request - The request object that will be sent.
957
- * @param {string} request.name - The name of the operation resource.
958
- * @param {Object=} options
959
- * Optional parameters. You can override the default settings for this call,
960
- * e.g, timeout, retries, paginations, etc. See {@link
961
- * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
962
- * for the details.
963
- * @param {function(?Error, ?Object)=} callback
964
- * The function which will be called with the result of the API call.
965
- *
966
- * The second parameter to the callback is an object representing
967
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
968
- * @return {Promise} - The promise which resolves to an array.
969
- * The first element of the array is an object representing
970
- * {@link google.longrunning.Operation | google.longrunning.Operation}.
971
- * The promise has a method named "cancel" which cancels the ongoing API call.
972
- *
973
- * @example
974
- * ```
975
- * const client = longrunning.operationsClient();
976
- * const name = '';
977
- * const [response] = await client.getOperation({name});
978
- * // doThingsWith(response)
979
- * ```
980
- */
828
+ * Gets the latest state of a long-running operation. Clients can use this
829
+ * method to poll the operation result at intervals as recommended by the API
830
+ * service.
831
+ *
832
+ * @param {Object} request - The request object that will be sent.
833
+ * @param {string} request.name - The name of the operation resource.
834
+ * @param {Object=} options
835
+ * Optional parameters. You can override the default settings for this call,
836
+ * e.g, timeout, retries, paginations, etc. See {@link
837
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
838
+ * for the details.
839
+ * @param {function(?Error, ?Object)=} callback
840
+ * The function which will be called with the result of the API call.
841
+ *
842
+ * The second parameter to the callback is an object representing
843
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
844
+ * @return {Promise} - The promise which resolves to an array.
845
+ * The first element of the array is an object representing
846
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
847
+ * The promise has a method named "cancel" which cancels the ongoing API call.
848
+ *
849
+ * @example
850
+ * ```
851
+ * const client = longrunning.operationsClient();
852
+ * const name = '';
853
+ * const [response] = await client.getOperation({name});
854
+ * // doThingsWith(response)
855
+ * ```
856
+ */
981
857
  getOperation(request, optionsOrCallback, callback) {
982
858
  let options;
983
859
  if (typeof optionsOrCallback === 'function' && callback === undefined) {
@@ -1188,6 +1064,51 @@ class DocumentServiceClient {
1188
1064
  matchEngineFromEngineName(engineName) {
1189
1065
  return this.pathTemplates.enginePathTemplate.match(engineName).engine;
1190
1066
  }
1067
+ /**
1068
+ * Return a fully-qualified identityMappingStore resource name string.
1069
+ *
1070
+ * @param {string} project
1071
+ * @param {string} location
1072
+ * @param {string} identity_mapping_store
1073
+ * @returns {string} Resource name string.
1074
+ */
1075
+ identityMappingStorePath(project, location, identityMappingStore) {
1076
+ return this.pathTemplates.identityMappingStorePathTemplate.render({
1077
+ project: project,
1078
+ location: location,
1079
+ identity_mapping_store: identityMappingStore,
1080
+ });
1081
+ }
1082
+ /**
1083
+ * Parse the project from IdentityMappingStore resource.
1084
+ *
1085
+ * @param {string} identityMappingStoreName
1086
+ * A fully-qualified path representing IdentityMappingStore resource.
1087
+ * @returns {string} A string representing the project.
1088
+ */
1089
+ matchProjectFromIdentityMappingStoreName(identityMappingStoreName) {
1090
+ return this.pathTemplates.identityMappingStorePathTemplate.match(identityMappingStoreName).project;
1091
+ }
1092
+ /**
1093
+ * Parse the location from IdentityMappingStore resource.
1094
+ *
1095
+ * @param {string} identityMappingStoreName
1096
+ * A fully-qualified path representing IdentityMappingStore resource.
1097
+ * @returns {string} A string representing the location.
1098
+ */
1099
+ matchLocationFromIdentityMappingStoreName(identityMappingStoreName) {
1100
+ return this.pathTemplates.identityMappingStorePathTemplate.match(identityMappingStoreName).location;
1101
+ }
1102
+ /**
1103
+ * Parse the identity_mapping_store from IdentityMappingStore resource.
1104
+ *
1105
+ * @param {string} identityMappingStoreName
1106
+ * A fully-qualified path representing IdentityMappingStore resource.
1107
+ * @returns {string} A string representing the identity_mapping_store.
1108
+ */
1109
+ matchIdentityMappingStoreFromIdentityMappingStoreName(identityMappingStoreName) {
1110
+ return this.pathTemplates.identityMappingStorePathTemplate.match(identityMappingStoreName).identity_mapping_store;
1111
+ }
1191
1112
  /**
1192
1113
  * Return a fully-qualified project resource name string.
1193
1114
  *
@@ -1209,6 +1130,84 @@ class DocumentServiceClient {
1209
1130
  matchProjectFromProjectName(projectName) {
1210
1131
  return this.pathTemplates.projectPathTemplate.match(projectName).project;
1211
1132
  }
1133
+ /**
1134
+ * Return a fully-qualified projectLocationCmekConfig resource name string.
1135
+ *
1136
+ * @param {string} project
1137
+ * @param {string} location
1138
+ * @returns {string} Resource name string.
1139
+ */
1140
+ projectLocationCmekConfigPath(project, location) {
1141
+ return this.pathTemplates.projectLocationCmekConfigPathTemplate.render({
1142
+ project: project,
1143
+ location: location,
1144
+ });
1145
+ }
1146
+ /**
1147
+ * Parse the project from ProjectLocationCmekConfig resource.
1148
+ *
1149
+ * @param {string} projectLocationCmekConfigName
1150
+ * A fully-qualified path representing project_location_cmekConfig resource.
1151
+ * @returns {string} A string representing the project.
1152
+ */
1153
+ matchProjectFromProjectLocationCmekConfigName(projectLocationCmekConfigName) {
1154
+ return this.pathTemplates.projectLocationCmekConfigPathTemplate.match(projectLocationCmekConfigName).project;
1155
+ }
1156
+ /**
1157
+ * Parse the location from ProjectLocationCmekConfig resource.
1158
+ *
1159
+ * @param {string} projectLocationCmekConfigName
1160
+ * A fully-qualified path representing project_location_cmekConfig resource.
1161
+ * @returns {string} A string representing the location.
1162
+ */
1163
+ matchLocationFromProjectLocationCmekConfigName(projectLocationCmekConfigName) {
1164
+ return this.pathTemplates.projectLocationCmekConfigPathTemplate.match(projectLocationCmekConfigName).location;
1165
+ }
1166
+ /**
1167
+ * Return a fully-qualified projectLocationCmekConfigs resource name string.
1168
+ *
1169
+ * @param {string} project
1170
+ * @param {string} location
1171
+ * @param {string} cmek_config
1172
+ * @returns {string} Resource name string.
1173
+ */
1174
+ projectLocationCmekConfigsPath(project, location, cmekConfig) {
1175
+ return this.pathTemplates.projectLocationCmekConfigsPathTemplate.render({
1176
+ project: project,
1177
+ location: location,
1178
+ cmek_config: cmekConfig,
1179
+ });
1180
+ }
1181
+ /**
1182
+ * Parse the project from ProjectLocationCmekConfigs resource.
1183
+ *
1184
+ * @param {string} projectLocationCmekConfigsName
1185
+ * A fully-qualified path representing project_location_cmekConfigs resource.
1186
+ * @returns {string} A string representing the project.
1187
+ */
1188
+ matchProjectFromProjectLocationCmekConfigsName(projectLocationCmekConfigsName) {
1189
+ return this.pathTemplates.projectLocationCmekConfigsPathTemplate.match(projectLocationCmekConfigsName).project;
1190
+ }
1191
+ /**
1192
+ * Parse the location from ProjectLocationCmekConfigs resource.
1193
+ *
1194
+ * @param {string} projectLocationCmekConfigsName
1195
+ * A fully-qualified path representing project_location_cmekConfigs resource.
1196
+ * @returns {string} A string representing the location.
1197
+ */
1198
+ matchLocationFromProjectLocationCmekConfigsName(projectLocationCmekConfigsName) {
1199
+ return this.pathTemplates.projectLocationCmekConfigsPathTemplate.match(projectLocationCmekConfigsName).location;
1200
+ }
1201
+ /**
1202
+ * Parse the cmek_config from ProjectLocationCmekConfigs resource.
1203
+ *
1204
+ * @param {string} projectLocationCmekConfigsName
1205
+ * A fully-qualified path representing project_location_cmekConfigs resource.
1206
+ * @returns {string} A string representing the cmek_config.
1207
+ */
1208
+ matchCmekConfigFromProjectLocationCmekConfigsName(projectLocationCmekConfigsName) {
1209
+ return this.pathTemplates.projectLocationCmekConfigsPathTemplate.match(projectLocationCmekConfigsName).cmek_config;
1210
+ }
1212
1211
  /**
1213
1212
  * Return a fully-qualified projectLocationCollectionDataStore resource name string.
1214
1213
  *
@@ -3492,8 +3491,8 @@ class DocumentServiceClient {
3492
3491
  this._log.info('ending gRPC channel');
3493
3492
  this._terminated = true;
3494
3493
  stub.close();
3495
- this.locationsClient.close();
3496
- this.operationsClient.close();
3494
+ this.locationsClient.close().catch(err => { throw err; });
3495
+ void this.operationsClient.close();
3497
3496
  });
3498
3497
  }
3499
3498
  return Promise.resolve();