@google-cloud/discoveryengine 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +39 -0
  3. package/build/protos/google/cloud/discoveryengine/v1alpha/common.proto +190 -0
  4. package/build/protos/google/cloud/discoveryengine/v1alpha/completion_service.proto +134 -0
  5. package/build/protos/google/cloud/discoveryengine/v1alpha/conversation.proto +138 -0
  6. package/build/protos/google/cloud/discoveryengine/v1alpha/conversational_search_service.proto +306 -0
  7. package/build/protos/google/cloud/discoveryengine/v1alpha/data_store.proto +98 -0
  8. package/build/protos/google/cloud/discoveryengine/v1alpha/data_store_service.proto +307 -0
  9. package/build/protos/google/cloud/discoveryengine/v1alpha/document.proto +121 -0
  10. package/build/protos/google/cloud/discoveryengine/v1alpha/document_service.proto +318 -0
  11. package/build/protos/google/cloud/discoveryengine/v1alpha/engine.proto +370 -0
  12. package/build/protos/google/cloud/discoveryengine/v1alpha/engine_service.proto +336 -0
  13. package/build/protos/google/cloud/discoveryengine/v1alpha/import_config.proto +343 -0
  14. package/build/protos/google/cloud/discoveryengine/v1alpha/purge_config.proto +159 -0
  15. package/build/protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto +227 -0
  16. package/build/protos/google/cloud/discoveryengine/v1alpha/schema.proto +312 -0
  17. package/build/protos/google/cloud/discoveryengine/v1alpha/schema_service.proto +260 -0
  18. package/build/protos/google/cloud/discoveryengine/v1alpha/search_service.proto +874 -0
  19. package/build/protos/google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto +152 -0
  20. package/build/protos/google/cloud/discoveryengine/v1alpha/user_event.proto +475 -0
  21. package/build/protos/google/cloud/discoveryengine/v1alpha/user_event_service.proto +154 -0
  22. package/build/protos/protos.d.ts +16365 -7
  23. package/build/protos/protos.js +42499 -1945
  24. package/build/protos/protos.json +4455 -5
  25. package/build/src/index.d.ts +3 -1
  26. package/build/src/index.js +4 -1
  27. package/build/src/v1alpha/completion_service_client.d.ts +645 -0
  28. package/build/src/v1alpha/completion_service_client.js +901 -0
  29. package/build/src/v1alpha/completion_service_client_config.json +43 -0
  30. package/build/src/v1alpha/conversational_search_service_client.d.ts +1040 -0
  31. package/build/src/v1alpha/conversational_search_service_client.js +1333 -0
  32. package/build/src/v1alpha/conversational_search_service_client_config.json +68 -0
  33. package/build/src/v1alpha/data_store_service_client.d.ts +1060 -0
  34. package/build/src/v1alpha/data_store_service_client.js +1431 -0
  35. package/build/src/v1alpha/data_store_service_client_config.json +46 -0
  36. package/build/src/v1alpha/document_service_client.d.ts +1257 -0
  37. package/build/src/v1alpha/document_service_client.js +1555 -0
  38. package/build/src/v1alpha/document_service_client_config.json +82 -0
  39. package/build/src/v1alpha/engine_service_client.d.ts +1079 -0
  40. package/build/src/v1alpha/engine_service_client.js +1481 -0
  41. package/build/src/v1alpha/engine_service_client_config.json +58 -0
  42. package/build/src/v1alpha/index.d.ts +10 -0
  43. package/build/src/v1alpha/index.js +41 -0
  44. package/build/src/v1alpha/recommendation_service_client.d.ts +858 -0
  45. package/build/src/v1alpha/recommendation_service_client.js +1100 -0
  46. package/build/src/v1alpha/recommendation_service_client_config.json +43 -0
  47. package/build/src/v1alpha/schema_service_client.d.ts +977 -0
  48. package/build/src/v1alpha/schema_service_client.js +1385 -0
  49. package/build/src/v1alpha/schema_service_client_config.json +63 -0
  50. package/build/src/v1alpha/search_service_client.d.ts +1394 -0
  51. package/build/src/v1alpha/search_service_client.js +1640 -0
  52. package/build/src/v1alpha/search_service_client_config.json +43 -0
  53. package/build/src/v1alpha/site_search_engine_service_client.d.ts +821 -0
  54. package/build/src/v1alpha/site_search_engine_service_client.js +1249 -0
  55. package/build/src/v1alpha/site_search_engine_service_client_config.json +30 -0
  56. package/build/src/v1alpha/user_event_service_client.d.ts +895 -0
  57. package/build/src/v1alpha/user_event_service_client.js +1232 -0
  58. package/build/src/v1alpha/user_event_service_client_config.json +67 -0
  59. package/package.json +5 -5
