@google-cloud/discoveryengine 0.6.0 → 0.7.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 (44) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +38 -22
  3. package/build/protos/google/cloud/discoveryengine/v1/common.proto +100 -0
  4. package/build/protos/google/cloud/discoveryengine/v1/completion_service.proto +116 -0
  5. package/build/protos/google/cloud/discoveryengine/v1/document.proto +118 -0
  6. package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +313 -0
  7. package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +334 -0
  8. package/build/protos/google/cloud/discoveryengine/v1/purge_config.proto +86 -0
  9. package/build/protos/google/cloud/discoveryengine/v1/schema.proto +58 -0
  10. package/build/protos/google/cloud/discoveryengine/v1/schema_service.proto +256 -0
  11. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +289 -0
  12. package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +458 -0
  13. package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +133 -0
  14. package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +54 -0
  15. package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +29 -4
  16. package/build/protos/protos.d.ts +6589 -0
  17. package/build/protos/protos.js +16050 -1
  18. package/build/protos/protos.json +1807 -0
  19. package/build/src/index.d.ts +18 -19
  20. package/build/src/index.js +9 -9
  21. package/build/src/v1/completion_service_client.d.ts +455 -0
  22. package/build/src/v1/completion_service_client.js +659 -0
  23. package/build/src/v1/completion_service_client_config.json +43 -0
  24. package/build/src/v1/document_service_client.d.ts +995 -0
  25. package/build/src/v1/document_service_client.js +1191 -0
  26. package/build/src/v1/document_service_client_config.json +82 -0
  27. package/build/src/v1/index.d.ts +5 -0
  28. package/build/src/v1/index.js +31 -0
  29. package/build/src/v1/schema_service_client.d.ts +795 -0
  30. package/build/src/v1/schema_service_client.js +1129 -0
  31. package/build/src/v1/schema_service_client_config.json +63 -0
  32. package/build/src/v1/search_service_client.d.ts +857 -0
  33. package/build/src/v1/search_service_client.js +1073 -0
  34. package/build/src/v1/search_service_client_config.json +43 -0
  35. package/build/src/v1/user_event_service_client.d.ts +638 -0
  36. package/build/src/v1/user_event_service_client.js +933 -0
  37. package/build/src/v1/user_event_service_client_config.json +62 -0
  38. package/build/src/v1beta/document_service_client.d.ts +52 -0
  39. package/build/src/v1beta/document_service_client.js +6 -0
  40. package/build/src/v1beta/schema_service_client.js +6 -0
  41. package/build/src/v1beta/search_service_client.d.ts +78 -12
  42. package/build/src/v1beta/search_service_client.js +52 -8
  43. package/build/src/v1beta/user_event_service_client.js +6 -0
  44. package/package.json +2 -2
