@google-cloud/discoveryengine 0.7.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +6 -0
  3. package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +1 -2
  4. package/build/protos/google/cloud/discoveryengine/v1beta/completion_service.proto +15 -2
  5. package/build/protos/google/cloud/discoveryengine/v1beta/conversation.proto +131 -0
  6. package/build/protos/google/cloud/discoveryengine/v1beta/conversational_search_service.proto +281 -0
  7. package/build/protos/google/cloud/discoveryengine/v1beta/document.proto +6 -5
  8. package/build/protos/google/cloud/discoveryengine/v1beta/document_service.proto +2 -1
  9. package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +26 -22
  10. package/build/protos/google/cloud/discoveryengine/v1beta/schema.proto +1 -1
  11. package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +193 -47
  12. package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +41 -36
  13. package/build/protos/google/cloud/discoveryengine/v1beta/user_event_service.proto +2 -2
  14. package/build/protos/protos.d.ts +6529 -4472
  15. package/build/protos/protos.js +16561 -11622
  16. package/build/protos/protos.json +1842 -1317
  17. package/build/src/v1/completion_service_client.d.ts +6 -7
  18. package/build/src/v1/document_service_client.d.ts +83 -94
  19. package/build/src/v1/document_service_client.js +18 -22
  20. package/build/src/v1/schema_service_client.d.ts +39 -49
  21. package/build/src/v1/schema_service_client.js +17 -22
  22. package/build/src/v1/search_service_client.d.ts +31 -34
  23. package/build/src/v1/search_service_client.js +21 -23
  24. package/build/src/v1/user_event_service_client.d.ts +6 -10
  25. package/build/src/v1/user_event_service_client.js +1 -2
  26. package/build/src/v1beta/completion_service_client.d.ts +106 -8
  27. package/build/src/v1beta/completion_service_client.js +128 -0
  28. package/build/src/v1beta/conversational_search_service_client.d.ts +876 -0
  29. package/build/src/v1beta/conversational_search_service_client.js +1149 -0
  30. package/build/src/v1beta/conversational_search_service_client_config.json +68 -0
  31. package/build/src/v1beta/document_service_client.d.ts +183 -98
  32. package/build/src/v1beta/document_service_client.js +166 -22
  33. package/build/src/v1beta/index.d.ts +1 -0
  34. package/build/src/v1beta/index.js +3 -1
  35. package/build/src/v1beta/recommendation_service_client.d.ts +103 -11
  36. package/build/src/v1beta/recommendation_service_client.js +128 -0
  37. package/build/src/v1beta/schema_service_client.d.ts +132 -49
  38. package/build/src/v1beta/schema_service_client.js +163 -22
  39. package/build/src/v1beta/search_service_client.d.ts +163 -67
  40. package/build/src/v1beta/search_service_client.js +175 -45
  41. package/build/src/v1beta/user_event_service_client.d.ts +104 -15
  42. package/build/src/v1beta/user_event_service_client.js +147 -2
  43. package/package.json +8 -11
