@google-cloud/discoveryengine 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +33 -1
  3. package/build/protos/google/cloud/discoveryengine/v1/common.proto +30 -2
  4. package/build/protos/google/cloud/discoveryengine/v1/completion_service.proto +15 -2
  5. package/build/protos/google/cloud/discoveryengine/v1/conversation.proto +114 -0
  6. package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +303 -0
  7. package/build/protos/google/cloud/discoveryengine/v1/document.proto +8 -5
  8. package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +4 -3
  9. package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +27 -23
  10. package/build/protos/google/cloud/discoveryengine/v1/schema.proto +1 -1
  11. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +428 -20
  12. package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +48 -39
  13. package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +2 -2
  14. package/build/protos/google/cloud/discoveryengine/v1alpha/common.proto +155 -0
  15. package/build/protos/google/cloud/discoveryengine/v1alpha/completion_service.proto +134 -0
  16. package/build/protos/google/cloud/discoveryengine/v1alpha/conversation.proto +138 -0
  17. package/build/protos/google/cloud/discoveryengine/v1alpha/conversational_search_service.proto +306 -0
  18. package/build/protos/google/cloud/discoveryengine/v1alpha/document.proto +121 -0
  19. package/build/protos/google/cloud/discoveryengine/v1alpha/document_service.proto +318 -0
  20. package/build/protos/google/cloud/discoveryengine/v1alpha/import_config.proto +343 -0
  21. package/build/protos/google/cloud/discoveryengine/v1alpha/purge_config.proto +159 -0
  22. package/build/protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto +221 -0
  23. package/build/protos/google/cloud/discoveryengine/v1alpha/schema.proto +312 -0
  24. package/build/protos/google/cloud/discoveryengine/v1alpha/schema_service.proto +260 -0
  25. package/build/protos/google/cloud/discoveryengine/v1alpha/search_service.proto +851 -0
  26. package/build/protos/google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto +152 -0
  27. package/build/protos/google/cloud/discoveryengine/v1alpha/user_event.proto +475 -0
  28. package/build/protos/google/cloud/discoveryengine/v1alpha/user_event_service.proto +154 -0
  29. package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +6 -0
  30. package/build/protos/google/cloud/discoveryengine/v1beta/conversation.proto +9 -2
  31. package/build/protos/google/cloud/discoveryengine/v1beta/conversational_search_service.proto +25 -0
  32. package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +115 -3
  33. package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +4 -0
  34. package/build/protos/protos.d.ts +22864 -6680
  35. package/build/protos/protos.js +57205 -16191
  36. package/build/protos/protos.json +5548 -1224
  37. package/build/src/index.d.ts +6 -1
  38. package/build/src/index.js +7 -1
  39. package/build/src/v1/completion_service_client.d.ts +156 -6
  40. package/build/src/v1/completion_service_client.js +188 -4
  41. package/build/src/v1/conversational_search_service_client.d.ts +947 -0
  42. package/build/src/v1/conversational_search_service_client.js +1205 -0
  43. package/build/src/v1/conversational_search_service_client_config.json +68 -0
  44. package/build/src/v1/document_service_client.d.ts +165 -18
  45. package/build/src/v1/document_service_client.js +215 -11
  46. package/build/src/v1/index.d.ts +1 -0
  47. package/build/src/v1/index.js +3 -1
  48. package/build/src/v1/schema_service_client.d.ts +148 -4
  49. package/build/src/v1/schema_service_client.js +207 -5
  50. package/build/src/v1/search_service_client.d.ts +238 -28
  51. package/build/src/v1/search_service_client.js +248 -20
  52. package/build/src/v1/user_event_service_client.d.ts +153 -9
  53. package/build/src/v1/user_event_service_client.js +207 -5
  54. package/build/src/v1alpha/completion_service_client.d.ts +603 -0
  55. package/build/src/v1alpha/completion_service_client.js +843 -0
  56. package/build/src/v1alpha/completion_service_client_config.json +43 -0
  57. package/build/src/v1alpha/conversational_search_service_client.d.ts +998 -0
  58. package/build/src/v1alpha/conversational_search_service_client.js +1275 -0
  59. package/build/src/v1alpha/conversational_search_service_client_config.json +68 -0
  60. package/build/src/v1alpha/document_service_client.d.ts +1140 -0
  61. package/build/src/v1alpha/document_service_client.js +1393 -0
  62. package/build/src/v1alpha/document_service_client_config.json +82 -0
  63. package/build/src/v1alpha/index.d.ts +8 -0
  64. package/build/src/v1alpha/index.js +37 -0
  65. package/build/src/v1alpha/recommendation_service_client.d.ts +735 -0
  66. package/build/src/v1alpha/recommendation_service_client.js +938 -0
  67. package/build/src/v1alpha/recommendation_service_client_config.json +43 -0
  68. package/build/src/v1alpha/schema_service_client.d.ts +935 -0
  69. package/build/src/v1alpha/schema_service_client.js +1327 -0
  70. package/build/src/v1alpha/schema_service_client_config.json +63 -0
  71. package/build/src/v1alpha/search_service_client.d.ts +1208 -0
  72. package/build/src/v1alpha/search_service_client.js +1432 -0
  73. package/build/src/v1alpha/search_service_client_config.json +43 -0
  74. package/build/src/v1alpha/site_search_engine_service_client.d.ts +704 -0
  75. package/build/src/v1alpha/site_search_engine_service_client.js +1087 -0
  76. package/build/src/v1alpha/site_search_engine_service_client_config.json +30 -0
  77. package/build/src/v1alpha/user_event_service_client.d.ts +853 -0
  78. package/build/src/v1alpha/user_event_service_client.js +1174 -0
  79. package/build/src/v1alpha/user_event_service_client_config.json +67 -0
  80. package/build/src/v1beta/completion_service_client.d.ts +55 -4
  81. package/build/src/v1beta/completion_service_client.js +60 -4
  82. package/build/src/v1beta/conversational_search_service_client.d.ts +75 -4
  83. package/build/src/v1beta/conversational_search_service_client.js +60 -4
  84. package/build/src/v1beta/document_service_client.d.ts +55 -4
  85. package/build/src/v1beta/document_service_client.js +61 -5
  86. package/build/src/v1beta/recommendation_service_client.d.ts +55 -4
  87. package/build/src/v1beta/recommendation_service_client.js +60 -4
  88. package/build/src/v1beta/schema_service_client.d.ts +55 -4
  89. package/build/src/v1beta/schema_service_client.js +61 -5
  90. package/build/src/v1beta/search_service_client.d.ts +142 -4
  91. package/build/src/v1beta/search_service_client.js +118 -4
  92. package/build/src/v1beta/user_event_service_client.d.ts +55 -4
  93. package/build/src/v1beta/user_event_service_client.js +61 -5
  94. package/package.json +5 -5