@@ -0,0 +1,1191 @@
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.DocumentServiceClient = void 0;
21
+ const jsonProtos = require("../../protos/protos.json");
22
+ /**
23
+ * Client JSON configuration object, loaded from
24
+ * `src/v1/document_service_client_config.json`.
25
+ * This file defines retry strategy and timeouts for all API methods in this library.
26
+ */
27
+ const gapicConfig = require("./document_service_client_config.json");
28
+ const version = require('../../../package.json').version;
29
+ /**
30
+ * Service for ingesting {@link google.cloud.discoveryengine.v1.Document|Document}
31
+ * information of the customer's website.
32
+ * @class
33
+ * @memberof v1
34
+ */
35
+ class DocumentServiceClient {
36
+ /**
37
+ * Construct an instance of DocumentServiceClient.
38
+ *
39
+ * @param {object} [options] - The configuration object.
40
+ * The options accepted by the constructor are described in detail
41
+ * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
42
+ * The common options are:
43
+ * @param {object} [options.credentials] - Credentials object.
44
+ * @param {string} [options.credentials.client_email]
45
+ * @param {string} [options.credentials.private_key]
46
+ * @param {string} [options.email] - Account email address. Required when
47
+ * using a .pem or .p12 keyFilename.
48
+ * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
49
+ * .p12 key downloaded from the Google Developers Console. If you provide
50
+ * a path to a JSON file, the projectId option below is not necessary.
51
+ * NOTE: .pem and .p12 require you to specify options.email as well.
52
+ * @param {number} [options.port] - The port on which to connect to
53
+ * the remote host.
54
+ * @param {string} [options.projectId] - The project ID from the Google
55
+ * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
56
+ * the environment variable GCLOUD_PROJECT for your project ID. If your
57
+ * app is running in an environment which supports
58
+ * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
59
+ * your project ID will be detected automatically.
60
+ * @param {string} [options.apiEndpoint] - The domain name of the
61
+ * API remote host.
62
+ * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
63
+ * Follows the structure of {@link gapicConfig}.
64
+ * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
65
+ * Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
66
+ * For more information, please check the
67
+ * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
68
+ * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
69
+ * need to avoid loading the default gRPC version and want to use the fallback
70
+ * HTTP implementation. Load only fallback version and pass it to the constructor:
71
+ * ```
72
+ * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
73
+ * const client = new DocumentServiceClient({fallback: 'rest'}, gax);
74
+ * ```
75
+ */
76
+ constructor(opts, gaxInstance) {
77
+ var _a, _b;
78
+ this._terminated = false;
79
+ this.descriptors = {
80
+ page: {},
81
+ stream: {},
82
+ longrunning: {},
83
+ batching: {},
84
+ };
85
+ // Ensure that options include all the required fields.
86
+ const staticMembers = this.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
+ projectLocationCollectionDataStoreBranchPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}'),
143
+ projectLocationCollectionDataStoreBranchDocumentPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}'),
144
+ projectLocationCollectionDataStoreSchemaPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}'),
145
+ projectLocationDataStoreBranchPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}'),
146
+ projectLocationDataStoreBranchDocumentPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}'),
147
+ projectLocationDataStoreSchemaPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}'),
148
+ };
149
+ // Some of the methods on this service return "paged" results,
150
+ // (e.g. 50 results at a time, with tokens to get subsequent
151
+ // pages). Denote the keys used for pagination and results.
152
+ this.descriptors.page = {
153
+ listDocuments: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'documents'),
154
+ };
155
+ const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
156
+ // This API contains "long-running operations", which return a
157
+ // an Operation object that allows for tracking of the operation,
158
+ // rather than holding a request open.
159
+ const lroOptions = {
160
+ auth: this.auth,
161
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
162
+ };
163
+ if (opts.fallback === 'rest') {
164
+ lroOptions.protoJson = protoFilesRoot;
165
+ lroOptions.httpRules = [
166
+ {
167
+ selector: 'google.longrunning.Operations.GetOperation',
168
+ get: '/v1/{name=projects/*/operations/*}',
169
+ additional_bindings: [
170
+ {
171
+ get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
172
+ },
173
+ {
174
+ get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
175
+ },
176
+ {
177
+ get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
178
+ },
179
+ {
180
+ get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
181
+ },
182
+ {
183
+ get: '/v1/{name=projects/*/locations/*/collections/*/operations/*}',
184
+ },
185
+ {
186
+ get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
187
+ },
188
+ {
189
+ get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
190
+ },
191
+ {
192
+ get: '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}',
193
+ },
194
+ { get: '/v1/{name=projects/*/locations/*/operations/*}' },
195
+ { get: '/v1/{name=projects/*/operations/*}' },
196
+ ],
197
+ },
198
+ {
199
+ selector: 'google.longrunning.Operations.ListOperations',
200
+ get: '/v1/{name=projects/*}/operations',
201
+ additional_bindings: [
202
+ {
203
+ get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
204
+ },
205
+ {
206
+ get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
207
+ },
208
+ {
209
+ get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
210
+ },
211
+ {
212
+ get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
213
+ },
214
+ { get: '/v1/{name=projects/*/locations/*/collections/*}/operations' },
215
+ {
216
+ get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
217
+ },
218
+ {
219
+ get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
220
+ },
221
+ { get: '/v1/{name=projects/*/locations/*/dataStores/*}/operations' },
222
+ { get: '/v1/{name=projects/*/locations/*}/operations' },
223
+ { get: '/v1/{name=projects/*}/operations' },
224
+ ],
225
+ },
226
+ ];
227
+ }
228
+ this.operationsClient = this._gaxModule
229
+ .lro(lroOptions)
230
+ .operationsClient(opts);
231
+ const importDocumentsResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.ImportDocumentsResponse');
232
+ const importDocumentsMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.ImportDocumentsMetadata');
233
+ const purgeDocumentsResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.PurgeDocumentsResponse');
234
+ const purgeDocumentsMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.PurgeDocumentsMetadata');
235
+ this.descriptors.longrunning = {
236
+ importDocuments: new this._gaxModule.LongrunningDescriptor(this.operationsClient, importDocumentsResponse.decode.bind(importDocumentsResponse), importDocumentsMetadata.decode.bind(importDocumentsMetadata)),
237
+ purgeDocuments: new this._gaxModule.LongrunningDescriptor(this.operationsClient, purgeDocumentsResponse.decode.bind(purgeDocumentsResponse), purgeDocumentsMetadata.decode.bind(purgeDocumentsMetadata)),
238
+ };
239
+ // Put together the default options sent with requests.
240
+ this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1.DocumentService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
241
+ // Set up a dictionary of "inner API calls"; the core implementation
242
+ // of calling the API is handled in `google-gax`, with this code
243
+ // merely providing the destination and request information.
244
+ this.innerApiCalls = {};
245
+ // Add a warn function to the client constructor so it can be easily tested.
246
+ this.warn = this._gaxModule.warn;
247
+ }
248
+ /**
249
+ * Initialize the client.
250
+ * Performs asynchronous operations (such as authentication) and prepares the client.
251
+ * This function will be called automatically when any class method is called for the
252
+ * first time, but if you need to initialize it before calling an actual method,
253
+ * feel free to call initialize() directly.
254
+ *
255
+ * You can await on this method if you want to make sure the client is initialized.
256
+ *
257
+ * @returns {Promise} A promise that resolves to an authenticated service stub.
258
+ */
259
+ initialize() {
260
+ // If the client stub promise is already initialized, return immediately.
261
+ if (this.documentServiceStub) {
262
+ return this.documentServiceStub;
263
+ }
264
+ // Put together the "service stub" for
265
+ // google.cloud.discoveryengine.v1.DocumentService.
266
+ this.documentServiceStub = this._gaxGrpc.createStub(this._opts.fallback
267
+ ? this._protos.lookupService('google.cloud.discoveryengine.v1.DocumentService')
268
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any
269
+ this._protos.google.cloud.discoveryengine.v1.DocumentService, this._opts, this._providedCustomServicePath);
270
+ // Iterate over each of the methods that the service provides
271
+ // and create an API call method for each.
272
+ const documentServiceStubMethods = [
273
+ 'getDocument',
274
+ 'listDocuments',
275
+ 'createDocument',
276
+ 'updateDocument',
277
+ 'deleteDocument',
278
+ 'importDocuments',
279
+ 'purgeDocuments',
280
+ ];
281
+ for (const methodName of documentServiceStubMethods) {
282
+ const callPromise = this.documentServiceStub.then(stub => (...args) => {
283
+ if (this._terminated) {
284
+ return Promise.reject('The client has already been closed.');
285
+ }
286
+ const func = stub[methodName];
287
+ return func.apply(stub, args);
288
+ }, (err) => () => {
289
+ throw err;
290
+ });
291
+ const descriptor = this.descriptors.page[methodName] ||
292
+ this.descriptors.longrunning[methodName] ||
293
+ undefined;
294
+ const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
295
+ this.innerApiCalls[methodName] = apiCall;
296
+ }
297
+ return this.documentServiceStub;
298
+ }
299
+ /**
300
+ * The DNS address for this API service.
301
+ * @returns {string} The DNS address for this service.
302
+ */
303
+ static get servicePath() {
304
+ return 'discoveryengine.googleapis.com';
305
+ }
306
+ /**
307
+ * The DNS address for this API service - same as servicePath(),
308
+ * exists for compatibility reasons.
309
+ * @returns {string} The DNS address for this service.
310
+ */
311
+ static get apiEndpoint() {
312
+ return 'discoveryengine.googleapis.com';
313
+ }
314
+ /**
315
+ * The port for this API service.
316
+ * @returns {number} The default port for this service.
317
+ */
318
+ static get port() {
319
+ return 443;
320
+ }
321
+ /**
322
+ * The scopes needed to make gRPC calls for every method defined
323
+ * in this service.
324
+ * @returns {string[]} List of default scopes.
325
+ */
326
+ static get scopes() {
327
+ return ['https://www.googleapis.com/auth/cloud-platform'];
328
+ }
329
+ /**
330
+ * Return the project ID used by this class.
331
+ * @returns {Promise} A promise that resolves to string containing the project ID.
332
+ */
333
+ getProjectId(callback) {
334
+ if (callback) {
335
+ this.auth.getProjectId(callback);
336
+ return;
337
+ }
338
+ return this.auth.getProjectId();
339
+ }
340
+ getDocument(request, optionsOrCallback, callback) {
341
+ var _a;
342
+ request = request || {};
343
+ let options;
344
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
345
+ callback = optionsOrCallback;
346
+ options = {};
347
+ }
348
+ else {
349
+ options = optionsOrCallback;
350
+ }
351
+ options = options || {};
352
+ options.otherArgs = options.otherArgs || {};
353
+ options.otherArgs.headers = options.otherArgs.headers || {};
354
+ options.otherArgs.headers['x-goog-request-params'] =
355
+ this._gaxModule.routingHeader.fromParams({
356
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
357
+ });
358
+ this.initialize();
359
+ return this.innerApiCalls.getDocument(request, options, callback);
360
+ }
361
+ createDocument(request, optionsOrCallback, callback) {
362
+ var _a;
363
+ request = request || {};
364
+ let options;
365
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
366
+ callback = optionsOrCallback;
367
+ options = {};
368
+ }
369
+ else {
370
+ options = optionsOrCallback;
371
+ }
372
+ options = options || {};
373
+ options.otherArgs = options.otherArgs || {};
374
+ options.otherArgs.headers = options.otherArgs.headers || {};
375
+ options.otherArgs.headers['x-goog-request-params'] =
376
+ this._gaxModule.routingHeader.fromParams({
377
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
378
+ });
379
+ this.initialize();
380
+ return this.innerApiCalls.createDocument(request, options, callback);
381
+ }
382
+ updateDocument(request, optionsOrCallback, callback) {
383
+ var _a;
384
+ request = request || {};
385
+ let options;
386
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
387
+ callback = optionsOrCallback;
388
+ options = {};
389
+ }
390
+ else {
391
+ options = optionsOrCallback;
392
+ }
393
+ options = options || {};
394
+ options.otherArgs = options.otherArgs || {};
395
+ options.otherArgs.headers = options.otherArgs.headers || {};
396
+ options.otherArgs.headers['x-goog-request-params'] =
397
+ this._gaxModule.routingHeader.fromParams({
398
+ 'document.name': (_a = request.document.name) !== null && _a !== void 0 ? _a : '',
399
+ });
400
+ this.initialize();
401
+ return this.innerApiCalls.updateDocument(request, options, callback);
402
+ }
403
+ deleteDocument(request, optionsOrCallback, callback) {
404
+ var _a;
405
+ request = request || {};
406
+ let options;
407
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
408
+ callback = optionsOrCallback;
409
+ options = {};
410
+ }
411
+ else {
412
+ options = optionsOrCallback;
413
+ }
414
+ options = options || {};
415
+ options.otherArgs = options.otherArgs || {};
416
+ options.otherArgs.headers = options.otherArgs.headers || {};
417
+ options.otherArgs.headers['x-goog-request-params'] =
418
+ this._gaxModule.routingHeader.fromParams({
419
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
420
+ });
421
+ this.initialize();
422
+ return this.innerApiCalls.deleteDocument(request, options, callback);
423
+ }
424
+ importDocuments(request, optionsOrCallback, callback) {
425
+ var _a;
426
+ request = request || {};
427
+ let options;
428
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
429
+ callback = optionsOrCallback;
430
+ options = {};
431
+ }
432
+ else {
433
+ options = optionsOrCallback;
434
+ }
435
+ options = options || {};
436
+ options.otherArgs = options.otherArgs || {};
437
+ options.otherArgs.headers = options.otherArgs.headers || {};
438
+ options.otherArgs.headers['x-goog-request-params'] =
439
+ this._gaxModule.routingHeader.fromParams({
440
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
441
+ });
442
+ this.initialize();
443
+ return this.innerApiCalls.importDocuments(request, options, callback);
444
+ }
445
+ /**
446
+ * Check the status of the long running operation returned by `importDocuments()`.
447
+ * @param {String} name
448
+ * The operation name that will be passed.
449
+ * @returns {Promise} - The promise which resolves to an object.
450
+ * The decoded operation object has result and metadata field to get information from.
451
+ * Please see the
452
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
453
+ * for more details and examples.
454
+ * @example <caption>include:samples/generated/v1/document_service.import_documents.js</caption>
455
+ * region_tag:discoveryengine_v1_generated_DocumentService_ImportDocuments_async
456
+ */
457
+ async checkImportDocumentsProgress(name) {
458
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
459
+ const [operation] = await this.operationsClient.getOperation(request);
460
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importDocuments, this._gaxModule.createDefaultBackoffSettings());
461
+ return decodeOperation;
462
+ }
463
+ purgeDocuments(request, optionsOrCallback, callback) {
464
+ var _a;
465
+ request = request || {};
466
+ let options;
467
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
468
+ callback = optionsOrCallback;
469
+ options = {};
470
+ }
471
+ else {
472
+ options = optionsOrCallback;
473
+ }
474
+ options = options || {};
475
+ options.otherArgs = options.otherArgs || {};
476
+ options.otherArgs.headers = options.otherArgs.headers || {};
477
+ options.otherArgs.headers['x-goog-request-params'] =
478
+ this._gaxModule.routingHeader.fromParams({
479
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
480
+ });
481
+ this.initialize();
482
+ return this.innerApiCalls.purgeDocuments(request, options, callback);
483
+ }
484
+ /**
485
+ * Check the status of the long running operation returned by `purgeDocuments()`.
486
+ * @param {String} name
487
+ * The operation name that will be passed.
488
+ * @returns {Promise} - The promise which resolves to an object.
489
+ * The decoded operation object has result and metadata field to get information from.
490
+ * Please see the
491
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
492
+ * for more details and examples.
493
+ * @example <caption>include:samples/generated/v1/document_service.purge_documents.js</caption>
494
+ * region_tag:discoveryengine_v1_generated_DocumentService_PurgeDocuments_async
495
+ */
496
+ async checkPurgeDocumentsProgress(name) {
497
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
498
+ const [operation] = await this.operationsClient.getOperation(request);
499
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.purgeDocuments, this._gaxModule.createDefaultBackoffSettings());
500
+ return decodeOperation;
501
+ }
502
+ listDocuments(request, optionsOrCallback, callback) {
503
+ var _a;
504
+ request = request || {};
505
+ let options;
506
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
507
+ callback = optionsOrCallback;
508
+ options = {};
509
+ }
510
+ else {
511
+ options = optionsOrCallback;
512
+ }
513
+ options = options || {};
514
+ options.otherArgs = options.otherArgs || {};
515
+ options.otherArgs.headers = options.otherArgs.headers || {};
516
+ options.otherArgs.headers['x-goog-request-params'] =
517
+ this._gaxModule.routingHeader.fromParams({
518
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
519
+ });
520
+ this.initialize();
521
+ return this.innerApiCalls.listDocuments(request, options, callback);
522
+ }
523
+ /**
524
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
525
+ * @param {Object} request
526
+ * The request object that will be sent.
527
+ * @param {string} request.parent
528
+ * Required. The parent branch resource name, such as
529
+ * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
530
+ * Use `default_branch` as the branch ID, to list documents under the default
531
+ * branch.
532
+ *
533
+ * If the caller does not have permission to list {@link |Documents}s under this
534
+ * branch, regardless of whether or not this branch exists, a
535
+ * `PERMISSION_DENIED` error is returned.
536
+ * @param {number} request.pageSize
537
+ * Maximum number of {@link google.cloud.discoveryengine.v1.Document|Document}s to
538
+ * return. If unspecified, defaults to 100. The maximum allowed value is 1000.
539
+ * Values above 1000 will be coerced to 1000.
540
+ *
541
+ * If this field is negative, an `INVALID_ARGUMENT` error is returned.
542
+ * @param {string} request.pageToken
543
+ * A page token
544
+ * {@link google.cloud.discoveryengine.v1.ListDocumentsResponse.next_page_token|ListDocumentsResponse.next_page_token},
545
+ * received from a previous
546
+ * {@link google.cloud.discoveryengine.v1.DocumentService.ListDocuments|DocumentService.ListDocuments}
547
+ * call. Provide this to retrieve the subsequent page.
548
+ *
549
+ * When paginating, all other parameters provided to
550
+ * {@link google.cloud.discoveryengine.v1.DocumentService.ListDocuments|DocumentService.ListDocuments}
551
+ * must match the call that provided the page token. Otherwise, an
552
+ * `INVALID_ARGUMENT` error is returned.
553
+ * @param {object} [options]
554
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
555
+ * @returns {Stream}
556
+ * An object stream which emits an object representing {@link google.cloud.discoveryengine.v1.Document | Document} on 'data' event.
557
+ * The client library will perform auto-pagination by default: it will call the API as many
558
+ * times as needed. Note that it can affect your quota.
559
+ * We recommend using `listDocumentsAsync()`
560
+ * method described below for async iteration which you can stop as needed.
561
+ * Please see the
562
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
563
+ * for more details and examples.
564
+ */
565
+ listDocumentsStream(request, options) {
566
+ var _a;
567
+ request = request || {};
568
+ options = options || {};
569
+ options.otherArgs = options.otherArgs || {};
570
+ options.otherArgs.headers = options.otherArgs.headers || {};
571
+ options.otherArgs.headers['x-goog-request-params'] =
572
+ this._gaxModule.routingHeader.fromParams({
573
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
574
+ });
575
+ const defaultCallSettings = this._defaults['listDocuments'];
576
+ const callSettings = defaultCallSettings.merge(options);
577
+ this.initialize();
578
+ return this.descriptors.page.listDocuments.createStream(this.innerApiCalls.listDocuments, request, callSettings);
579
+ }
580
+ /**
581
+ * Equivalent to `listDocuments`, but returns an iterable object.
582
+ *
583
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
584
+ * @param {Object} request
585
+ * The request object that will be sent.
586
+ * @param {string} request.parent
587
+ * Required. The parent branch resource name, such as
588
+ * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
589
+ * Use `default_branch` as the branch ID, to list documents under the default
590
+ * branch.
591
+ *
592
+ * If the caller does not have permission to list {@link |Documents}s under this
593
+ * branch, regardless of whether or not this branch exists, a
594
+ * `PERMISSION_DENIED` error is returned.
595
+ * @param {number} request.pageSize
596
+ * Maximum number of {@link google.cloud.discoveryengine.v1.Document|Document}s to
597
+ * return. If unspecified, defaults to 100. The maximum allowed value is 1000.
598
+ * Values above 1000 will be coerced to 1000.
599
+ *
600
+ * If this field is negative, an `INVALID_ARGUMENT` error is returned.
601
+ * @param {string} request.pageToken
602
+ * A page token
603
+ * {@link google.cloud.discoveryengine.v1.ListDocumentsResponse.next_page_token|ListDocumentsResponse.next_page_token},
604
+ * received from a previous
605
+ * {@link google.cloud.discoveryengine.v1.DocumentService.ListDocuments|DocumentService.ListDocuments}
606
+ * call. Provide this to retrieve the subsequent page.
607
+ *
608
+ * When paginating, all other parameters provided to
609
+ * {@link google.cloud.discoveryengine.v1.DocumentService.ListDocuments|DocumentService.ListDocuments}
610
+ * must match the call that provided the page token. Otherwise, an
611
+ * `INVALID_ARGUMENT` error is returned.
612
+ * @param {object} [options]
613
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
614
+ * @returns {Object}
615
+ * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
616
+ * When you iterate the returned iterable, each element will be an object representing
617
+ * {@link google.cloud.discoveryengine.v1.Document | Document}. The API will be called under the hood as needed, once per the page,
618
+ * so you can stop the iteration when you don't need more results.
619
+ * Please see the
620
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
621
+ * for more details and examples.
622
+ * @example <caption>include:samples/generated/v1/document_service.list_documents.js</caption>
623
+ * region_tag:discoveryengine_v1_generated_DocumentService_ListDocuments_async
624
+ */
625
+ listDocumentsAsync(request, options) {
626
+ var _a;
627
+ request = request || {};
628
+ options = options || {};
629
+ options.otherArgs = options.otherArgs || {};
630
+ options.otherArgs.headers = options.otherArgs.headers || {};
631
+ options.otherArgs.headers['x-goog-request-params'] =
632
+ this._gaxModule.routingHeader.fromParams({
633
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
634
+ });
635
+ const defaultCallSettings = this._defaults['listDocuments'];
636
+ const callSettings = defaultCallSettings.merge(options);
637
+ this.initialize();
638
+ return this.descriptors.page.listDocuments.asyncIterate(this.innerApiCalls['listDocuments'], request, callSettings);
639
+ }
640
+ /**
641
+ * Gets the latest state of a long-running operation. Clients can use this
642
+ * method to poll the operation result at intervals as recommended by the API
643
+ * service.
644
+ *
645
+ * @param {Object} request - The request object that will be sent.
646
+ * @param {string} request.name - The name of the operation resource.
647
+ * @param {Object=} options
648
+ * Optional parameters. You can override the default settings for this call,
649
+ * e.g, timeout, retries, paginations, etc. See {@link
650
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
651
+ * for the details.
652
+ * @param {function(?Error, ?Object)=} callback
653
+ * The function which will be called with the result of the API call.
654
+ *
655
+ * The second parameter to the callback is an object representing
656
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
657
+ * @return {Promise} - The promise which resolves to an array.
658
+ * The first element of the array is an object representing
659
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
660
+ * The promise has a method named "cancel" which cancels the ongoing API call.
661
+ *
662
+ * @example
663
+ * ```
664
+ * const client = longrunning.operationsClient();
665
+ * const name = '';
666
+ * const [response] = await client.getOperation({name});
667
+ * // doThingsWith(response)
668
+ * ```
669
+ */
670
+ getOperation(request, options, callback) {
671
+ return this.operationsClient.getOperation(request, options, callback);
672
+ }
673
+ /**
674
+ * Lists operations that match the specified filter in the request. If the
675
+ * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
676
+ *
677
+ * For-await-of syntax is used with the iterable to recursively get response element on-demand.
678
+ *
679
+ * @param {Object} request - The request object that will be sent.
680
+ * @param {string} request.name - The name of the operation collection.
681
+ * @param {string} request.filter - The standard list filter.
682
+ * @param {number=} request.pageSize -
683
+ * The maximum number of resources contained in the underlying API
684
+ * response. If page streaming is performed per-resource, this
685
+ * parameter does not affect the return value. If page streaming is
686
+ * performed per-page, this determines the maximum number of
687
+ * resources in a page.
688
+ * @param {Object=} options
689
+ * Optional parameters. You can override the default settings for this call,
690
+ * e.g, timeout, retries, paginations, etc. See {@link
691
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
692
+ * details.
693
+ * @returns {Object}
694
+ * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}.
695
+ *
696
+ * @example
697
+ * ```
698
+ * const client = longrunning.operationsClient();
699
+ * for await (const response of client.listOperationsAsync(request));
700
+ * // doThingsWith(response)
701
+ * ```
702
+ */
703
+ listOperationsAsync(request, options) {
704
+ return this.operationsClient.listOperationsAsync(request, options);
705
+ }
706
+ /**
707
+ * Starts asynchronous cancellation on a long-running operation. The server
708
+ * makes a best effort to cancel the operation, but success is not
709
+ * guaranteed. If the server doesn't support this method, it returns
710
+ * `google.rpc.Code.UNIMPLEMENTED`. Clients can use
711
+ * {@link Operations.GetOperation} or
712
+ * other methods to check whether the cancellation succeeded or whether the
713
+ * operation completed despite cancellation. On successful cancellation,
714
+ * the operation is not deleted; instead, it becomes an operation with
715
+ * an {@link Operation.error} value with a {@link google.rpc.Status.code} of
716
+ * 1, corresponding to `Code.CANCELLED`.
717
+ *
718
+ * @param {Object} request - The request object that will be sent.
719
+ * @param {string} request.name - The name of the operation resource to be cancelled.
720
+ * @param {Object=} options
721
+ * Optional parameters. You can override the default settings for this call,
722
+ * e.g, timeout, retries, paginations, etc. See {@link
723
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
724
+ * details.
725
+ * @param {function(?Error)=} callback
726
+ * The function which will be called with the result of the API call.
727
+ * @return {Promise} - The promise which resolves when API call finishes.
728
+ * The promise has a method named "cancel" which cancels the ongoing API
729
+ * call.
730
+ *
731
+ * @example
732
+ * ```
733
+ * const client = longrunning.operationsClient();
734
+ * await client.cancelOperation({name: ''});
735
+ * ```
736
+ */
737
+ cancelOperation(request, options, callback) {
738
+ return this.operationsClient.cancelOperation(request, options, callback);
739
+ }
740
+ /**
741
+ * Deletes a long-running operation. This method indicates that the client is
742
+ * no longer interested in the operation result. It does not cancel the
743
+ * operation. If the server doesn't support this method, it returns
744
+ * `google.rpc.Code.UNIMPLEMENTED`.
745
+ *
746
+ * @param {Object} request - The request object that will be sent.
747
+ * @param {string} request.name - The name of the operation resource to be deleted.
748
+ * @param {Object=} options
749
+ * Optional parameters. You can override the default settings for this call,
750
+ * e.g, timeout, retries, paginations, etc. See {@link
751
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
752
+ * for the details.
753
+ * @param {function(?Error)=} callback
754
+ * The function which will be called with the result of the API call.
755
+ * @return {Promise} - The promise which resolves when API call finishes.
756
+ * The promise has a method named "cancel" which cancels the ongoing API
757
+ * call.
758
+ *
759
+ * @example
760
+ * ```
761
+ * const client = longrunning.operationsClient();
762
+ * await client.deleteOperation({name: ''});
763
+ * ```
764
+ */
765
+ deleteOperation(request, options, callback) {
766
+ return this.operationsClient.deleteOperation(request, options, callback);
767
+ }
768
+ // --------------------
769
+ // -- Path templates --
770
+ // --------------------
771
+ /**
772
+ * Return a fully-qualified projectLocationCollectionDataStoreBranch resource name string.
773
+ *
774
+ * @param {string} project
775
+ * @param {string} location
776
+ * @param {string} collection
777
+ * @param {string} data_store
778
+ * @param {string} branch
779
+ * @returns {string} Resource name string.
780
+ */
781
+ projectLocationCollectionDataStoreBranchPath(project, location, collection, dataStore, branch) {
782
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.render({
783
+ project: project,
784
+ location: location,
785
+ collection: collection,
786
+ data_store: dataStore,
787
+ branch: branch,
788
+ });
789
+ }
790
+ /**
791
+ * Parse the project from ProjectLocationCollectionDataStoreBranch resource.
792
+ *
793
+ * @param {string} projectLocationCollectionDataStoreBranchName
794
+ * A fully-qualified path representing project_location_collection_data_store_branch resource.
795
+ * @returns {string} A string representing the project.
796
+ */
797
+ matchProjectFromProjectLocationCollectionDataStoreBranchName(projectLocationCollectionDataStoreBranchName) {
798
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match(projectLocationCollectionDataStoreBranchName).project;
799
+ }
800
+ /**
801
+ * Parse the location from ProjectLocationCollectionDataStoreBranch resource.
802
+ *
803
+ * @param {string} projectLocationCollectionDataStoreBranchName
804
+ * A fully-qualified path representing project_location_collection_data_store_branch resource.
805
+ * @returns {string} A string representing the location.
806
+ */
807
+ matchLocationFromProjectLocationCollectionDataStoreBranchName(projectLocationCollectionDataStoreBranchName) {
808
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match(projectLocationCollectionDataStoreBranchName).location;
809
+ }
810
+ /**
811
+ * Parse the collection from ProjectLocationCollectionDataStoreBranch resource.
812
+ *
813
+ * @param {string} projectLocationCollectionDataStoreBranchName
814
+ * A fully-qualified path representing project_location_collection_data_store_branch resource.
815
+ * @returns {string} A string representing the collection.
816
+ */
817
+ matchCollectionFromProjectLocationCollectionDataStoreBranchName(projectLocationCollectionDataStoreBranchName) {
818
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match(projectLocationCollectionDataStoreBranchName).collection;
819
+ }
820
+ /**
821
+ * Parse the data_store from ProjectLocationCollectionDataStoreBranch resource.
822
+ *
823
+ * @param {string} projectLocationCollectionDataStoreBranchName
824
+ * A fully-qualified path representing project_location_collection_data_store_branch resource.
825
+ * @returns {string} A string representing the data_store.
826
+ */
827
+ matchDataStoreFromProjectLocationCollectionDataStoreBranchName(projectLocationCollectionDataStoreBranchName) {
828
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match(projectLocationCollectionDataStoreBranchName).data_store;
829
+ }
830
+ /**
831
+ * Parse the branch from ProjectLocationCollectionDataStoreBranch resource.
832
+ *
833
+ * @param {string} projectLocationCollectionDataStoreBranchName
834
+ * A fully-qualified path representing project_location_collection_data_store_branch resource.
835
+ * @returns {string} A string representing the branch.
836
+ */
837
+ matchBranchFromProjectLocationCollectionDataStoreBranchName(projectLocationCollectionDataStoreBranchName) {
838
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match(projectLocationCollectionDataStoreBranchName).branch;
839
+ }
840
+ /**
841
+ * Return a fully-qualified projectLocationCollectionDataStoreBranchDocument resource name string.
842
+ *
843
+ * @param {string} project
844
+ * @param {string} location
845
+ * @param {string} collection
846
+ * @param {string} data_store
847
+ * @param {string} branch
848
+ * @param {string} document
849
+ * @returns {string} Resource name string.
850
+ */
851
+ projectLocationCollectionDataStoreBranchDocumentPath(project, location, collection, dataStore, branch, document) {
852
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.render({
853
+ project: project,
854
+ location: location,
855
+ collection: collection,
856
+ data_store: dataStore,
857
+ branch: branch,
858
+ document: document,
859
+ });
860
+ }
861
+ /**
862
+ * Parse the project from ProjectLocationCollectionDataStoreBranchDocument resource.
863
+ *
864
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
865
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
866
+ * @returns {string} A string representing the project.
867
+ */
868
+ matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
869
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).project;
870
+ }
871
+ /**
872
+ * Parse the location from ProjectLocationCollectionDataStoreBranchDocument resource.
873
+ *
874
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
875
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
876
+ * @returns {string} A string representing the location.
877
+ */
878
+ matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
879
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).location;
880
+ }
881
+ /**
882
+ * Parse the collection from ProjectLocationCollectionDataStoreBranchDocument resource.
883
+ *
884
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
885
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
886
+ * @returns {string} A string representing the collection.
887
+ */
888
+ matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
889
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).collection;
890
+ }
891
+ /**
892
+ * Parse the data_store from ProjectLocationCollectionDataStoreBranchDocument resource.
893
+ *
894
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
895
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
896
+ * @returns {string} A string representing the data_store.
897
+ */
898
+ matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
899
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).data_store;
900
+ }
901
+ /**
902
+ * Parse the branch from ProjectLocationCollectionDataStoreBranchDocument resource.
903
+ *
904
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
905
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
906
+ * @returns {string} A string representing the branch.
907
+ */
908
+ matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
909
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).branch;
910
+ }
911
+ /**
912
+ * Parse the document from ProjectLocationCollectionDataStoreBranchDocument resource.
913
+ *
914
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
915
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
916
+ * @returns {string} A string representing the document.
917
+ */
918
+ matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
919
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).document;
920
+ }
921
+ /**
922
+ * Return a fully-qualified projectLocationCollectionDataStoreSchema resource name string.
923
+ *
924
+ * @param {string} project
925
+ * @param {string} location
926
+ * @param {string} collection
927
+ * @param {string} data_store
928
+ * @param {string} schema
929
+ * @returns {string} Resource name string.
930
+ */
931
+ projectLocationCollectionDataStoreSchemaPath(project, location, collection, dataStore, schema) {
932
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.render({
933
+ project: project,
934
+ location: location,
935
+ collection: collection,
936
+ data_store: dataStore,
937
+ schema: schema,
938
+ });
939
+ }
940
+ /**
941
+ * Parse the project from ProjectLocationCollectionDataStoreSchema resource.
942
+ *
943
+ * @param {string} projectLocationCollectionDataStoreSchemaName
944
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
945
+ * @returns {string} A string representing the project.
946
+ */
947
+ matchProjectFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
948
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).project;
949
+ }
950
+ /**
951
+ * Parse the location from ProjectLocationCollectionDataStoreSchema resource.
952
+ *
953
+ * @param {string} projectLocationCollectionDataStoreSchemaName
954
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
955
+ * @returns {string} A string representing the location.
956
+ */
957
+ matchLocationFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
958
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).location;
959
+ }
960
+ /**
961
+ * Parse the collection from ProjectLocationCollectionDataStoreSchema resource.
962
+ *
963
+ * @param {string} projectLocationCollectionDataStoreSchemaName
964
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
965
+ * @returns {string} A string representing the collection.
966
+ */
967
+ matchCollectionFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
968
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).collection;
969
+ }
970
+ /**
971
+ * Parse the data_store from ProjectLocationCollectionDataStoreSchema resource.
972
+ *
973
+ * @param {string} projectLocationCollectionDataStoreSchemaName
974
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
975
+ * @returns {string} A string representing the data_store.
976
+ */
977
+ matchDataStoreFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
978
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).data_store;
979
+ }
980
+ /**
981
+ * Parse the schema from ProjectLocationCollectionDataStoreSchema resource.
982
+ *
983
+ * @param {string} projectLocationCollectionDataStoreSchemaName
984
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
985
+ * @returns {string} A string representing the schema.
986
+ */
987
+ matchSchemaFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
988
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).schema;
989
+ }
990
+ /**
991
+ * Return a fully-qualified projectLocationDataStoreBranch resource name string.
992
+ *
993
+ * @param {string} project
994
+ * @param {string} location
995
+ * @param {string} data_store
996
+ * @param {string} branch
997
+ * @returns {string} Resource name string.
998
+ */
999
+ projectLocationDataStoreBranchPath(project, location, dataStore, branch) {
1000
+ return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.render({
1001
+ project: project,
1002
+ location: location,
1003
+ data_store: dataStore,
1004
+ branch: branch,
1005
+ });
1006
+ }
1007
+ /**
1008
+ * Parse the project from ProjectLocationDataStoreBranch resource.
1009
+ *
1010
+ * @param {string} projectLocationDataStoreBranchName
1011
+ * A fully-qualified path representing project_location_data_store_branch resource.
1012
+ * @returns {string} A string representing the project.
1013
+ */
1014
+ matchProjectFromProjectLocationDataStoreBranchName(projectLocationDataStoreBranchName) {
1015
+ return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.match(projectLocationDataStoreBranchName).project;
1016
+ }
1017
+ /**
1018
+ * Parse the location from ProjectLocationDataStoreBranch resource.
1019
+ *
1020
+ * @param {string} projectLocationDataStoreBranchName
1021
+ * A fully-qualified path representing project_location_data_store_branch resource.
1022
+ * @returns {string} A string representing the location.
1023
+ */
1024
+ matchLocationFromProjectLocationDataStoreBranchName(projectLocationDataStoreBranchName) {
1025
+ return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.match(projectLocationDataStoreBranchName).location;
1026
+ }
1027
+ /**
1028
+ * Parse the data_store from ProjectLocationDataStoreBranch resource.
1029
+ *
1030
+ * @param {string} projectLocationDataStoreBranchName
1031
+ * A fully-qualified path representing project_location_data_store_branch resource.
1032
+ * @returns {string} A string representing the data_store.
1033
+ */
1034
+ matchDataStoreFromProjectLocationDataStoreBranchName(projectLocationDataStoreBranchName) {
1035
+ return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.match(projectLocationDataStoreBranchName).data_store;
1036
+ }
1037
+ /**
1038
+ * Parse the branch from ProjectLocationDataStoreBranch resource.
1039
+ *
1040
+ * @param {string} projectLocationDataStoreBranchName
1041
+ * A fully-qualified path representing project_location_data_store_branch resource.
1042
+ * @returns {string} A string representing the branch.
1043
+ */
1044
+ matchBranchFromProjectLocationDataStoreBranchName(projectLocationDataStoreBranchName) {
1045
+ return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.match(projectLocationDataStoreBranchName).branch;
1046
+ }
1047
+ /**
1048
+ * Return a fully-qualified projectLocationDataStoreBranchDocument resource name string.
1049
+ *
1050
+ * @param {string} project
1051
+ * @param {string} location
1052
+ * @param {string} data_store
1053
+ * @param {string} branch
1054
+ * @param {string} document
1055
+ * @returns {string} Resource name string.
1056
+ */
1057
+ projectLocationDataStoreBranchDocumentPath(project, location, dataStore, branch, document) {
1058
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.render({
1059
+ project: project,
1060
+ location: location,
1061
+ data_store: dataStore,
1062
+ branch: branch,
1063
+ document: document,
1064
+ });
1065
+ }
1066
+ /**
1067
+ * Parse the project from ProjectLocationDataStoreBranchDocument resource.
1068
+ *
1069
+ * @param {string} projectLocationDataStoreBranchDocumentName
1070
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
1071
+ * @returns {string} A string representing the project.
1072
+ */
1073
+ matchProjectFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
1074
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).project;
1075
+ }
1076
+ /**
1077
+ * Parse the location from ProjectLocationDataStoreBranchDocument resource.
1078
+ *
1079
+ * @param {string} projectLocationDataStoreBranchDocumentName
1080
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
1081
+ * @returns {string} A string representing the location.
1082
+ */
1083
+ matchLocationFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
1084
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).location;
1085
+ }
1086
+ /**
1087
+ * Parse the data_store from ProjectLocationDataStoreBranchDocument resource.
1088
+ *
1089
+ * @param {string} projectLocationDataStoreBranchDocumentName
1090
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
1091
+ * @returns {string} A string representing the data_store.
1092
+ */
1093
+ matchDataStoreFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
1094
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).data_store;
1095
+ }
1096
+ /**
1097
+ * Parse the branch from ProjectLocationDataStoreBranchDocument resource.
1098
+ *
1099
+ * @param {string} projectLocationDataStoreBranchDocumentName
1100
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
1101
+ * @returns {string} A string representing the branch.
1102
+ */
1103
+ matchBranchFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
1104
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).branch;
1105
+ }
1106
+ /**
1107
+ * Parse the document from ProjectLocationDataStoreBranchDocument resource.
1108
+ *
1109
+ * @param {string} projectLocationDataStoreBranchDocumentName
1110
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
1111
+ * @returns {string} A string representing the document.
1112
+ */
1113
+ matchDocumentFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
1114
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).document;
1115
+ }
1116
+ /**
1117
+ * Return a fully-qualified projectLocationDataStoreSchema resource name string.
1118
+ *
1119
+ * @param {string} project
1120
+ * @param {string} location
1121
+ * @param {string} data_store
1122
+ * @param {string} schema
1123
+ * @returns {string} Resource name string.
1124
+ */
1125
+ projectLocationDataStoreSchemaPath(project, location, dataStore, schema) {
1126
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.render({
1127
+ project: project,
1128
+ location: location,
1129
+ data_store: dataStore,
1130
+ schema: schema,
1131
+ });
1132
+ }
1133
+ /**
1134
+ * Parse the project from ProjectLocationDataStoreSchema resource.
1135
+ *
1136
+ * @param {string} projectLocationDataStoreSchemaName
1137
+ * A fully-qualified path representing project_location_data_store_schema resource.
1138
+ * @returns {string} A string representing the project.
1139
+ */
1140
+ matchProjectFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
1141
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).project;
1142
+ }
1143
+ /**
1144
+ * Parse the location from ProjectLocationDataStoreSchema resource.
1145
+ *
1146
+ * @param {string} projectLocationDataStoreSchemaName
1147
+ * A fully-qualified path representing project_location_data_store_schema resource.
1148
+ * @returns {string} A string representing the location.
1149
+ */
1150
+ matchLocationFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
1151
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).location;
1152
+ }
1153
+ /**
1154
+ * Parse the data_store from ProjectLocationDataStoreSchema resource.
1155
+ *
1156
+ * @param {string} projectLocationDataStoreSchemaName
1157
+ * A fully-qualified path representing project_location_data_store_schema resource.
1158
+ * @returns {string} A string representing the data_store.
1159
+ */
1160
+ matchDataStoreFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
1161
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).data_store;
1162
+ }
1163
+ /**
1164
+ * Parse the schema from ProjectLocationDataStoreSchema resource.
1165
+ *
1166
+ * @param {string} projectLocationDataStoreSchemaName
1167
+ * A fully-qualified path representing project_location_data_store_schema resource.
1168
+ * @returns {string} A string representing the schema.
1169
+ */
1170
+ matchSchemaFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
1171
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).schema;
1172
+ }
1173
+ /**
1174
+ * Terminate the gRPC channel and close the client.
1175
+ *
1176
+ * The client will no longer be usable and all future behavior is undefined.
1177
+ * @returns {Promise} A promise that resolves when the client is closed.
1178
+ */
1179
+ close() {
1180
+ if (this.documentServiceStub && !this._terminated) {
1181
+ return this.documentServiceStub.then(stub => {
1182
+ this._terminated = true;
1183
+ stub.close();
1184
+ this.operationsClient.close();
1185
+ });
1186
+ }
1187
+ return Promise.resolve();
1188
+ }
1189
+ }
1190
+ exports.DocumentServiceClient = DocumentServiceClient;
1191
+ //# sourceMappingURL=document_service_client.js.map