@@ -0,0 +1,1232 @@
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.UserEventServiceClient = void 0;
21
+ const jsonProtos = require("../../protos/protos.json");
22
+ /**
23
+ * Client JSON configuration object, loaded from
24
+ * `src/v1alpha/user_event_service_client_config.json`.
25
+ * This file defines retry strategy and timeouts for all API methods in this library.
26
+ */
27
+ const gapicConfig = require("./user_event_service_client_config.json");
28
+ const version = require('../../../package.json').version;
29
+ /**
30
+ * Service for ingesting end user actions on a website to Discovery Engine API.
31
+ * @class
32
+ * @memberof v1alpha
33
+ */
34
+ class UserEventServiceClient {
35
+ /**
36
+ * Construct an instance of UserEventServiceClient.
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} [options.fallback] - Use HTTP/1.1 REST mode.
64
+ * For more information, please check the
65
+ * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
66
+ * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
67
+ * need to avoid loading the default gRPC version and want to use the fallback
68
+ * HTTP implementation. Load only fallback version and pass it to the constructor:
69
+ * ```
70
+ * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
71
+ * const client = new UserEventServiceClient({fallback: true}, gax);
72
+ * ```
73
+ */
74
+ constructor(opts, gaxInstance) {
75
+ var _a, _b;
76
+ this._terminated = false;
77
+ this.descriptors = {
78
+ page: {},
79
+ stream: {},
80
+ longrunning: {},
81
+ batching: {},
82
+ };
83
+ // Ensure that options include all the required fields.
84
+ const staticMembers = this.constructor;
85
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath;
86
+ this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
87
+ const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
88
+ const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {};
89
+ 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');
90
+ opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
91
+ // Request numeric enum values if REST transport is used.
92
+ opts.numericEnums = true;
93
+ // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
94
+ if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
95
+ opts['scopes'] = staticMembers.scopes;
96
+ }
97
+ // Load google-gax module synchronously if needed
98
+ if (!gaxInstance) {
99
+ gaxInstance = require('google-gax');
100
+ }
101
+ // Choose either gRPC or proto-over-HTTP implementation of google-gax.
102
+ this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
103
+ // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
104
+ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
105
+ // Save options to use in initialize() method.
106
+ this._opts = opts;
107
+ // Save the auth object to the client, for use by other methods.
108
+ this.auth = this._gaxGrpc.auth;
109
+ // Set useJWTAccessWithScope on the auth object.
110
+ this.auth.useJWTAccessWithScope = true;
111
+ // Set defaultServicePath on the auth object.
112
+ this.auth.defaultServicePath = staticMembers.servicePath;
113
+ // Set the default scopes in auth client if needed.
114
+ if (servicePath === staticMembers.servicePath) {
115
+ this.auth.defaultScopes = staticMembers.scopes;
116
+ }
117
+ this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
118
+ // Determine the client header string.
119
+ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
120
+ if (typeof process !== 'undefined' && 'versions' in process) {
121
+ clientHeader.push(`gl-node/${process.versions.node}`);
122
+ }
123
+ else {
124
+ clientHeader.push(`gl-web/${this._gaxModule.version}`);
125
+ }
126
+ if (!opts.fallback) {
127
+ clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
128
+ }
129
+ else {
130
+ clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
131
+ }
132
+ if (opts.libName && opts.libVersion) {
133
+ clientHeader.push(`${opts.libName}/${opts.libVersion}`);
134
+ }
135
+ // Load the applicable protos.
136
+ this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos);
137
+ // This API contains "path templates"; forward-slash-separated
138
+ // identifiers to uniquely identify resources within the API.
139
+ // Create useful helper objects for these.
140
+ this.pathTemplates = {
141
+ enginePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/engines/{engine}'),
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
+ projectLocationDataStorePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}'),
147
+ projectLocationDataStoreBranchDocumentPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}'),
148
+ projectLocationDataStoreConversationPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}'),
149
+ projectLocationDataStoreSchemaPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}'),
150
+ };
151
+ const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
152
+ // This API contains "long-running operations", which return a
153
+ // an Operation object that allows for tracking of the operation,
154
+ // rather than holding a request open.
155
+ const lroOptions = {
156
+ auth: this.auth,
157
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
158
+ };
159
+ if (opts.fallback) {
160
+ lroOptions.protoJson = protoFilesRoot;
161
+ lroOptions.httpRules = [
162
+ {
163
+ selector: 'google.longrunning.Operations.GetOperation',
164
+ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
165
+ additional_bindings: [
166
+ {
167
+ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
168
+ },
169
+ {
170
+ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
171
+ },
172
+ {
173
+ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
174
+ },
175
+ {
176
+ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}',
177
+ },
178
+ {
179
+ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}',
180
+ },
181
+ {
182
+ get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/operations/*}',
183
+ },
184
+ {
185
+ get: '/v1alpha/{name=projects/*/locations/*/collections/*/operations/*}',
186
+ },
187
+ {
188
+ get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
189
+ },
190
+ {
191
+ get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
192
+ },
193
+ {
194
+ get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}',
195
+ },
196
+ { get: '/v1alpha/{name=projects/*/locations/*/operations/*}' },
197
+ { get: '/v1alpha/{name=projects/*/operations/*}' },
198
+ ],
199
+ },
200
+ {
201
+ selector: 'google.longrunning.Operations.ListOperations',
202
+ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
203
+ additional_bindings: [
204
+ {
205
+ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
206
+ },
207
+ {
208
+ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
209
+ },
210
+ {
211
+ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations',
212
+ },
213
+ {
214
+ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations',
215
+ },
216
+ {
217
+ get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
218
+ },
219
+ {
220
+ get: '/v1alpha/{name=projects/*/locations/*/collections/*/engines/*}/operations',
221
+ },
222
+ {
223
+ get: '/v1alpha/{name=projects/*/locations/*/collections/*}/operations',
224
+ },
225
+ {
226
+ get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
227
+ },
228
+ {
229
+ get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
230
+ },
231
+ {
232
+ get: '/v1alpha/{name=projects/*/locations/*/dataStores/*}/operations',
233
+ },
234
+ { get: '/v1alpha/{name=projects/*/locations/*}/operations' },
235
+ { get: '/v1alpha/{name=projects/*}/operations' },
236
+ ],
237
+ },
238
+ ];
239
+ }
240
+ this.operationsClient = this._gaxModule
241
+ .lro(lroOptions)
242
+ .operationsClient(opts);
243
+ const purgeUserEventsResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse');
244
+ const purgeUserEventsMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata');
245
+ const importUserEventsResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse');
246
+ const importUserEventsMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata');
247
+ this.descriptors.longrunning = {
248
+ purgeUserEvents: new this._gaxModule.LongrunningDescriptor(this.operationsClient, purgeUserEventsResponse.decode.bind(purgeUserEventsResponse), purgeUserEventsMetadata.decode.bind(purgeUserEventsMetadata)),
249
+ importUserEvents: new this._gaxModule.LongrunningDescriptor(this.operationsClient, importUserEventsResponse.decode.bind(importUserEventsResponse), importUserEventsMetadata.decode.bind(importUserEventsMetadata)),
250
+ };
251
+ // Put together the default options sent with requests.
252
+ this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1alpha.UserEventService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
253
+ // Set up a dictionary of "inner API calls"; the core implementation
254
+ // of calling the API is handled in `google-gax`, with this code
255
+ // merely providing the destination and request information.
256
+ this.innerApiCalls = {};
257
+ // Add a warn function to the client constructor so it can be easily tested.
258
+ this.warn = this._gaxModule.warn;
259
+ }
260
+ /**
261
+ * Initialize the client.
262
+ * Performs asynchronous operations (such as authentication) and prepares the client.
263
+ * This function will be called automatically when any class method is called for the
264
+ * first time, but if you need to initialize it before calling an actual method,
265
+ * feel free to call initialize() directly.
266
+ *
267
+ * You can await on this method if you want to make sure the client is initialized.
268
+ *
269
+ * @returns {Promise} A promise that resolves to an authenticated service stub.
270
+ */
271
+ initialize() {
272
+ // If the client stub promise is already initialized, return immediately.
273
+ if (this.userEventServiceStub) {
274
+ return this.userEventServiceStub;
275
+ }
276
+ // Put together the "service stub" for
277
+ // google.cloud.discoveryengine.v1alpha.UserEventService.
278
+ this.userEventServiceStub = this._gaxGrpc.createStub(this._opts.fallback
279
+ ? this._protos.lookupService('google.cloud.discoveryengine.v1alpha.UserEventService')
280
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any
281
+ this._protos.google.cloud.discoveryengine.v1alpha
282
+ .UserEventService, this._opts, this._providedCustomServicePath);
283
+ // Iterate over each of the methods that the service provides
284
+ // and create an API call method for each.
285
+ const userEventServiceStubMethods = [
286
+ 'writeUserEvent',
287
+ 'collectUserEvent',
288
+ 'purgeUserEvents',
289
+ 'importUserEvents',
290
+ ];
291
+ for (const methodName of userEventServiceStubMethods) {
292
+ const callPromise = this.userEventServiceStub.then(stub => (...args) => {
293
+ if (this._terminated) {
294
+ return Promise.reject('The client has already been closed.');
295
+ }
296
+ const func = stub[methodName];
297
+ return func.apply(stub, args);
298
+ }, (err) => () => {
299
+ throw err;
300
+ });
301
+ const descriptor = this.descriptors.longrunning[methodName] || undefined;
302
+ const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
303
+ this.innerApiCalls[methodName] = apiCall;
304
+ }
305
+ return this.userEventServiceStub;
306
+ }
307
+ /**
308
+ * The DNS address for this API service.
309
+ * @returns {string} The DNS address for this service.
310
+ */
311
+ static get servicePath() {
312
+ return 'discoveryengine.googleapis.com';
313
+ }
314
+ /**
315
+ * The DNS address for this API service - same as servicePath(),
316
+ * exists for compatibility reasons.
317
+ * @returns {string} The DNS address for this service.
318
+ */
319
+ static get apiEndpoint() {
320
+ return 'discoveryengine.googleapis.com';
321
+ }
322
+ /**
323
+ * The port for this API service.
324
+ * @returns {number} The default port for this service.
325
+ */
326
+ static get port() {
327
+ return 443;
328
+ }
329
+ /**
330
+ * The scopes needed to make gRPC calls for every method defined
331
+ * in this service.
332
+ * @returns {string[]} List of default scopes.
333
+ */
334
+ static get scopes() {
335
+ return ['https://www.googleapis.com/auth/cloud-platform'];
336
+ }
337
+ /**
338
+ * Return the project ID used by this class.
339
+ * @returns {Promise} A promise that resolves to string containing the project ID.
340
+ */
341
+ getProjectId(callback) {
342
+ if (callback) {
343
+ this.auth.getProjectId(callback);
344
+ return;
345
+ }
346
+ return this.auth.getProjectId();
347
+ }
348
+ writeUserEvent(request, optionsOrCallback, callback) {
349
+ var _a;
350
+ request = request || {};
351
+ let options;
352
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
353
+ callback = optionsOrCallback;
354
+ options = {};
355
+ }
356
+ else {
357
+ options = optionsOrCallback;
358
+ }
359
+ options = options || {};
360
+ options.otherArgs = options.otherArgs || {};
361
+ options.otherArgs.headers = options.otherArgs.headers || {};
362
+ options.otherArgs.headers['x-goog-request-params'] =
363
+ this._gaxModule.routingHeader.fromParams({
364
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
365
+ });
366
+ this.initialize();
367
+ return this.innerApiCalls.writeUserEvent(request, options, callback);
368
+ }
369
+ collectUserEvent(request, optionsOrCallback, callback) {
370
+ var _a;
371
+ request = request || {};
372
+ let options;
373
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
374
+ callback = optionsOrCallback;
375
+ options = {};
376
+ }
377
+ else {
378
+ options = optionsOrCallback;
379
+ }
380
+ options = options || {};
381
+ options.otherArgs = options.otherArgs || {};
382
+ options.otherArgs.headers = options.otherArgs.headers || {};
383
+ options.otherArgs.headers['x-goog-request-params'] =
384
+ this._gaxModule.routingHeader.fromParams({
385
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
386
+ });
387
+ this.initialize();
388
+ return this.innerApiCalls.collectUserEvent(request, options, callback);
389
+ }
390
+ purgeUserEvents(request, optionsOrCallback, callback) {
391
+ var _a;
392
+ request = request || {};
393
+ let options;
394
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
395
+ callback = optionsOrCallback;
396
+ options = {};
397
+ }
398
+ else {
399
+ options = optionsOrCallback;
400
+ }
401
+ options = options || {};
402
+ options.otherArgs = options.otherArgs || {};
403
+ options.otherArgs.headers = options.otherArgs.headers || {};
404
+ options.otherArgs.headers['x-goog-request-params'] =
405
+ this._gaxModule.routingHeader.fromParams({
406
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
407
+ });
408
+ this.initialize();
409
+ return this.innerApiCalls.purgeUserEvents(request, options, callback);
410
+ }
411
+ /**
412
+ * Check the status of the long running operation returned by `purgeUserEvents()`.
413
+ * @param {String} name
414
+ * The operation name that will be passed.
415
+ * @returns {Promise} - The promise which resolves to an object.
416
+ * The decoded operation object has result and metadata field to get information from.
417
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
418
+ * for more details and examples.
419
+ * @example <caption>include:samples/generated/v1alpha/user_event_service.purge_user_events.js</caption>
420
+ * region_tag:discoveryengine_v1alpha_generated_UserEventService_PurgeUserEvents_async
421
+ */
422
+ async checkPurgeUserEventsProgress(name) {
423
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
424
+ const [operation] = await this.operationsClient.getOperation(request);
425
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.purgeUserEvents, this._gaxModule.createDefaultBackoffSettings());
426
+ return decodeOperation;
427
+ }
428
+ importUserEvents(request, optionsOrCallback, callback) {
429
+ var _a;
430
+ request = request || {};
431
+ let options;
432
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
433
+ callback = optionsOrCallback;
434
+ options = {};
435
+ }
436
+ else {
437
+ options = optionsOrCallback;
438
+ }
439
+ options = options || {};
440
+ options.otherArgs = options.otherArgs || {};
441
+ options.otherArgs.headers = options.otherArgs.headers || {};
442
+ options.otherArgs.headers['x-goog-request-params'] =
443
+ this._gaxModule.routingHeader.fromParams({
444
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
445
+ });
446
+ this.initialize();
447
+ return this.innerApiCalls.importUserEvents(request, options, callback);
448
+ }
449
+ /**
450
+ * Check the status of the long running operation returned by `importUserEvents()`.
451
+ * @param {String} name
452
+ * The operation name that will be passed.
453
+ * @returns {Promise} - The promise which resolves to an object.
454
+ * The decoded operation object has result and metadata field to get information from.
455
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
456
+ * for more details and examples.
457
+ * @example <caption>include:samples/generated/v1alpha/user_event_service.import_user_events.js</caption>
458
+ * region_tag:discoveryengine_v1alpha_generated_UserEventService_ImportUserEvents_async
459
+ */
460
+ async checkImportUserEventsProgress(name) {
461
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
462
+ const [operation] = await this.operationsClient.getOperation(request);
463
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importUserEvents, this._gaxModule.createDefaultBackoffSettings());
464
+ return decodeOperation;
465
+ }
466
+ /**
467
+ * Gets information about a location.
468
+ *
469
+ * @param {Object} request
470
+ * The request object that will be sent.
471
+ * @param {string} request.name
472
+ * Resource name for the location.
473
+ * @param {object} [options]
474
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
475
+ * @returns {Promise} - The promise which resolves to an array.
476
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
477
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
478
+ * for more details and examples.
479
+ * @example
480
+ * ```
481
+ * const [response] = await client.getLocation(request);
482
+ * ```
483
+ */
484
+ getLocation(request, options, callback) {
485
+ return this.locationsClient.getLocation(request, options, callback);
486
+ }
487
+ /**
488
+ * Lists information about the supported locations for this service. Returns an iterable object.
489
+ *
490
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
491
+ * @param {Object} request
492
+ * The request object that will be sent.
493
+ * @param {string} request.name
494
+ * The resource that owns the locations collection, if applicable.
495
+ * @param {string} request.filter
496
+ * The standard list filter.
497
+ * @param {number} request.pageSize
498
+ * The standard list page size.
499
+ * @param {string} request.pageToken
500
+ * The standard list page token.
501
+ * @param {object} [options]
502
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
503
+ * @returns {Object}
504
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
505
+ * When you iterate the returned iterable, each element will be an object representing
506
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
507
+ * so you can stop the iteration when you don't need more results.
508
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
509
+ * for more details and examples.
510
+ * @example
511
+ * ```
512
+ * const iterable = client.listLocationsAsync(request);
513
+ * for await (const response of iterable) {
514
+ * // process response
515
+ * }
516
+ * ```
517
+ */
518
+ listLocationsAsync(request, options) {
519
+ return this.locationsClient.listLocationsAsync(request, options);
520
+ }
521
+ /**
522
+ * Gets the latest state of a long-running operation. Clients can use this
523
+ * method to poll the operation result at intervals as recommended by the API
524
+ * service.
525
+ *
526
+ * @param {Object} request - The request object that will be sent.
527
+ * @param {string} request.name - The name of the operation resource.
528
+ * @param {Object=} options
529
+ * Optional parameters. You can override the default settings for this call,
530
+ * e.g, timeout, retries, paginations, etc. See {@link
531
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
532
+ * for the details.
533
+ * @param {function(?Error, ?Object)=} callback
534
+ * The function which will be called with the result of the API call.
535
+ *
536
+ * The second parameter to the callback is an object representing
537
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
538
+ * @return {Promise} - The promise which resolves to an array.
539
+ * The first element of the array is an object representing
540
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
541
+ * The promise has a method named "cancel" which cancels the ongoing API call.
542
+ *
543
+ * @example
544
+ * ```
545
+ * const client = longrunning.operationsClient();
546
+ * const name = '';
547
+ * const [response] = await client.getOperation({name});
548
+ * // doThingsWith(response)
549
+ * ```
550
+ */
551
+ getOperation(request, options, callback) {
552
+ return this.operationsClient.getOperation(request, options, callback);
553
+ }
554
+ /**
555
+ * Lists operations that match the specified filter in the request. If the
556
+ * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
557
+ *
558
+ * For-await-of syntax is used with the iterable to recursively get response element on-demand.
559
+ *
560
+ * @param {Object} request - The request object that will be sent.
561
+ * @param {string} request.name - The name of the operation collection.
562
+ * @param {string} request.filter - The standard list filter.
563
+ * @param {number=} request.pageSize -
564
+ * The maximum number of resources contained in the underlying API
565
+ * response. If page streaming is performed per-resource, this
566
+ * parameter does not affect the return value. If page streaming is
567
+ * performed per-page, this determines the maximum number of
568
+ * resources in a page.
569
+ * @param {Object=} options
570
+ * Optional parameters. You can override the default settings for this call,
571
+ * e.g, timeout, retries, paginations, etc. See {@link
572
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
573
+ * details.
574
+ * @returns {Object}
575
+ * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}.
576
+ *
577
+ * @example
578
+ * ```
579
+ * const client = longrunning.operationsClient();
580
+ * for await (const response of client.listOperationsAsync(request));
581
+ * // doThingsWith(response)
582
+ * ```
583
+ */
584
+ listOperationsAsync(request, options) {
585
+ return this.operationsClient.listOperationsAsync(request, options);
586
+ }
587
+ /**
588
+ * Starts asynchronous cancellation on a long-running operation. The server
589
+ * makes a best effort to cancel the operation, but success is not
590
+ * guaranteed. If the server doesn't support this method, it returns
591
+ * `google.rpc.Code.UNIMPLEMENTED`. Clients can use
592
+ * {@link Operations.GetOperation} or
593
+ * other methods to check whether the cancellation succeeded or whether the
594
+ * operation completed despite cancellation. On successful cancellation,
595
+ * the operation is not deleted; instead, it becomes an operation with
596
+ * an {@link Operation.error} value with a {@link google.rpc.Status.code} of
597
+ * 1, corresponding to `Code.CANCELLED`.
598
+ *
599
+ * @param {Object} request - The request object that will be sent.
600
+ * @param {string} request.name - The name of the operation resource to be cancelled.
601
+ * @param {Object=} options
602
+ * Optional parameters. You can override the default settings for this call,
603
+ * e.g, timeout, retries, paginations, etc. See {@link
604
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
605
+ * details.
606
+ * @param {function(?Error)=} callback
607
+ * The function which will be called with the result of the API call.
608
+ * @return {Promise} - The promise which resolves when API call finishes.
609
+ * The promise has a method named "cancel" which cancels the ongoing API
610
+ * call.
611
+ *
612
+ * @example
613
+ * ```
614
+ * const client = longrunning.operationsClient();
615
+ * await client.cancelOperation({name: ''});
616
+ * ```
617
+ */
618
+ cancelOperation(request, options, callback) {
619
+ return this.operationsClient.cancelOperation(request, options, callback);
620
+ }
621
+ /**
622
+ * Deletes a long-running operation. This method indicates that the client is
623
+ * no longer interested in the operation result. It does not cancel the
624
+ * operation. If the server doesn't support this method, it returns
625
+ * `google.rpc.Code.UNIMPLEMENTED`.
626
+ *
627
+ * @param {Object} request - The request object that will be sent.
628
+ * @param {string} request.name - The name of the operation resource to be deleted.
629
+ * @param {Object=} options
630
+ * Optional parameters. You can override the default settings for this call,
631
+ * e.g, timeout, retries, paginations, etc. See {@link
632
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
633
+ * for the details.
634
+ * @param {function(?Error)=} callback
635
+ * The function which will be called with the result of the API call.
636
+ * @return {Promise} - The promise which resolves when API call finishes.
637
+ * The promise has a method named "cancel" which cancels the ongoing API
638
+ * call.
639
+ *
640
+ * @example
641
+ * ```
642
+ * const client = longrunning.operationsClient();
643
+ * await client.deleteOperation({name: ''});
644
+ * ```
645
+ */
646
+ deleteOperation(request, options, callback) {
647
+ return this.operationsClient.deleteOperation(request, options, callback);
648
+ }
649
+ // --------------------
650
+ // -- Path templates --
651
+ // --------------------
652
+ /**
653
+ * Return a fully-qualified engine resource name string.
654
+ *
655
+ * @param {string} project
656
+ * @param {string} location
657
+ * @param {string} collection
658
+ * @param {string} engine
659
+ * @returns {string} Resource name string.
660
+ */
661
+ enginePath(project, location, collection, engine) {
662
+ return this.pathTemplates.enginePathTemplate.render({
663
+ project: project,
664
+ location: location,
665
+ collection: collection,
666
+ engine: engine,
667
+ });
668
+ }
669
+ /**
670
+ * Parse the project from Engine resource.
671
+ *
672
+ * @param {string} engineName
673
+ * A fully-qualified path representing Engine resource.
674
+ * @returns {string} A string representing the project.
675
+ */
676
+ matchProjectFromEngineName(engineName) {
677
+ return this.pathTemplates.enginePathTemplate.match(engineName).project;
678
+ }
679
+ /**
680
+ * Parse the location from Engine resource.
681
+ *
682
+ * @param {string} engineName
683
+ * A fully-qualified path representing Engine resource.
684
+ * @returns {string} A string representing the location.
685
+ */
686
+ matchLocationFromEngineName(engineName) {
687
+ return this.pathTemplates.enginePathTemplate.match(engineName).location;
688
+ }
689
+ /**
690
+ * Parse the collection from Engine resource.
691
+ *
692
+ * @param {string} engineName
693
+ * A fully-qualified path representing Engine resource.
694
+ * @returns {string} A string representing the collection.
695
+ */
696
+ matchCollectionFromEngineName(engineName) {
697
+ return this.pathTemplates.enginePathTemplate.match(engineName).collection;
698
+ }
699
+ /**
700
+ * Parse the engine from Engine resource.
701
+ *
702
+ * @param {string} engineName
703
+ * A fully-qualified path representing Engine resource.
704
+ * @returns {string} A string representing the engine.
705
+ */
706
+ matchEngineFromEngineName(engineName) {
707
+ return this.pathTemplates.enginePathTemplate.match(engineName).engine;
708
+ }
709
+ /**
710
+ * Return a fully-qualified projectLocationCollectionDataStore resource name string.
711
+ *
712
+ * @param {string} project
713
+ * @param {string} location
714
+ * @param {string} collection
715
+ * @param {string} data_store
716
+ * @returns {string} Resource name string.
717
+ */
718
+ projectLocationCollectionDataStorePath(project, location, collection, dataStore) {
719
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.render({
720
+ project: project,
721
+ location: location,
722
+ collection: collection,
723
+ data_store: dataStore,
724
+ });
725
+ }
726
+ /**
727
+ * Parse the project from ProjectLocationCollectionDataStore resource.
728
+ *
729
+ * @param {string} projectLocationCollectionDataStoreName
730
+ * A fully-qualified path representing project_location_collection_data_store resource.
731
+ * @returns {string} A string representing the project.
732
+ */
733
+ matchProjectFromProjectLocationCollectionDataStoreName(projectLocationCollectionDataStoreName) {
734
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match(projectLocationCollectionDataStoreName).project;
735
+ }
736
+ /**
737
+ * Parse the location from ProjectLocationCollectionDataStore resource.
738
+ *
739
+ * @param {string} projectLocationCollectionDataStoreName
740
+ * A fully-qualified path representing project_location_collection_data_store resource.
741
+ * @returns {string} A string representing the location.
742
+ */
743
+ matchLocationFromProjectLocationCollectionDataStoreName(projectLocationCollectionDataStoreName) {
744
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match(projectLocationCollectionDataStoreName).location;
745
+ }
746
+ /**
747
+ * Parse the collection from ProjectLocationCollectionDataStore resource.
748
+ *
749
+ * @param {string} projectLocationCollectionDataStoreName
750
+ * A fully-qualified path representing project_location_collection_data_store resource.
751
+ * @returns {string} A string representing the collection.
752
+ */
753
+ matchCollectionFromProjectLocationCollectionDataStoreName(projectLocationCollectionDataStoreName) {
754
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match(projectLocationCollectionDataStoreName).collection;
755
+ }
756
+ /**
757
+ * Parse the data_store from ProjectLocationCollectionDataStore resource.
758
+ *
759
+ * @param {string} projectLocationCollectionDataStoreName
760
+ * A fully-qualified path representing project_location_collection_data_store resource.
761
+ * @returns {string} A string representing the data_store.
762
+ */
763
+ matchDataStoreFromProjectLocationCollectionDataStoreName(projectLocationCollectionDataStoreName) {
764
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match(projectLocationCollectionDataStoreName).data_store;
765
+ }
766
+ /**
767
+ * Return a fully-qualified projectLocationCollectionDataStoreBranchDocument resource name string.
768
+ *
769
+ * @param {string} project
770
+ * @param {string} location
771
+ * @param {string} collection
772
+ * @param {string} data_store
773
+ * @param {string} branch
774
+ * @param {string} document
775
+ * @returns {string} Resource name string.
776
+ */
777
+ projectLocationCollectionDataStoreBranchDocumentPath(project, location, collection, dataStore, branch, document) {
778
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.render({
779
+ project: project,
780
+ location: location,
781
+ collection: collection,
782
+ data_store: dataStore,
783
+ branch: branch,
784
+ document: document,
785
+ });
786
+ }
787
+ /**
788
+ * Parse the project from ProjectLocationCollectionDataStoreBranchDocument resource.
789
+ *
790
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
791
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
792
+ * @returns {string} A string representing the project.
793
+ */
794
+ matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
795
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).project;
796
+ }
797
+ /**
798
+ * Parse the location from ProjectLocationCollectionDataStoreBranchDocument resource.
799
+ *
800
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
801
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
802
+ * @returns {string} A string representing the location.
803
+ */
804
+ matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
805
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).location;
806
+ }
807
+ /**
808
+ * Parse the collection from ProjectLocationCollectionDataStoreBranchDocument resource.
809
+ *
810
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
811
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
812
+ * @returns {string} A string representing the collection.
813
+ */
814
+ matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
815
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).collection;
816
+ }
817
+ /**
818
+ * Parse the data_store from ProjectLocationCollectionDataStoreBranchDocument resource.
819
+ *
820
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
821
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
822
+ * @returns {string} A string representing the data_store.
823
+ */
824
+ matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
825
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).data_store;
826
+ }
827
+ /**
828
+ * Parse the branch from ProjectLocationCollectionDataStoreBranchDocument resource.
829
+ *
830
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
831
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
832
+ * @returns {string} A string representing the branch.
833
+ */
834
+ matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
835
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).branch;
836
+ }
837
+ /**
838
+ * Parse the document from ProjectLocationCollectionDataStoreBranchDocument resource.
839
+ *
840
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
841
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
842
+ * @returns {string} A string representing the document.
843
+ */
844
+ matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
845
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).document;
846
+ }
847
+ /**
848
+ * Return a fully-qualified projectLocationCollectionDataStoreConversation resource name string.
849
+ *
850
+ * @param {string} project
851
+ * @param {string} location
852
+ * @param {string} collection
853
+ * @param {string} data_store
854
+ * @param {string} conversation
855
+ * @returns {string} Resource name string.
856
+ */
857
+ projectLocationCollectionDataStoreConversationPath(project, location, collection, dataStore, conversation) {
858
+ return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.render({
859
+ project: project,
860
+ location: location,
861
+ collection: collection,
862
+ data_store: dataStore,
863
+ conversation: conversation,
864
+ });
865
+ }
866
+ /**
867
+ * Parse the project from ProjectLocationCollectionDataStoreConversation resource.
868
+ *
869
+ * @param {string} projectLocationCollectionDataStoreConversationName
870
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
871
+ * @returns {string} A string representing the project.
872
+ */
873
+ matchProjectFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
874
+ return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).project;
875
+ }
876
+ /**
877
+ * Parse the location from ProjectLocationCollectionDataStoreConversation resource.
878
+ *
879
+ * @param {string} projectLocationCollectionDataStoreConversationName
880
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
881
+ * @returns {string} A string representing the location.
882
+ */
883
+ matchLocationFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
884
+ return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).location;
885
+ }
886
+ /**
887
+ * Parse the collection from ProjectLocationCollectionDataStoreConversation resource.
888
+ *
889
+ * @param {string} projectLocationCollectionDataStoreConversationName
890
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
891
+ * @returns {string} A string representing the collection.
892
+ */
893
+ matchCollectionFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
894
+ return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).collection;
895
+ }
896
+ /**
897
+ * Parse the data_store from ProjectLocationCollectionDataStoreConversation resource.
898
+ *
899
+ * @param {string} projectLocationCollectionDataStoreConversationName
900
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
901
+ * @returns {string} A string representing the data_store.
902
+ */
903
+ matchDataStoreFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
904
+ return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).data_store;
905
+ }
906
+ /**
907
+ * Parse the conversation from ProjectLocationCollectionDataStoreConversation resource.
908
+ *
909
+ * @param {string} projectLocationCollectionDataStoreConversationName
910
+ * A fully-qualified path representing project_location_collection_data_store_conversation resource.
911
+ * @returns {string} A string representing the conversation.
912
+ */
913
+ matchConversationFromProjectLocationCollectionDataStoreConversationName(projectLocationCollectionDataStoreConversationName) {
914
+ return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match(projectLocationCollectionDataStoreConversationName).conversation;
915
+ }
916
+ /**
917
+ * Return a fully-qualified projectLocationCollectionDataStoreSchema resource name string.
918
+ *
919
+ * @param {string} project
920
+ * @param {string} location
921
+ * @param {string} collection
922
+ * @param {string} data_store
923
+ * @param {string} schema
924
+ * @returns {string} Resource name string.
925
+ */
926
+ projectLocationCollectionDataStoreSchemaPath(project, location, collection, dataStore, schema) {
927
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.render({
928
+ project: project,
929
+ location: location,
930
+ collection: collection,
931
+ data_store: dataStore,
932
+ schema: schema,
933
+ });
934
+ }
935
+ /**
936
+ * Parse the project from ProjectLocationCollectionDataStoreSchema resource.
937
+ *
938
+ * @param {string} projectLocationCollectionDataStoreSchemaName
939
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
940
+ * @returns {string} A string representing the project.
941
+ */
942
+ matchProjectFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
943
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).project;
944
+ }
945
+ /**
946
+ * Parse the location from ProjectLocationCollectionDataStoreSchema resource.
947
+ *
948
+ * @param {string} projectLocationCollectionDataStoreSchemaName
949
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
950
+ * @returns {string} A string representing the location.
951
+ */
952
+ matchLocationFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
953
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).location;
954
+ }
955
+ /**
956
+ * Parse the collection from ProjectLocationCollectionDataStoreSchema resource.
957
+ *
958
+ * @param {string} projectLocationCollectionDataStoreSchemaName
959
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
960
+ * @returns {string} A string representing the collection.
961
+ */
962
+ matchCollectionFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
963
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).collection;
964
+ }
965
+ /**
966
+ * Parse the data_store from ProjectLocationCollectionDataStoreSchema resource.
967
+ *
968
+ * @param {string} projectLocationCollectionDataStoreSchemaName
969
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
970
+ * @returns {string} A string representing the data_store.
971
+ */
972
+ matchDataStoreFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
973
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).data_store;
974
+ }
975
+ /**
976
+ * Parse the schema from ProjectLocationCollectionDataStoreSchema resource.
977
+ *
978
+ * @param {string} projectLocationCollectionDataStoreSchemaName
979
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
980
+ * @returns {string} A string representing the schema.
981
+ */
982
+ matchSchemaFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
983
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).schema;
984
+ }
985
+ /**
986
+ * Return a fully-qualified projectLocationDataStore resource name string.
987
+ *
988
+ * @param {string} project
989
+ * @param {string} location
990
+ * @param {string} data_store
991
+ * @returns {string} Resource name string.
992
+ */
993
+ projectLocationDataStorePath(project, location, dataStore) {
994
+ return this.pathTemplates.projectLocationDataStorePathTemplate.render({
995
+ project: project,
996
+ location: location,
997
+ data_store: dataStore,
998
+ });
999
+ }
1000
+ /**
1001
+ * Parse the project from ProjectLocationDataStore resource.
1002
+ *
1003
+ * @param {string} projectLocationDataStoreName
1004
+ * A fully-qualified path representing project_location_data_store resource.
1005
+ * @returns {string} A string representing the project.
1006
+ */
1007
+ matchProjectFromProjectLocationDataStoreName(projectLocationDataStoreName) {
1008
+ return this.pathTemplates.projectLocationDataStorePathTemplate.match(projectLocationDataStoreName).project;
1009
+ }
1010
+ /**
1011
+ * Parse the location from ProjectLocationDataStore resource.
1012
+ *
1013
+ * @param {string} projectLocationDataStoreName
1014
+ * A fully-qualified path representing project_location_data_store resource.
1015
+ * @returns {string} A string representing the location.
1016
+ */
1017
+ matchLocationFromProjectLocationDataStoreName(projectLocationDataStoreName) {
1018
+ return this.pathTemplates.projectLocationDataStorePathTemplate.match(projectLocationDataStoreName).location;
1019
+ }
1020
+ /**
1021
+ * Parse the data_store from ProjectLocationDataStore resource.
1022
+ *
1023
+ * @param {string} projectLocationDataStoreName
1024
+ * A fully-qualified path representing project_location_data_store resource.
1025
+ * @returns {string} A string representing the data_store.
1026
+ */
1027
+ matchDataStoreFromProjectLocationDataStoreName(projectLocationDataStoreName) {
1028
+ return this.pathTemplates.projectLocationDataStorePathTemplate.match(projectLocationDataStoreName).data_store;
1029
+ }
1030
+ /**
1031
+ * Return a fully-qualified projectLocationDataStoreBranchDocument resource name string.
1032
+ *
1033
+ * @param {string} project
1034
+ * @param {string} location
1035
+ * @param {string} data_store
1036
+ * @param {string} branch
1037
+ * @param {string} document
1038
+ * @returns {string} Resource name string.
1039
+ */
1040
+ projectLocationDataStoreBranchDocumentPath(project, location, dataStore, branch, document) {
1041
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.render({
1042
+ project: project,
1043
+ location: location,
1044
+ data_store: dataStore,
1045
+ branch: branch,
1046
+ document: document,
1047
+ });
1048
+ }
1049
+ /**
1050
+ * Parse the project from ProjectLocationDataStoreBranchDocument resource.
1051
+ *
1052
+ * @param {string} projectLocationDataStoreBranchDocumentName
1053
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
1054
+ * @returns {string} A string representing the project.
1055
+ */
1056
+ matchProjectFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
1057
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).project;
1058
+ }
1059
+ /**
1060
+ * Parse the location from ProjectLocationDataStoreBranchDocument resource.
1061
+ *
1062
+ * @param {string} projectLocationDataStoreBranchDocumentName
1063
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
1064
+ * @returns {string} A string representing the location.
1065
+ */
1066
+ matchLocationFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
1067
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).location;
1068
+ }
1069
+ /**
1070
+ * Parse the data_store from ProjectLocationDataStoreBranchDocument resource.
1071
+ *
1072
+ * @param {string} projectLocationDataStoreBranchDocumentName
1073
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
1074
+ * @returns {string} A string representing the data_store.
1075
+ */
1076
+ matchDataStoreFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
1077
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).data_store;
1078
+ }
1079
+ /**
1080
+ * Parse the branch from ProjectLocationDataStoreBranchDocument resource.
1081
+ *
1082
+ * @param {string} projectLocationDataStoreBranchDocumentName
1083
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
1084
+ * @returns {string} A string representing the branch.
1085
+ */
1086
+ matchBranchFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
1087
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).branch;
1088
+ }
1089
+ /**
1090
+ * Parse the document from ProjectLocationDataStoreBranchDocument resource.
1091
+ *
1092
+ * @param {string} projectLocationDataStoreBranchDocumentName
1093
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
1094
+ * @returns {string} A string representing the document.
1095
+ */
1096
+ matchDocumentFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
1097
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).document;
1098
+ }
1099
+ /**
1100
+ * Return a fully-qualified projectLocationDataStoreConversation resource name string.
1101
+ *
1102
+ * @param {string} project
1103
+ * @param {string} location
1104
+ * @param {string} data_store
1105
+ * @param {string} conversation
1106
+ * @returns {string} Resource name string.
1107
+ */
1108
+ projectLocationDataStoreConversationPath(project, location, dataStore, conversation) {
1109
+ return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.render({
1110
+ project: project,
1111
+ location: location,
1112
+ data_store: dataStore,
1113
+ conversation: conversation,
1114
+ });
1115
+ }
1116
+ /**
1117
+ * Parse the project from ProjectLocationDataStoreConversation resource.
1118
+ *
1119
+ * @param {string} projectLocationDataStoreConversationName
1120
+ * A fully-qualified path representing project_location_data_store_conversation resource.
1121
+ * @returns {string} A string representing the project.
1122
+ */
1123
+ matchProjectFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName) {
1124
+ return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match(projectLocationDataStoreConversationName).project;
1125
+ }
1126
+ /**
1127
+ * Parse the location from ProjectLocationDataStoreConversation resource.
1128
+ *
1129
+ * @param {string} projectLocationDataStoreConversationName
1130
+ * A fully-qualified path representing project_location_data_store_conversation resource.
1131
+ * @returns {string} A string representing the location.
1132
+ */
1133
+ matchLocationFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName) {
1134
+ return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match(projectLocationDataStoreConversationName).location;
1135
+ }
1136
+ /**
1137
+ * Parse the data_store from ProjectLocationDataStoreConversation resource.
1138
+ *
1139
+ * @param {string} projectLocationDataStoreConversationName
1140
+ * A fully-qualified path representing project_location_data_store_conversation resource.
1141
+ * @returns {string} A string representing the data_store.
1142
+ */
1143
+ matchDataStoreFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName) {
1144
+ return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match(projectLocationDataStoreConversationName).data_store;
1145
+ }
1146
+ /**
1147
+ * Parse the conversation from ProjectLocationDataStoreConversation resource.
1148
+ *
1149
+ * @param {string} projectLocationDataStoreConversationName
1150
+ * A fully-qualified path representing project_location_data_store_conversation resource.
1151
+ * @returns {string} A string representing the conversation.
1152
+ */
1153
+ matchConversationFromProjectLocationDataStoreConversationName(projectLocationDataStoreConversationName) {
1154
+ return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match(projectLocationDataStoreConversationName).conversation;
1155
+ }
1156
+ /**
1157
+ * Return a fully-qualified projectLocationDataStoreSchema resource name string.
1158
+ *
1159
+ * @param {string} project
1160
+ * @param {string} location
1161
+ * @param {string} data_store
1162
+ * @param {string} schema
1163
+ * @returns {string} Resource name string.
1164
+ */
1165
+ projectLocationDataStoreSchemaPath(project, location, dataStore, schema) {
1166
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.render({
1167
+ project: project,
1168
+ location: location,
1169
+ data_store: dataStore,
1170
+ schema: schema,
1171
+ });
1172
+ }
1173
+ /**
1174
+ * Parse the project from ProjectLocationDataStoreSchema resource.
1175
+ *
1176
+ * @param {string} projectLocationDataStoreSchemaName
1177
+ * A fully-qualified path representing project_location_data_store_schema resource.
1178
+ * @returns {string} A string representing the project.
1179
+ */
1180
+ matchProjectFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
1181
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).project;
1182
+ }
1183
+ /**
1184
+ * Parse the location from ProjectLocationDataStoreSchema resource.
1185
+ *
1186
+ * @param {string} projectLocationDataStoreSchemaName
1187
+ * A fully-qualified path representing project_location_data_store_schema resource.
1188
+ * @returns {string} A string representing the location.
1189
+ */
1190
+ matchLocationFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
1191
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).location;
1192
+ }
1193
+ /**
1194
+ * Parse the data_store from ProjectLocationDataStoreSchema resource.
1195
+ *
1196
+ * @param {string} projectLocationDataStoreSchemaName
1197
+ * A fully-qualified path representing project_location_data_store_schema resource.
1198
+ * @returns {string} A string representing the data_store.
1199
+ */
1200
+ matchDataStoreFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
1201
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).data_store;
1202
+ }
1203
+ /**
1204
+ * Parse the schema from ProjectLocationDataStoreSchema resource.
1205
+ *
1206
+ * @param {string} projectLocationDataStoreSchemaName
1207
+ * A fully-qualified path representing project_location_data_store_schema resource.
1208
+ * @returns {string} A string representing the schema.
1209
+ */
1210
+ matchSchemaFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
1211
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).schema;
1212
+ }
1213
+ /**
1214
+ * Terminate the gRPC channel and close the client.
1215
+ *
1216
+ * The client will no longer be usable and all future behavior is undefined.
1217
+ * @returns {Promise} A promise that resolves when the client is closed.
1218
+ */
1219
+ close() {
1220
+ if (this.userEventServiceStub && !this._terminated) {
1221
+ return this.userEventServiceStub.then(stub => {
1222
+ this._terminated = true;
1223
+ stub.close();
1224
+ this.locationsClient.close();
1225
+ this.operationsClient.close();
1226
+ });
1227
+ }
1228
+ return Promise.resolve();
1229
+ }
1230
+ }
1231
+ exports.UserEventServiceClient = UserEventServiceClient;
1232
+ //# sourceMappingURL=user_event_service_client.js.map