@@ -62,8 +62,7 @@ class DocumentServiceClient {
62
62
  * API remote host.
63
63
  * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
64
64
  * Follows the structure of {@link gapicConfig}.
65
- * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
66
- * Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
65
+ * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
67
66
  * For more information, please check the
68
67
  * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
69
68
  * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
@@ -71,7 +70,7 @@ class DocumentServiceClient {
71
70
  * HTTP implementation. Load only fallback version and pass it to the constructor:
72
71
  * ```
73
72
  * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
74
- * const client = new DocumentServiceClient({fallback: 'rest'}, gax);
73
+ * const client = new DocumentServiceClient({fallback: true}, gax);
75
74
  * ```
76
75
  */
77
76
  constructor(opts, gaxInstance) {
@@ -117,6 +116,7 @@ class DocumentServiceClient {
117
116
  if (servicePath === staticMembers.servicePath) {
118
117
  this.auth.defaultScopes = staticMembers.scopes;
119
118
  }
119
+ this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
120
120
  // Determine the client header string.
121
121
  const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
122
122
  if (typeof process !== 'undefined' && 'versions' in process) {
@@ -128,7 +128,7 @@ class DocumentServiceClient {
128
128
  if (!opts.fallback) {
129
129
  clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
130
130
  }
131
- else if (opts.fallback === 'rest') {
131
+ else {
132
132
  clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
133
133
  }
134
134
  if (opts.libName && opts.libVersion) {
@@ -163,7 +163,7 @@ class DocumentServiceClient {
163
163
  auth: this.auth,
164
164
  grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
165
165
  };
166
- if (opts.fallback === 'rest') {
166
+ if (opts.fallback) {
167
167
  lroOptions.protoJson = protoFilesRoot;
168
168
  lroOptions.httpRules = [
169
169
  {
@@ -655,6 +655,61 @@ class DocumentServiceClient {
655
655
  this.initialize();
656
656
  return this.descriptors.page.listDocuments.asyncIterate(this.innerApiCalls['listDocuments'], request, callSettings);
657
657
  }
658
+ /**
659
+ * Gets information about a location.
660
+ *
661
+ * @param {Object} request
662
+ * The request object that will be sent.
663
+ * @param {string} request.name
664
+ * Resource name for the location.
665
+ * @param {object} [options]
666
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
667
+ * @returns {Promise} - The promise which resolves to an array.
668
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
669
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
670
+ * for more details and examples.
671
+ * @example
672
+ * ```
673
+ * const [response] = await client.getLocation(request);
674
+ * ```
675
+ */
676
+ getLocation(request, options, callback) {
677
+ return this.locationsClient.getLocation(request, options, callback);
678
+ }
679
+ /**
680
+ * Lists information about the supported locations for this service. Returns an iterable object.
681
+ *
682
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
683
+ * @param {Object} request
684
+ * The request object that will be sent.
685
+ * @param {string} request.name
686
+ * The resource that owns the locations collection, if applicable.
687
+ * @param {string} request.filter
688
+ * The standard list filter.
689
+ * @param {number} request.pageSize
690
+ * The standard list page size.
691
+ * @param {string} request.pageToken
692
+ * The standard list page token.
693
+ * @param {object} [options]
694
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
695
+ * @returns {Object}
696
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
697
+ * When you iterate the returned iterable, each element will be an object representing
698
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
699
+ * so you can stop the iteration when you don't need more results.
700
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
701
+ * for more details and examples.
702
+ * @example
703
+ * ```
704
+ * const iterable = client.listLocationsAsync(request);
705
+ * for await (const response of iterable) {
706
+ * // process response
707
+ * }
708
+ * ```
709
+ */
710
+ listLocationsAsync(request, options) {
711
+ return this.locationsClient.listLocationsAsync(request, options);
712
+ }
658
713
  /**
659
714
  * Gets the latest state of a long-running operation. Clients can use this
660
715
  * method to poll the operation result at intervals as recommended by the API
@@ -1325,6 +1380,7 @@ class DocumentServiceClient {
1325
1380
  return this.documentServiceStub.then(stub => {
1326
1381
  this._terminated = true;
1327
1382
  stub.close();
1383
+ this.locationsClient.close();
1328
1384
  this.operationsClient.close();
1329
1385
  });
1330
1386
  }
@@ -1,5 +1,5 @@
1
1
  import type * as gax from 'google-gax';
2
- import type { Callback, CallOptions, Descriptors, ClientOptions } from 'google-gax';
2
+ import type { Callback, CallOptions, Descriptors, ClientOptions, LocationsClient, LocationProtos } from 'google-gax';
3
3
  import * as protos from '../../protos/protos';
4
4
  /**
5
5
  * Service for making recommendations.
@@ -20,6 +20,7 @@ export declare class RecommendationServiceClient {
20
20
  innerApiCalls: {
21
21
  [name: string]: Function;
22
22
  };
23
+ locationsClient: LocationsClient;
23
24
  pathTemplates: {
24
25
  [name: string]: gax.PathTemplate;
25
26
  };
@@ -54,8 +55,7 @@ export declare class RecommendationServiceClient {
54
55
  * API remote host.
55
56
  * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
56
57
  * Follows the structure of {@link gapicConfig}.
57
- * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
58
- * Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
58
+ * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
59
59
  * For more information, please check the
60
60
  * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
61
61
  * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
@@ -63,7 +63,7 @@ export declare class RecommendationServiceClient {
63
63
  * HTTP implementation. Load only fallback version and pass it to the constructor:
64
64
  * ```
65
65
  * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
66
- * const client = new RecommendationServiceClient({fallback: 'rest'}, gax);
66
+ * const client = new RecommendationServiceClient({fallback: true}, gax);
67
67
  * ```
68
68
  */
69
69
  constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
@@ -222,6 +222,57 @@ export declare class RecommendationServiceClient {
222
222
  ]>;
223
223
  recommend(request: protos.google.cloud.discoveryengine.v1beta.IRecommendRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IRecommendResponse, protos.google.cloud.discoveryengine.v1beta.IRecommendRequest | null | undefined, {} | null | undefined>): void;
224
224
  recommend(request: protos.google.cloud.discoveryengine.v1beta.IRecommendRequest, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IRecommendResponse, protos.google.cloud.discoveryengine.v1beta.IRecommendRequest | null | undefined, {} | null | undefined>): void;
225
+ /**
226
+ * Gets information about a location.
227
+ *
228
+ * @param {Object} request
229
+ * The request object that will be sent.
230
+ * @param {string} request.name
231
+ * Resource name for the location.
232
+ * @param {object} [options]
233
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
234
+ * @returns {Promise} - The promise which resolves to an array.
235
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
236
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
237
+ * for more details and examples.
238
+ * @example
239
+ * ```
240
+ * const [response] = await client.getLocation(request);
241
+ * ```
242
+ */
243
+ 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>;
244
+ /**
245
+ * Lists information about the supported locations for this service. Returns an iterable object.
246
+ *
247
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
248
+ * @param {Object} request
249
+ * The request object that will be sent.
250
+ * @param {string} request.name
251
+ * The resource that owns the locations collection, if applicable.
252
+ * @param {string} request.filter
253
+ * The standard list filter.
254
+ * @param {number} request.pageSize
255
+ * The standard list page size.
256
+ * @param {string} request.pageToken
257
+ * The standard list page token.
258
+ * @param {object} [options]
259
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
260
+ * @returns {Object}
261
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
262
+ * When you iterate the returned iterable, each element will be an object representing
263
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
264
+ * so you can stop the iteration when you don't need more results.
265
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
266
+ * for more details and examples.
267
+ * @example
268
+ * ```
269
+ * const iterable = client.listLocationsAsync(request);
270
+ * for await (const response of iterable) {
271
+ * // process response
272
+ * }
273
+ * ```
274
+ */
275
+ listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
225
276
  /**
226
277
  * Return a fully-qualified projectLocationCollectionDataStoreBranchDocument resource name string.
227
278
  *
@@ -60,8 +60,7 @@ class RecommendationServiceClient {
60
60
  * API remote host.
61
61
  * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
62
62
  * Follows the structure of {@link gapicConfig}.
63
- * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
64
- * Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
63
+ * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
65
64
  * For more information, please check the
66
65
  * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
67
66
  * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
@@ -69,7 +68,7 @@ class RecommendationServiceClient {
69
68
  * HTTP implementation. Load only fallback version and pass it to the constructor:
70
69
  * ```
71
70
  * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
72
- * const client = new RecommendationServiceClient({fallback: 'rest'}, gax);
71
+ * const client = new RecommendationServiceClient({fallback: true}, gax);
73
72
  * ```
74
73
  */
75
74
  constructor(opts, gaxInstance) {
@@ -116,6 +115,7 @@ class RecommendationServiceClient {
116
115
  if (servicePath === staticMembers.servicePath) {
117
116
  this.auth.defaultScopes = staticMembers.scopes;
118
117
  }
118
+ this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
119
119
  // Determine the client header string.
120
120
  const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
121
121
  if (typeof process !== 'undefined' && 'versions' in process) {
@@ -127,7 +127,7 @@ class RecommendationServiceClient {
127
127
  if (!opts.fallback) {
128
128
  clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
129
129
  }
130
- else if (opts.fallback === 'rest') {
130
+ else {
131
131
  clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
132
132
  }
133
133
  if (opts.libName && opts.libVersion) {
@@ -261,6 +261,61 @@ class RecommendationServiceClient {
261
261
  this.initialize();
262
262
  return this.innerApiCalls.recommend(request, options, callback);
263
263
  }
264
+ /**
265
+ * Gets information about a location.
266
+ *
267
+ * @param {Object} request
268
+ * The request object that will be sent.
269
+ * @param {string} request.name
270
+ * Resource name for the location.
271
+ * @param {object} [options]
272
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
273
+ * @returns {Promise} - The promise which resolves to an array.
274
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
275
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
276
+ * for more details and examples.
277
+ * @example
278
+ * ```
279
+ * const [response] = await client.getLocation(request);
280
+ * ```
281
+ */
282
+ getLocation(request, options, callback) {
283
+ return this.locationsClient.getLocation(request, options, callback);
284
+ }
285
+ /**
286
+ * Lists information about the supported locations for this service. Returns an iterable object.
287
+ *
288
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
289
+ * @param {Object} request
290
+ * The request object that will be sent.
291
+ * @param {string} request.name
292
+ * The resource that owns the locations collection, if applicable.
293
+ * @param {string} request.filter
294
+ * The standard list filter.
295
+ * @param {number} request.pageSize
296
+ * The standard list page size.
297
+ * @param {string} request.pageToken
298
+ * The standard list page token.
299
+ * @param {object} [options]
300
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
301
+ * @returns {Object}
302
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
303
+ * When you iterate the returned iterable, each element will be an object representing
304
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
305
+ * so you can stop the iteration when you don't need more results.
306
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
307
+ * for more details and examples.
308
+ * @example
309
+ * ```
310
+ * const iterable = client.listLocationsAsync(request);
311
+ * for await (const response of iterable) {
312
+ * // process response
313
+ * }
314
+ * ```
315
+ */
316
+ listLocationsAsync(request, options) {
317
+ return this.locationsClient.listLocationsAsync(request, options);
318
+ }
264
319
  // --------------------
265
320
  // -- Path templates --
266
321
  // --------------------
@@ -803,6 +858,7 @@ class RecommendationServiceClient {
803
858
  return this.recommendationServiceStub.then(stub => {
804
859
  this._terminated = true;
805
860
  stub.close();
861
+ this.locationsClient.close();
806
862
  });
807
863
  }
808
864
  return Promise.resolve();
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import type * as gax from 'google-gax';
3
- import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback } from 'google-gax';
3
+ import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, LocationsClient, LocationProtos } from 'google-gax';
4
4
  import { Transform } from 'stream';
5
5
  import * as protos from '../../protos/protos';
6
6
  /**
@@ -22,6 +22,7 @@ export declare class SchemaServiceClient {
22
22
  innerApiCalls: {
23
23
  [name: string]: Function;
24
24
  };
25
+ locationsClient: LocationsClient;
25
26
  pathTemplates: {
26
27
  [name: string]: gax.PathTemplate;
27
28
  };
@@ -57,8 +58,7 @@ export declare class SchemaServiceClient {
57
58
  * API remote host.
58
59
  * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
59
60
  * Follows the structure of {@link gapicConfig}.
60
- * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
61
- * Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
61
+ * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
62
62
  * For more information, please check the
63
63
  * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
64
64
  * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
@@ -66,7 +66,7 @@ export declare class SchemaServiceClient {
66
66
  * HTTP implementation. Load only fallback version and pass it to the constructor:
67
67
  * ```
68
68
  * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
69
- * const client = new SchemaServiceClient({fallback: 'rest'}, gax);
69
+ * const client = new SchemaServiceClient({fallback: true}, gax);
70
70
  * ```
71
71
  */
72
72
  constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
@@ -379,6 +379,57 @@ export declare class SchemaServiceClient {
379
379
  * region_tag:discoveryengine_v1beta_generated_SchemaService_ListSchemas_async
380
380
  */
381
381
  listSchemasAsync(request?: protos.google.cloud.discoveryengine.v1beta.IListSchemasRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.discoveryengine.v1beta.ISchema>;
382
+ /**
383
+ * Gets information about a location.
384
+ *
385
+ * @param {Object} request
386
+ * The request object that will be sent.
387
+ * @param {string} request.name
388
+ * Resource name for the location.
389
+ * @param {object} [options]
390
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
391
+ * @returns {Promise} - The promise which resolves to an array.
392
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
393
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
394
+ * for more details and examples.
395
+ * @example
396
+ * ```
397
+ * const [response] = await client.getLocation(request);
398
+ * ```
399
+ */
400
+ 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>;
401
+ /**
402
+ * Lists information about the supported locations for this service. Returns an iterable object.
403
+ *
404
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
405
+ * @param {Object} request
406
+ * The request object that will be sent.
407
+ * @param {string} request.name
408
+ * The resource that owns the locations collection, if applicable.
409
+ * @param {string} request.filter
410
+ * The standard list filter.
411
+ * @param {number} request.pageSize
412
+ * The standard list page size.
413
+ * @param {string} request.pageToken
414
+ * The standard list page token.
415
+ * @param {object} [options]
416
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
417
+ * @returns {Object}
418
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
419
+ * When you iterate the returned iterable, each element will be an object representing
420
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
421
+ * so you can stop the iteration when you don't need more results.
422
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
423
+ * for more details and examples.
424
+ * @example
425
+ * ```
426
+ * const iterable = client.listLocationsAsync(request);
427
+ * for await (const response of iterable) {
428
+ * // process response
429
+ * }
430
+ * ```
431
+ */
432
+ listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
382
433
  /**
383
434
  * Gets the latest state of a long-running operation. Clients can use this
384
435
  * method to poll the operation result at intervals as recommended by the API
@@ -60,8 +60,7 @@ class SchemaServiceClient {
60
60
  * API remote host.
61
61
  * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
62
62
  * Follows the structure of {@link gapicConfig}.
63
- * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
64
- * Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
63
+ * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
65
64
  * For more information, please check the
66
65
  * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
67
66
  * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
@@ -69,7 +68,7 @@ class SchemaServiceClient {
69
68
  * HTTP implementation. Load only fallback version and pass it to the constructor:
70
69
  * ```
71
70
  * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
72
- * const client = new SchemaServiceClient({fallback: 'rest'}, gax);
71
+ * const client = new SchemaServiceClient({fallback: true}, gax);
73
72
  * ```
74
73
  */
75
74
  constructor(opts, gaxInstance) {
@@ -115,6 +114,7 @@ class SchemaServiceClient {
115
114
  if (servicePath === staticMembers.servicePath) {
116
115
  this.auth.defaultScopes = staticMembers.scopes;
117
116
  }
117
+ this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
118
118
  // Determine the client header string.
119
119
  const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
120
120
  if (typeof process !== 'undefined' && 'versions' in process) {
@@ -126,7 +126,7 @@ class SchemaServiceClient {
126
126
  if (!opts.fallback) {
127
127
  clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
128
128
  }
129
- else if (opts.fallback === 'rest') {
129
+ else {
130
130
  clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
131
131
  }
132
132
  if (opts.libName && opts.libVersion) {
@@ -161,7 +161,7 @@ class SchemaServiceClient {
161
161
  auth: this.auth,
162
162
  grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
163
163
  };
164
- if (opts.fallback === 'rest') {
164
+ if (opts.fallback) {
165
165
  lroOptions.protoJson = protoFilesRoot;
166
166
  lroOptions.httpRules = [
167
167
  {
@@ -613,6 +613,61 @@ class SchemaServiceClient {
613
613
  this.initialize();
614
614
  return this.descriptors.page.listSchemas.asyncIterate(this.innerApiCalls['listSchemas'], request, callSettings);
615
615
  }
616
+ /**
617
+ * Gets information about a location.
618
+ *
619
+ * @param {Object} request
620
+ * The request object that will be sent.
621
+ * @param {string} request.name
622
+ * Resource name for the location.
623
+ * @param {object} [options]
624
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
625
+ * @returns {Promise} - The promise which resolves to an array.
626
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
627
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
628
+ * for more details and examples.
629
+ * @example
630
+ * ```
631
+ * const [response] = await client.getLocation(request);
632
+ * ```
633
+ */
634
+ getLocation(request, options, callback) {
635
+ return this.locationsClient.getLocation(request, options, callback);
636
+ }
637
+ /**
638
+ * Lists information about the supported locations for this service. Returns an iterable object.
639
+ *
640
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
641
+ * @param {Object} request
642
+ * The request object that will be sent.
643
+ * @param {string} request.name
644
+ * The resource that owns the locations collection, if applicable.
645
+ * @param {string} request.filter
646
+ * The standard list filter.
647
+ * @param {number} request.pageSize
648
+ * The standard list page size.
649
+ * @param {string} request.pageToken
650
+ * The standard list page token.
651
+ * @param {object} [options]
652
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
653
+ * @returns {Object}
654
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
655
+ * When you iterate the returned iterable, each element will be an object representing
656
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
657
+ * so you can stop the iteration when you don't need more results.
658
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
659
+ * for more details and examples.
660
+ * @example
661
+ * ```
662
+ * const iterable = client.listLocationsAsync(request);
663
+ * for await (const response of iterable) {
664
+ * // process response
665
+ * }
666
+ * ```
667
+ */
668
+ listLocationsAsync(request, options) {
669
+ return this.locationsClient.listLocationsAsync(request, options);
670
+ }
616
671
  /**
617
672
  * Gets the latest state of a long-running operation. Clients can use this
618
673
  * method to poll the operation result at intervals as recommended by the API
@@ -1259,6 +1314,7 @@ class SchemaServiceClient {
1259
1314
  return this.schemaServiceStub.then(stub => {
1260
1315
  this._terminated = true;
1261
1316
  stub.close();
1317
+ this.locationsClient.close();
1262
1318
  this.operationsClient.close();
1263
1319
  });
1264
1320
  }