@@ -0,0 +1,1149 @@
1
+ "use strict";
2
+ // Copyright 2023 Google LLC
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // https://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+ // ** This file is automatically generated by gapic-generator-typescript. **
17
+ // ** https://github.com/googleapis/gapic-generator-typescript **
18
+ // ** All changes to this file may be overwritten. **
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.ConversationalSearchServiceClient = void 0;
21
+ const jsonProtos = require("../../protos/protos.json");
22
+ /**
23
+ * Client JSON configuration object, loaded from
24
+ * `src/v1beta/conversational_search_service_client_config.json`.
25
+ * This file defines retry strategy and timeouts for all API methods in this library.
26
+ */
27
+ const gapicConfig = require("./conversational_search_service_client_config.json");
28
+ const version = require('../../../package.json').version;
29
+ /**
30
+ * Service for conversational search.
31
+ * @class
32
+ * @memberof v1beta
33
+ */
34
+ class ConversationalSearchServiceClient {
35
+ /**
36
+ * Construct an instance of ConversationalSearchServiceClient.
37
+ *
38
+ * @param {object} [options] - The configuration object.
39
+ * The options accepted by the constructor are described in detail
40
+ * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
41
+ * The common options are:
42
+ * @param {object} [options.credentials] - Credentials object.
43
+ * @param {string} [options.credentials.client_email]
44
+ * @param {string} [options.credentials.private_key]
45
+ * @param {string} [options.email] - Account email address. Required when
46
+ * using a .pem or .p12 keyFilename.
47
+ * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
48
+ * .p12 key downloaded from the Google Developers Console. If you provide
49
+ * a path to a JSON file, the projectId option below is not necessary.
50
+ * NOTE: .pem and .p12 require you to specify options.email as well.
51
+ * @param {number} [options.port] - The port on which to connect to
52
+ * the remote host.
53
+ * @param {string} [options.projectId] - The project ID from the Google
54
+ * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
55
+ * the environment variable GCLOUD_PROJECT for your project ID. If your
56
+ * app is running in an environment which supports
57
+ * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
58
+ * your project ID will be detected automatically.
59
+ * @param {string} [options.apiEndpoint] - The domain name of the
60
+ * API remote host.
61
+ * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
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.
65
+ * For more information, please check the
66
+ * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
67
+ * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
68
+ * need to avoid loading the default gRPC version and want to use the fallback
69
+ * HTTP implementation. Load only fallback version and pass it to the constructor:
70
+ * ```
71
+ * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
72
+ * const client = new ConversationalSearchServiceClient({fallback: 'rest'}, gax);
73
+ * ```
74
+ */
75
+ constructor(opts, gaxInstance) {
76
+ var _a, _b;
77
+ this._terminated = false;
78
+ this.descriptors = {
79
+ page: {},
80
+ stream: {},
81
+ longrunning: {},
82
+ batching: {},
83
+ };
84
+ // Ensure that options include all the required fields.
85
+ const staticMembers = this
86
+ .constructor;
87
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath;
88
+ this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
89
+ const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
90
+ const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {};
91
+ const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
92
+ opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
93
+ // Request numeric enum values if REST transport is used.
94
+ opts.numericEnums = true;
95
+ // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
96
+ if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
97
+ opts['scopes'] = staticMembers.scopes;
98
+ }
99
+ // Load google-gax module synchronously if needed
100
+ if (!gaxInstance) {
101
+ gaxInstance = require('google-gax');
102
+ }
103
+ // Choose either gRPC or proto-over-HTTP implementation of google-gax.
104
+ this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
105
+ // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
106
+ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
107
+ // Save options to use in initialize() method.
108
+ this._opts = opts;
109
+ // Save the auth object to the client, for use by other methods.
110
+ this.auth = this._gaxGrpc.auth;
111
+ // Set useJWTAccessWithScope on the auth object.
112
+ this.auth.useJWTAccessWithScope = true;
113
+ // Set defaultServicePath on the auth object.
114
+ this.auth.defaultServicePath = staticMembers.servicePath;
115
+ // Set the default scopes in auth client if needed.
116
+ if (servicePath === staticMembers.servicePath) {
117
+ this.auth.defaultScopes = staticMembers.scopes;
118
+ }
119
+ // Determine the client header string.
120
+ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
121
+ if (typeof process !== 'undefined' && 'versions' in process) {
122
+ clientHeader.push(`gl-node/${process.versions.node}`);
123
+ }
124
+ else {
125
+ clientHeader.push(`gl-web/${this._gaxModule.version}`);
126
+ }
127
+ if (!opts.fallback) {
128
+ clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
129
+ }
130
+ else if (opts.fallback === 'rest') {
131
+ clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
132
+ }
133
+ if (opts.libName && opts.libVersion) {
134
+ clientHeader.push(`${opts.libName}/${opts.libVersion}`);
135
+ }
136
+ // Load the applicable protos.
137
+ this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos);
138
+ // This API contains "path templates"; forward-slash-separated
139
+ // identifiers to uniquely identify resources within the API.
140
+ // Create useful helper objects for these.
141
+ this.pathTemplates = {
142
+ projectLocationCollectionDataStorePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}'),
143
+ projectLocationCollectionDataStoreBranchDocumentPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}'),
144
+ projectLocationCollectionDataStoreConversationPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}'),
145
+ projectLocationCollectionDataStoreSchemaPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}'),
146
+ projectLocationCollectionDataStoreServingConfigPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}'),
147
+ projectLocationDataStorePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}'),
148
+ projectLocationDataStoreBranchDocumentPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}'),
149
+ projectLocationDataStoreConversationPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}'),
150
+ projectLocationDataStoreSchemaPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}'),
151
+ projectLocationDataStoreServingConfigPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}'),
152
+ };
153
+ // Some of the methods on this service return "paged" results,
154
+ // (e.g. 50 results at a time, with tokens to get subsequent
155
+ // pages). Denote the keys used for pagination and results.
156
+ this.descriptors.page = {
157
+ listConversations: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'conversations'),
158
+ };
159
+ // Put together the default options sent with requests.
160
+ this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1beta.ConversationalSearchService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
161
+ // Set up a dictionary of "inner API calls"; the core implementation
162
+ // of calling the API is handled in `google-gax`, with this code
163
+ // merely providing the destination and request information.
164
+ this.innerApiCalls = {};
165
+ // Add a warn function to the client constructor so it can be easily tested.
166
+ this.warn = this._gaxModule.warn;
167
+ }
168
+ /**
169
+ * Initialize the client.
170
+ * Performs asynchronous operations (such as authentication) and prepares the client.
171
+ * This function will be called automatically when any class method is called for the
172
+ * first time, but if you need to initialize it before calling an actual method,
173
+ * feel free to call initialize() directly.
174
+ *
175
+ * You can await on this method if you want to make sure the client is initialized.
176
+ *
177
+ * @returns {Promise} A promise that resolves to an authenticated service stub.
178
+ */
179
+ initialize() {
180
+ // If the client stub promise is already initialized, return immediately.
181
+ if (this.conversationalSearchServiceStub) {
182
+ return this.conversationalSearchServiceStub;
183
+ }
184
+ // Put together the "service stub" for
185
+ // google.cloud.discoveryengine.v1beta.ConversationalSearchService.
186
+ this.conversationalSearchServiceStub = this._gaxGrpc.createStub(this._opts.fallback
187
+ ? this._protos.lookupService('google.cloud.discoveryengine.v1beta.ConversationalSearchService')
188
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any
189
+ this._protos.google.cloud.discoveryengine.v1beta
190
+ .ConversationalSearchService, this._opts, this._providedCustomServicePath);
191
+ // Iterate over each of the methods that the service provides
192
+ // and create an API call method for each.
193
+ const conversationalSearchServiceStubMethods = [
194
+ 'converseConversation',
195
+ 'createConversation',
196
+ 'deleteConversation',
197
+ 'updateConversation',
198
+ 'getConversation',
199
+ 'listConversations',
200
+ ];
201
+ for (const methodName of conversationalSearchServiceStubMethods) {
202
+ const callPromise = this.conversationalSearchServiceStub.then(stub => (...args) => {
203
+ if (this._terminated) {
204
+ return Promise.reject('The client has already been closed.');
205
+ }
206
+ const func = stub[methodName];
207
+ return func.apply(stub, args);
208
+ }, (err) => () => {
209
+ throw err;
210
+ });
211
+ const descriptor = this.descriptors.page[methodName] || undefined;
212
+ const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
213
+ this.innerApiCalls[methodName] = apiCall;
214
+ }
215
+ return this.conversationalSearchServiceStub;
216
+ }
217
+ /**
218
+ * The DNS address for this API service.
219
+ * @returns {string} The DNS address for this service.
220
+ */
221
+ static get servicePath() {
222
+ return 'discoveryengine.googleapis.com';
223
+ }
224
+ /**
225
+ * The DNS address for this API service - same as servicePath(),
226
+ * exists for compatibility reasons.
227
+ * @returns {string} The DNS address for this service.
228
+ */
229
+ static get apiEndpoint() {
230
+ return 'discoveryengine.googleapis.com';
231
+ }
232
+ /**
233
+ * The port for this API service.
234
+ * @returns {number} The default port for this service.
235
+ */
236
+ static get port() {
237
+ return 443;
238
+ }
239
+ /**
240
+ * The scopes needed to make gRPC calls for every method defined
241
+ * in this service.
242
+ * @returns {string[]} List of default scopes.
243
+ */
244
+ static get scopes() {
245
+ return ['https://www.googleapis.com/auth/cloud-platform'];
246
+ }
247
+ /**
248
+ * Return the project ID used by this class.
249
+ * @returns {Promise} A promise that resolves to string containing the project ID.
250
+ */
251
+ getProjectId(callback) {
252
+ if (callback) {
253
+ this.auth.getProjectId(callback);
254
+ return;
255
+ }
256
+ return this.auth.getProjectId();
257
+ }
258
+ converseConversation(request, optionsOrCallback, callback) {
259
+ var _a;
260
+ request = request || {};
261
+ let options;
262
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
263
+ callback = optionsOrCallback;
264
+ options = {};
265
+ }
266
+ else {
267
+ options = optionsOrCallback;
268
+ }
269
+ options = options || {};
270
+ options.otherArgs = options.otherArgs || {};
271
+ options.otherArgs.headers = options.otherArgs.headers || {};
272
+ options.otherArgs.headers['x-goog-request-params'] =
273
+ this._gaxModule.routingHeader.fromParams({
274
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
275
+ });
276
+ this.initialize();
277
+ return this.innerApiCalls.converseConversation(request, options, callback);
278
+ }
279
+ createConversation(request, optionsOrCallback, callback) {
280
+ var _a;
281
+ request = request || {};
282
+ let options;
283
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
284
+ callback = optionsOrCallback;
285
+ options = {};
286
+ }
287
+ else {
288
+ options = optionsOrCallback;
289
+ }
290
+ options = options || {};
291
+ options.otherArgs = options.otherArgs || {};
292
+ options.otherArgs.headers = options.otherArgs.headers || {};
293
+ options.otherArgs.headers['x-goog-request-params'] =
294
+ this._gaxModule.routingHeader.fromParams({
295
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
296
+ });
297
+ this.initialize();
298
+ return this.innerApiCalls.createConversation(request, options, callback);
299
+ }
300
+ deleteConversation(request, optionsOrCallback, callback) {
301
+ var _a;
302
+ request = request || {};
303
+ let options;
304
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
305
+ callback = optionsOrCallback;
306
+ options = {};
307
+ }
308
+ else {
309
+ options = optionsOrCallback;
310
+ }
311
+ options = options || {};
312
+ options.otherArgs = options.otherArgs || {};
313
+ options.otherArgs.headers = options.otherArgs.headers || {};
314
+ options.otherArgs.headers['x-goog-request-params'] =
315
+ this._gaxModule.routingHeader.fromParams({
316
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
317
+ });
318
+ this.initialize();
319
+ return this.innerApiCalls.deleteConversation(request, options, callback);
320
+ }
321
+ updateConversation(request, optionsOrCallback, callback) {
322
+ var _a;
323
+ request = request || {};
324
+ let options;
325
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
326
+ callback = optionsOrCallback;
327
+ options = {};
328
+ }
329
+ else {
330
+ options = optionsOrCallback;
331
+ }
332
+ options = options || {};
333
+ options.otherArgs = options.otherArgs || {};
334
+ options.otherArgs.headers = options.otherArgs.headers || {};
335
+ options.otherArgs.headers['x-goog-request-params'] =
336
+ this._gaxModule.routingHeader.fromParams({
337
+ 'conversation.name': (_a = request.conversation.name) !== null && _a !== void 0 ? _a : '',
338
+ });
339
+ this.initialize();
340
+ return this.innerApiCalls.updateConversation(request, options, callback);
341
+ }
342
+ getConversation(request, optionsOrCallback, callback) {
343
+ var _a;
344
+ request = request || {};
345
+ let options;
346
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
347
+ callback = optionsOrCallback;
348
+ options = {};
349
+ }
350
+ else {
351
+ options = optionsOrCallback;
352
+ }
353
+ options = options || {};
354
+ options.otherArgs = options.otherArgs || {};
355
+ options.otherArgs.headers = options.otherArgs.headers || {};
356
+ options.otherArgs.headers['x-goog-request-params'] =
357
+ this._gaxModule.routingHeader.fromParams({
358
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
359
+ });
360
+ this.initialize();
361
+ return this.innerApiCalls.getConversation(request, options, callback);
362
+ }
363
+ listConversations(request, optionsOrCallback, callback) {
364
+ var _a;
365
+ request = request || {};
366
+ let options;
367
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
368
+ callback = optionsOrCallback;
369
+ options = {};
370
+ }
371
+ else {
372
+ options = optionsOrCallback;
373
+ }
374
+ options = options || {};
375
+ options.otherArgs = options.otherArgs || {};
376
+ options.otherArgs.headers = options.otherArgs.headers || {};
377
+ options.otherArgs.headers['x-goog-request-params'] =
378
+ this._gaxModule.routingHeader.fromParams({
379
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
380
+ });
381
+ this.initialize();
382
+ return this.innerApiCalls.listConversations(request, options, callback);
383
+ }
384
+ /**
385
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
386
+ * @param {Object} request
387
+ * The request object that will be sent.
388
+ * @param {string} request.parent
389
+ * Required. The data store resource name. Format:
390
+ * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
391
+ * @param {number} request.pageSize
392
+ * Maximum number of results to return. If unspecified, defaults
393
+ * to 50. Max allowed value is 1000.
394
+ * @param {string} request.pageToken
395
+ * A page token, received from a previous `ListConversations` call.
396
+ * Provide this to retrieve the subsequent page.
397
+ * @param {string} request.filter
398
+ * A filter to apply on the list results. The supported features are:
399
+ * user_pseudo_id, state.
400
+ *
401
+ * Example:
402
+ * "user_pseudo_id = some_id"
403
+ * @param {string} request.orderBy
404
+ * A comma-separated list of fields to order by, sorted in ascending order.
405
+ * Use "desc" after a field name for descending.
406
+ * Supported fields:
407
+ * * `update_time`
408
+ * * `create_time`
409
+ * * `conversation_name`
410
+ *
411
+ * Example:
412
+ * "update_time desc"
413
+ * "create_time"
414
+ * @param {object} [options]
415
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
416
+ * @returns {Stream}
417
+ * An object stream which emits an object representing {@link protos.google.cloud.discoveryengine.v1beta.Conversation|Conversation} on 'data' event.
418
+ * The client library will perform auto-pagination by default: it will call the API as many
419
+ * times as needed. Note that it can affect your quota.
420
+ * We recommend using `listConversationsAsync()`
421
+ * method described below for async iteration which you can stop as needed.
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
+ */
425
+ listConversationsStream(request, options) {
426
+ var _a;
427
+ request = request || {};
428
+ options = options || {};
429
+ options.otherArgs = options.otherArgs || {};
430
+ options.otherArgs.headers = options.otherArgs.headers || {};
431
+ options.otherArgs.headers['x-goog-request-params'] =
432
+ this._gaxModule.routingHeader.fromParams({
433
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
434
+ });
435
+ const defaultCallSettings = this._defaults['listConversations'];
436
+ const callSettings = defaultCallSettings.merge(options);
437
+ this.initialize();
438
+ return this.descriptors.page.listConversations.createStream(this.innerApiCalls.listConversations, request, callSettings);
439
+ }
440
+ /**
441
+ * Equivalent to `listConversations`, but returns an iterable object.
442
+ *
443
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
444
+ * @param {Object} request
445
+ * The request object that will be sent.
446
+ * @param {string} request.parent
447
+ * Required. The data store resource name. Format:
448
+ * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
449
+ * @param {number} request.pageSize
450
+ * Maximum number of results to return. If unspecified, defaults
451
+ * to 50. Max allowed value is 1000.
452
+ * @param {string} request.pageToken
453
+ * A page token, received from a previous `ListConversations` call.
454
+ * Provide this to retrieve the subsequent page.
455
+ * @param {string} request.filter
456
+ * A filter to apply on the list results. The supported features are:
457
+ * user_pseudo_id, state.
458
+ *
459
+ * Example:
460
+ * "user_pseudo_id = some_id"
461
+ * @param {string} request.orderBy
462
+ * A comma-separated list of fields to order by, sorted in ascending order.
463
+ * Use "desc" after a field name for descending.
464
+ * Supported fields:
465
+ * * `update_time`
466
+ * * `create_time`
467
+ * * `conversation_name`
468
+ *
469
+ * Example:
470
+ * "update_time desc"
471
+ * "create_time"
472
+ * @param {object} [options]
473
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
474
+ * @returns {Object}
475
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
476
+ * When you iterate the returned iterable, each element will be an object representing
477
+ * {@link protos.google.cloud.discoveryengine.v1beta.Conversation|Conversation}. The API will be called under the hood as needed, once per the page,
478
+ * so you can stop the iteration when you don't need more results.
479
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
480
+ * for more details and examples.
481
+ * @example <caption>include:samples/generated/v1beta/conversational_search_service.list_conversations.js</caption>
482
+ * region_tag:discoveryengine_v1beta_generated_ConversationalSearchService_ListConversations_async
483
+ */
484
+ listConversationsAsync(request, options) {
485
+ var _a;
486
+ request = request || {};
487
+ options = options || {};
488
+ options.otherArgs = options.otherArgs || {};
489
+ options.otherArgs.headers = options.otherArgs.headers || {};
490
+ options.otherArgs.headers['x-goog-request-params'] =
491
+ this._gaxModule.routingHeader.fromParams({
492
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
493
+ });
494
+ const defaultCallSettings = this._defaults['listConversations'];
495
+ const callSettings = defaultCallSettings.merge(options);
496
+ this.initialize();
497
+ return this.descriptors.page.listConversations.asyncIterate(this.innerApiCalls['listConversations'], request, callSettings);
498
+ }
499
+ // --------------------
500
+ // -- Path templates --
501
+ // --------------------
502
+ /**
503
+ * Return a fully-qualified projectLocationCollectionDataStore resource name string.
504
+ *
505
+ * @param {string} project
506
+ * @param {string} location
507
+ * @param {string} collection
508
+ * @param {string} data_store
509
+ * @returns {string} Resource name string.
510
+ */
511
+ projectLocationCollectionDataStorePath(project, location, collection, dataStore) {
512
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.render({
513
+ project: project,
514
+ location: location,
515
+ collection: collection,
516
+ data_store: dataStore,
517
+ });
518
+ }
519
+ /**
520
+ * Parse the project from ProjectLocationCollectionDataStore resource.
521
+ *
522
+ * @param {string} projectLocationCollectionDataStoreName
523
+ * A fully-qualified path representing project_location_collection_data_store resource.
524
+ * @returns {string} A string representing the project.
525
+ */
526
+ matchProjectFromProjectLocationCollectionDataStoreName(projectLocationCollectionDataStoreName) {
527
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match(projectLocationCollectionDataStoreName).project;
528
+ }
529
+ /**
530
+ * Parse the location from ProjectLocationCollectionDataStore resource.
531
+ *
532
+ * @param {string} projectLocationCollectionDataStoreName
533
+ * A fully-qualified path representing project_location_collection_data_store resource.
534
+ * @returns {string} A string representing the location.
535
+ */
536
+ matchLocationFromProjectLocationCollectionDataStoreName(projectLocationCollectionDataStoreName) {
537
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match(projectLocationCollectionDataStoreName).location;
538
+ }
539
+ /**
540
+ * Parse the collection from ProjectLocationCollectionDataStore resource.
541
+ *
542
+ * @param {string} projectLocationCollectionDataStoreName
543
+ * A fully-qualified path representing project_location_collection_data_store resource.
544
+ * @returns {string} A string representing the collection.
545
+ */
546
+ matchCollectionFromProjectLocationCollectionDataStoreName(projectLocationCollectionDataStoreName) {
547
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match(projectLocationCollectionDataStoreName).collection;
548
+ }
549
+ /**
550
+ * Parse the data_store from ProjectLocationCollectionDataStore resource.
551
+ *
552
+ * @param {string} projectLocationCollectionDataStoreName
553
+ * A fully-qualified path representing project_location_collection_data_store resource.
554
+ * @returns {string} A string representing the data_store.
555
+ */
556
+ matchDataStoreFromProjectLocationCollectionDataStoreName(projectLocationCollectionDataStoreName) {
557
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match(projectLocationCollectionDataStoreName).data_store;
558
+ }
559
+ /**
560
+ * Return a fully-qualified projectLocationCollectionDataStoreBranchDocument resource name string.
561
+ *
562
+ * @param {string} project
563
+ * @param {string} location
564
+ * @param {string} collection
565
+ * @param {string} data_store
566
+ * @param {string} branch
567
+ * @param {string} document
568
+ * @returns {string} Resource name string.
569
+ */
570
+ projectLocationCollectionDataStoreBranchDocumentPath(project, location, collection, dataStore, branch, document) {
571
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.render({
572
+ project: project,
573
+ location: location,
574
+ collection: collection,
575
+ data_store: dataStore,
576
+ branch: branch,
577
+ document: document,
578
+ });
579
+ }
580
+ /**
581
+ * Parse the project from ProjectLocationCollectionDataStoreBranchDocument resource.
582
+ *
583
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
584
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
585
+ * @returns {string} A string representing the project.
586
+ */
587
+ matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
588
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).project;
589
+ }
590
+ /**
591
+ * Parse the location from ProjectLocationCollectionDataStoreBranchDocument resource.
592
+ *
593
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
594
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
595
+ * @returns {string} A string representing the location.
596
+ */
597
+ matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
598
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).location;
599
+ }
600
+ /**
601
+ * Parse the collection from ProjectLocationCollectionDataStoreBranchDocument resource.
602
+ *
603
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
604
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
605
+ * @returns {string} A string representing the collection.
606
+ */
607
+ matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
608
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).collection;
609
+ }
610
+ /**
611
+ * Parse the data_store from ProjectLocationCollectionDataStoreBranchDocument resource.
612
+ *
613
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
614
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
615
+ * @returns {string} A string representing the data_store.
616
+ */
617
+ matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
618
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).data_store;
619
+ }
620
+ /**
621
+ * Parse the branch from ProjectLocationCollectionDataStoreBranchDocument resource.
622
+ *
623
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
624
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
625
+ * @returns {string} A string representing the branch.
626
+ */
627
+ matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
628
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).branch;
629
+ }
630
+ /**
631
+ * Parse the document from ProjectLocationCollectionDataStoreBranchDocument resource.
632
+ *
633
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
634
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
635
+ * @returns {string} A string representing the document.
636
+ */
637
+ matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
638
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).document;
639
+ }
640
+ /**
641
+ * Return a fully-qualified projectLocationCollectionDataStoreConversation resource name string.
642
+ *
643
+ * @param {string} project
644
+ * @param {string} location
645
+ * @param {string} collection
646
+ * @param {string} data_store
647
+ * @param {string} conversation
648
+ * @returns {string} Resource name string.
649
+ */
650
+ projectLocationCollectionDataStoreConversationPath(project, location, collection, dataStore, conversation) {
651
+ return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.render({
652
+ project: project,
653
+ location: location,
654
+ collection: collection,
655
+ data_store: dataStore,
656
+ conversation: conversation,
657
+ });
658
+ }
659
+ /**
660
+ * Parse the project from ProjectLocationCollectionDataStoreConversation resource.
661
+ *
662
+ * @param {string} projectLocationCollectionDataStoreConversationName
663
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
664
+ * @returns {string} A string representing the project.
665
+ */
666
+ matchProjectFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
667
+ return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).project;
668
+ }
669
+ /**
670
+ * Parse the location from ProjectLocationCollectionDataStoreConversation resource.
671
+ *
672
+ * @param {string} projectLocationCollectionDataStoreConversationName
673
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
674
+ * @returns {string} A string representing the location.
675
+ */
676
+ matchLocationFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
677
+ return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).location;
678
+ }
679
+ /**
680
+ * Parse the collection from ProjectLocationCollectionDataStoreConversation resource.
681
+ *
682
+ * @param {string} projectLocationCollectionDataStoreConversationName
683
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
684
+ * @returns {string} A string representing the collection.
685
+ */
686
+ matchCollectionFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
687
+ return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).collection;
688
+ }
689
+ /**
690
+ * Parse the data_store from ProjectLocationCollectionDataStoreConversation resource.
691
+ *
692
+ * @param {string} projectLocationCollectionDataStoreConversationName
693
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
694
+ * @returns {string} A string representing the data_store.
695
+ */
696
+ matchDataStoreFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
697
+ return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).data_store;
698
+ }
699
+ /**
700
+ * Parse the conversation from ProjectLocationCollectionDataStoreConversation resource.
701
+ *
702
+ * @param {string} projectLocationCollectionDataStoreConversationName
703
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
704
+ * @returns {string} A string representing the conversation.
705
+ */
706
+ matchConversationFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
707
+ return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).conversation;
708
+ }
709
+ /**
710
+ * Return a fully-qualified projectLocationCollectionDataStoreSchema resource name string.
711
+ *
712
+ * @param {string} project
713
+ * @param {string} location
714
+ * @param {string} collection
715
+ * @param {string} data_store
716
+ * @param {string} schema
717
+ * @returns {string} Resource name string.
718
+ */
719
+ projectLocationCollectionDataStoreSchemaPath(project, location, collection, dataStore, schema) {
720
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.render({
721
+ project: project,
722
+ location: location,
723
+ collection: collection,
724
+ data_store: dataStore,
725
+ schema: schema,
726
+ });
727
+ }
728
+ /**
729
+ * Parse the project from ProjectLocationCollectionDataStoreSchema resource.
730
+ *
731
+ * @param {string} projectLocationCollectionDataStoreSchemaName
732
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
733
+ * @returns {string} A string representing the project.
734
+ */
735
+ matchProjectFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
736
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).project;
737
+ }
738
+ /**
739
+ * Parse the location from ProjectLocationCollectionDataStoreSchema resource.
740
+ *
741
+ * @param {string} projectLocationCollectionDataStoreSchemaName
742
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
743
+ * @returns {string} A string representing the location.
744
+ */
745
+ matchLocationFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
746
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).location;
747
+ }
748
+ /**
749
+ * Parse the collection from ProjectLocationCollectionDataStoreSchema resource.
750
+ *
751
+ * @param {string} projectLocationCollectionDataStoreSchemaName
752
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
753
+ * @returns {string} A string representing the collection.
754
+ */
755
+ matchCollectionFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
756
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).collection;
757
+ }
758
+ /**
759
+ * Parse the data_store from ProjectLocationCollectionDataStoreSchema resource.
760
+ *
761
+ * @param {string} projectLocationCollectionDataStoreSchemaName
762
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
763
+ * @returns {string} A string representing the data_store.
764
+ */
765
+ matchDataStoreFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
766
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).data_store;
767
+ }
768
+ /**
769
+ * Parse the schema from ProjectLocationCollectionDataStoreSchema resource.
770
+ *
771
+ * @param {string} projectLocationCollectionDataStoreSchemaName
772
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
773
+ * @returns {string} A string representing the schema.
774
+ */
775
+ matchSchemaFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
776
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).schema;
777
+ }
778
+ /**
779
+ * Return a fully-qualified projectLocationCollectionDataStoreServingConfig resource name string.
780
+ *
781
+ * @param {string} project
782
+ * @param {string} location
783
+ * @param {string} collection
784
+ * @param {string} data_store
785
+ * @param {string} serving_config
786
+ * @returns {string} Resource name string.
787
+ */
788
+ projectLocationCollectionDataStoreServingConfigPath(project, location, collection, dataStore, servingConfig) {
789
+ return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.render({
790
+ project: project,
791
+ location: location,
792
+ collection: collection,
793
+ data_store: dataStore,
794
+ serving_config: servingConfig,
795
+ });
796
+ }
797
+ /**
798
+ * Parse the project from ProjectLocationCollectionDataStoreServingConfig resource.
799
+ *
800
+ * @param {string} projectLocationCollectionDataStoreServingConfigName
801
+ * A fully-qualified path representing project_location_collection_data_store_serving_config resource.
802
+ * @returns {string} A string representing the project.
803
+ */
804
+ matchProjectFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName) {
805
+ return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match(projectLocationCollectionDataStoreServingConfigName).project;
806
+ }
807
+ /**
808
+ * Parse the location from ProjectLocationCollectionDataStoreServingConfig resource.
809
+ *
810
+ * @param {string} projectLocationCollectionDataStoreServingConfigName
811
+ * A fully-qualified path representing project_location_collection_data_store_serving_config resource.
812
+ * @returns {string} A string representing the location.
813
+ */
814
+ matchLocationFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName) {
815
+ return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match(projectLocationCollectionDataStoreServingConfigName).location;
816
+ }
817
+ /**
818
+ * Parse the collection from ProjectLocationCollectionDataStoreServingConfig resource.
819
+ *
820
+ * @param {string} projectLocationCollectionDataStoreServingConfigName
821
+ * A fully-qualified path representing project_location_collection_data_store_serving_config resource.
822
+ * @returns {string} A string representing the collection.
823
+ */
824
+ matchCollectionFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName) {
825
+ return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match(projectLocationCollectionDataStoreServingConfigName).collection;
826
+ }
827
+ /**
828
+ * Parse the data_store from ProjectLocationCollectionDataStoreServingConfig resource.
829
+ *
830
+ * @param {string} projectLocationCollectionDataStoreServingConfigName
831
+ * A fully-qualified path representing project_location_collection_data_store_serving_config resource.
832
+ * @returns {string} A string representing the data_store.
833
+ */
834
+ matchDataStoreFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName) {
835
+ return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match(projectLocationCollectionDataStoreServingConfigName).data_store;
836
+ }
837
+ /**
838
+ * Parse the serving_config from ProjectLocationCollectionDataStoreServingConfig resource.
839
+ *
840
+ * @param {string} projectLocationCollectionDataStoreServingConfigName
841
+ * A fully-qualified path representing project_location_collection_data_store_serving_config resource.
842
+ * @returns {string} A string representing the serving_config.
843
+ */
844
+ matchServingConfigFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName) {
845
+ return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match(projectLocationCollectionDataStoreServingConfigName).serving_config;
846
+ }
847
+ /**
848
+ * Return a fully-qualified projectLocationDataStore resource name string.
849
+ *
850
+ * @param {string} project
851
+ * @param {string} location
852
+ * @param {string} data_store
853
+ * @returns {string} Resource name string.
854
+ */
855
+ projectLocationDataStorePath(project, location, dataStore) {
856
+ return this.pathTemplates.projectLocationDataStorePathTemplate.render({
857
+ project: project,
858
+ location: location,
859
+ data_store: dataStore,
860
+ });
861
+ }
862
+ /**
863
+ * Parse the project from ProjectLocationDataStore resource.
864
+ *
865
+ * @param {string} projectLocationDataStoreName
866
+ * A fully-qualified path representing project_location_data_store resource.
867
+ * @returns {string} A string representing the project.
868
+ */
869
+ matchProjectFromProjectLocationDataStoreName(projectLocationDataStoreName) {
870
+ return this.pathTemplates.projectLocationDataStorePathTemplate.match(projectLocationDataStoreName).project;
871
+ }
872
+ /**
873
+ * Parse the location from ProjectLocationDataStore resource.
874
+ *
875
+ * @param {string} projectLocationDataStoreName
876
+ * A fully-qualified path representing project_location_data_store resource.
877
+ * @returns {string} A string representing the location.
878
+ */
879
+ matchLocationFromProjectLocationDataStoreName(projectLocationDataStoreName) {
880
+ return this.pathTemplates.projectLocationDataStorePathTemplate.match(projectLocationDataStoreName).location;
881
+ }
882
+ /**
883
+ * Parse the data_store from ProjectLocationDataStore resource.
884
+ *
885
+ * @param {string} projectLocationDataStoreName
886
+ * A fully-qualified path representing project_location_data_store resource.
887
+ * @returns {string} A string representing the data_store.
888
+ */
889
+ matchDataStoreFromProjectLocationDataStoreName(projectLocationDataStoreName) {
890
+ return this.pathTemplates.projectLocationDataStorePathTemplate.match(projectLocationDataStoreName).data_store;
891
+ }
892
+ /**
893
+ * Return a fully-qualified projectLocationDataStoreBranchDocument resource name string.
894
+ *
895
+ * @param {string} project
896
+ * @param {string} location
897
+ * @param {string} data_store
898
+ * @param {string} branch
899
+ * @param {string} document
900
+ * @returns {string} Resource name string.
901
+ */
902
+ projectLocationDataStoreBranchDocumentPath(project, location, dataStore, branch, document) {
903
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.render({
904
+ project: project,
905
+ location: location,
906
+ data_store: dataStore,
907
+ branch: branch,
908
+ document: document,
909
+ });
910
+ }
911
+ /**
912
+ * Parse the project from ProjectLocationDataStoreBranchDocument resource.
913
+ *
914
+ * @param {string} projectLocationDataStoreBranchDocumentName
915
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
916
+ * @returns {string} A string representing the project.
917
+ */
918
+ matchProjectFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
919
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).project;
920
+ }
921
+ /**
922
+ * Parse the location from ProjectLocationDataStoreBranchDocument resource.
923
+ *
924
+ * @param {string} projectLocationDataStoreBranchDocumentName
925
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
926
+ * @returns {string} A string representing the location.
927
+ */
928
+ matchLocationFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
929
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).location;
930
+ }
931
+ /**
932
+ * Parse the data_store from ProjectLocationDataStoreBranchDocument resource.
933
+ *
934
+ * @param {string} projectLocationDataStoreBranchDocumentName
935
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
936
+ * @returns {string} A string representing the data_store.
937
+ */
938
+ matchDataStoreFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
939
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).data_store;
940
+ }
941
+ /**
942
+ * Parse the branch from ProjectLocationDataStoreBranchDocument resource.
943
+ *
944
+ * @param {string} projectLocationDataStoreBranchDocumentName
945
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
946
+ * @returns {string} A string representing the branch.
947
+ */
948
+ matchBranchFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
949
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).branch;
950
+ }
951
+ /**
952
+ * Parse the document from ProjectLocationDataStoreBranchDocument resource.
953
+ *
954
+ * @param {string} projectLocationDataStoreBranchDocumentName
955
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
956
+ * @returns {string} A string representing the document.
957
+ */
958
+ matchDocumentFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
959
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).document;
960
+ }
961
+ /**
962
+ * Return a fully-qualified projectLocationDataStoreConversation resource name string.
963
+ *
964
+ * @param {string} project
965
+ * @param {string} location
966
+ * @param {string} data_store
967
+ * @param {string} conversation
968
+ * @returns {string} Resource name string.
969
+ */
970
+ projectLocationDataStoreConversationPath(project, location, dataStore, conversation) {
971
+ return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.render({
972
+ project: project,
973
+ location: location,
974
+ data_store: dataStore,
975
+ conversation: conversation,
976
+ });
977
+ }
978
+ /**
979
+ * Parse the project from ProjectLocationDataStoreConversation resource.
980
+ *
981
+ * @param {string} projectLocationDataStoreConversationName
982
+ * A fully-qualified path representing project_location_data_store_conversation resource.
983
+ * @returns {string} A string representing the project.
984
+ */
985
+ matchProjectFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName) {
986
+ return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match(projectLocationDataStoreConversationName).project;
987
+ }
988
+ /**
989
+ * Parse the location from ProjectLocationDataStoreConversation resource.
990
+ *
991
+ * @param {string} projectLocationDataStoreConversationName
992
+ * A fully-qualified path representing project_location_data_store_conversation resource.
993
+ * @returns {string} A string representing the location.
994
+ */
995
+ matchLocationFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName) {
996
+ return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match(projectLocationDataStoreConversationName).location;
997
+ }
998
+ /**
999
+ * Parse the data_store from ProjectLocationDataStoreConversation resource.
1000
+ *
1001
+ * @param {string} projectLocationDataStoreConversationName
1002
+ * A fully-qualified path representing project_location_data_store_conversation resource.
1003
+ * @returns {string} A string representing the data_store.
1004
+ */
1005
+ matchDataStoreFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName) {
1006
+ return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match(projectLocationDataStoreConversationName).data_store;
1007
+ }
1008
+ /**
1009
+ * Parse the conversation from ProjectLocationDataStoreConversation resource.
1010
+ *
1011
+ * @param {string} projectLocationDataStoreConversationName
1012
+ * A fully-qualified path representing project_location_data_store_conversation resource.
1013
+ * @returns {string} A string representing the conversation.
1014
+ */
1015
+ matchConversationFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName) {
1016
+ return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match(projectLocationDataStoreConversationName).conversation;
1017
+ }
1018
+ /**
1019
+ * Return a fully-qualified projectLocationDataStoreSchema resource name string.
1020
+ *
1021
+ * @param {string} project
1022
+ * @param {string} location
1023
+ * @param {string} data_store
1024
+ * @param {string} schema
1025
+ * @returns {string} Resource name string.
1026
+ */
1027
+ projectLocationDataStoreSchemaPath(project, location, dataStore, schema) {
1028
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.render({
1029
+ project: project,
1030
+ location: location,
1031
+ data_store: dataStore,
1032
+ schema: schema,
1033
+ });
1034
+ }
1035
+ /**
1036
+ * Parse the project from ProjectLocationDataStoreSchema resource.
1037
+ *
1038
+ * @param {string} projectLocationDataStoreSchemaName
1039
+ * A fully-qualified path representing project_location_data_store_schema resource.
1040
+ * @returns {string} A string representing the project.
1041
+ */
1042
+ matchProjectFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
1043
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).project;
1044
+ }
1045
+ /**
1046
+ * Parse the location from ProjectLocationDataStoreSchema resource.
1047
+ *
1048
+ * @param {string} projectLocationDataStoreSchemaName
1049
+ * A fully-qualified path representing project_location_data_store_schema resource.
1050
+ * @returns {string} A string representing the location.
1051
+ */
1052
+ matchLocationFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
1053
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).location;
1054
+ }
1055
+ /**
1056
+ * Parse the data_store from ProjectLocationDataStoreSchema resource.
1057
+ *
1058
+ * @param {string} projectLocationDataStoreSchemaName
1059
+ * A fully-qualified path representing project_location_data_store_schema resource.
1060
+ * @returns {string} A string representing the data_store.
1061
+ */
1062
+ matchDataStoreFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
1063
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).data_store;
1064
+ }
1065
+ /**
1066
+ * Parse the schema from ProjectLocationDataStoreSchema resource.
1067
+ *
1068
+ * @param {string} projectLocationDataStoreSchemaName
1069
+ * A fully-qualified path representing project_location_data_store_schema resource.
1070
+ * @returns {string} A string representing the schema.
1071
+ */
1072
+ matchSchemaFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
1073
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).schema;
1074
+ }
1075
+ /**
1076
+ * Return a fully-qualified projectLocationDataStoreServingConfig resource name string.
1077
+ *
1078
+ * @param {string} project
1079
+ * @param {string} location
1080
+ * @param {string} data_store
1081
+ * @param {string} serving_config
1082
+ * @returns {string} Resource name string.
1083
+ */
1084
+ projectLocationDataStoreServingConfigPath(project, location, dataStore, servingConfig) {
1085
+ return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.render({
1086
+ project: project,
1087
+ location: location,
1088
+ data_store: dataStore,
1089
+ serving_config: servingConfig,
1090
+ });
1091
+ }
1092
+ /**
1093
+ * Parse the project from ProjectLocationDataStoreServingConfig resource.
1094
+ *
1095
+ * @param {string} projectLocationDataStoreServingConfigName
1096
+ * A fully-qualified path representing project_location_data_store_serving_config resource.
1097
+ * @returns {string} A string representing the project.
1098
+ */
1099
+ matchProjectFromProjectLocationDataStoreServingConfigName(projectLocationDataStoreServingConfigName) {
1100
+ return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.match(projectLocationDataStoreServingConfigName).project;
1101
+ }
1102
+ /**
1103
+ * Parse the location from ProjectLocationDataStoreServingConfig resource.
1104
+ *
1105
+ * @param {string} projectLocationDataStoreServingConfigName
1106
+ * A fully-qualified path representing project_location_data_store_serving_config resource.
1107
+ * @returns {string} A string representing the location.
1108
+ */
1109
+ matchLocationFromProjectLocationDataStoreServingConfigName(projectLocationDataStoreServingConfigName) {
1110
+ return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.match(projectLocationDataStoreServingConfigName).location;
1111
+ }
1112
+ /**
1113
+ * Parse the data_store from ProjectLocationDataStoreServingConfig resource.
1114
+ *
1115
+ * @param {string} projectLocationDataStoreServingConfigName
1116
+ * A fully-qualified path representing project_location_data_store_serving_config resource.
1117
+ * @returns {string} A string representing the data_store.
1118
+ */
1119
+ matchDataStoreFromProjectLocationDataStoreServingConfigName(projectLocationDataStoreServingConfigName) {
1120
+ return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.match(projectLocationDataStoreServingConfigName).data_store;
1121
+ }
1122
+ /**
1123
+ * Parse the serving_config from ProjectLocationDataStoreServingConfig resource.
1124
+ *
1125
+ * @param {string} projectLocationDataStoreServingConfigName
1126
+ * A fully-qualified path representing project_location_data_store_serving_config resource.
1127
+ * @returns {string} A string representing the serving_config.
1128
+ */
1129
+ matchServingConfigFromProjectLocationDataStoreServingConfigName(projectLocationDataStoreServingConfigName) {
1130
+ return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.match(projectLocationDataStoreServingConfigName).serving_config;
1131
+ }
1132
+ /**
1133
+ * Terminate the gRPC channel and close the client.
1134
+ *
1135
+ * The client will no longer be usable and all future behavior is undefined.
1136
+ * @returns {Promise} A promise that resolves when the client is closed.
1137
+ */
1138
+ close() {
1139
+ if (this.conversationalSearchServiceStub && !this._terminated) {
1140
+ return this.conversationalSearchServiceStub.then(stub => {
1141
+ this._terminated = true;
1142
+ stub.close();
1143
+ });
1144
+ }
1145
+ return Promise.resolve();
1146
+ }
1147
+ }
1148
+ exports.ConversationalSearchServiceClient = ConversationalSearchServiceClient;
1149
+ //# sourceMappingURL=conversational_search_service_client.js.map