@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,659 @@
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.CompletionServiceClient = void 0;
21
+ const jsonProtos = require("../../protos/protos.json");
22
+ /**
23
+ * Client JSON configuration object, loaded from
24
+ * `src/v1/completion_service_client_config.json`.
25
+ * This file defines retry strategy and timeouts for all API methods in this library.
26
+ */
27
+ const gapicConfig = require("./completion_service_client_config.json");
28
+ const version = require('../../../package.json').version;
29
+ /**
30
+ * Service for Auto-Completion.
31
+ * @class
32
+ * @memberof v1
33
+ */
34
+ class CompletionServiceClient {
35
+ /**
36
+ * Construct an instance of CompletionServiceClient.
37
+ *
38
+ * @param {object} [options] - The configuration object.
39
+ * The options accepted by the constructor are described in detail
40
+ * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
41
+ * The common options are:
42
+ * @param {object} [options.credentials] - Credentials object.
43
+ * @param {string} [options.credentials.client_email]
44
+ * @param {string} [options.credentials.private_key]
45
+ * @param {string} [options.email] - Account email address. Required when
46
+ * using a .pem or .p12 keyFilename.
47
+ * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
48
+ * .p12 key downloaded from the Google Developers Console. If you provide
49
+ * a path to a JSON file, the projectId option below is not necessary.
50
+ * NOTE: .pem and .p12 require you to specify options.email as well.
51
+ * @param {number} [options.port] - The port on which to connect to
52
+ * the remote host.
53
+ * @param {string} [options.projectId] - The project ID from the Google
54
+ * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
55
+ * the environment variable GCLOUD_PROJECT for your project ID. If your
56
+ * app is running in an environment which supports
57
+ * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
58
+ * your project ID will be detected automatically.
59
+ * @param {string} [options.apiEndpoint] - The domain name of the
60
+ * API remote host.
61
+ * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
62
+ * Follows the structure of {@link gapicConfig}.
63
+ * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
64
+ * Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
65
+ * For more information, please check the
66
+ * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
67
+ * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
68
+ * need to avoid loading the default gRPC version and want to use the fallback
69
+ * HTTP implementation. Load only fallback version and pass it to the constructor:
70
+ * ```
71
+ * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
72
+ * const client = new CompletionServiceClient({fallback: 'rest'}, gax);
73
+ * ```
74
+ */
75
+ constructor(opts, gaxInstance) {
76
+ var _a, _b;
77
+ this._terminated = false;
78
+ this.descriptors = {
79
+ page: {},
80
+ stream: {},
81
+ longrunning: {},
82
+ batching: {},
83
+ };
84
+ // Ensure that options include all the required fields.
85
+ const staticMembers = this.constructor;
86
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath;
87
+ this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
88
+ const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
89
+ const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {};
90
+ 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');
91
+ opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
92
+ // Request numeric enum values if REST transport is used.
93
+ opts.numericEnums = true;
94
+ // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
95
+ if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
96
+ opts['scopes'] = staticMembers.scopes;
97
+ }
98
+ // Load google-gax module synchronously if needed
99
+ if (!gaxInstance) {
100
+ gaxInstance = require('google-gax');
101
+ }
102
+ // Choose either gRPC or proto-over-HTTP implementation of google-gax.
103
+ this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
104
+ // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
105
+ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
106
+ // Save options to use in initialize() method.
107
+ this._opts = opts;
108
+ // Save the auth object to the client, for use by other methods.
109
+ this.auth = this._gaxGrpc.auth;
110
+ // Set useJWTAccessWithScope on the auth object.
111
+ this.auth.useJWTAccessWithScope = true;
112
+ // Set defaultServicePath on the auth object.
113
+ this.auth.defaultServicePath = staticMembers.servicePath;
114
+ // Set the default scopes in auth client if needed.
115
+ if (servicePath === staticMembers.servicePath) {
116
+ this.auth.defaultScopes = staticMembers.scopes;
117
+ }
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 if (opts.fallback === 'rest') {
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
+ projectLocationCollectionDataStorePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}'),
142
+ projectLocationCollectionDataStoreBranchDocumentPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}'),
143
+ projectLocationCollectionDataStoreSchemaPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}'),
144
+ projectLocationDataStorePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}'),
145
+ projectLocationDataStoreBranchDocumentPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}'),
146
+ projectLocationDataStoreSchemaPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}'),
147
+ };
148
+ // Put together the default options sent with requests.
149
+ this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1.CompletionService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
150
+ // Set up a dictionary of "inner API calls"; the core implementation
151
+ // of calling the API is handled in `google-gax`, with this code
152
+ // merely providing the destination and request information.
153
+ this.innerApiCalls = {};
154
+ // Add a warn function to the client constructor so it can be easily tested.
155
+ this.warn = this._gaxModule.warn;
156
+ }
157
+ /**
158
+ * Initialize the client.
159
+ * Performs asynchronous operations (such as authentication) and prepares the client.
160
+ * This function will be called automatically when any class method is called for the
161
+ * first time, but if you need to initialize it before calling an actual method,
162
+ * feel free to call initialize() directly.
163
+ *
164
+ * You can await on this method if you want to make sure the client is initialized.
165
+ *
166
+ * @returns {Promise} A promise that resolves to an authenticated service stub.
167
+ */
168
+ initialize() {
169
+ // If the client stub promise is already initialized, return immediately.
170
+ if (this.completionServiceStub) {
171
+ return this.completionServiceStub;
172
+ }
173
+ // Put together the "service stub" for
174
+ // google.cloud.discoveryengine.v1.CompletionService.
175
+ this.completionServiceStub = this._gaxGrpc.createStub(this._opts.fallback
176
+ ? this._protos.lookupService('google.cloud.discoveryengine.v1.CompletionService')
177
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any
178
+ this._protos.google.cloud.discoveryengine.v1
179
+ .CompletionService, this._opts, this._providedCustomServicePath);
180
+ // Iterate over each of the methods that the service provides
181
+ // and create an API call method for each.
182
+ const completionServiceStubMethods = ['completeQuery'];
183
+ for (const methodName of completionServiceStubMethods) {
184
+ const callPromise = this.completionServiceStub.then(stub => (...args) => {
185
+ if (this._terminated) {
186
+ return Promise.reject('The client has already been closed.');
187
+ }
188
+ const func = stub[methodName];
189
+ return func.apply(stub, args);
190
+ }, (err) => () => {
191
+ throw err;
192
+ });
193
+ const descriptor = undefined;
194
+ const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
195
+ this.innerApiCalls[methodName] = apiCall;
196
+ }
197
+ return this.completionServiceStub;
198
+ }
199
+ /**
200
+ * The DNS address for this API service.
201
+ * @returns {string} The DNS address for this service.
202
+ */
203
+ static get servicePath() {
204
+ return 'discoveryengine.googleapis.com';
205
+ }
206
+ /**
207
+ * The DNS address for this API service - same as servicePath(),
208
+ * exists for compatibility reasons.
209
+ * @returns {string} The DNS address for this service.
210
+ */
211
+ static get apiEndpoint() {
212
+ return 'discoveryengine.googleapis.com';
213
+ }
214
+ /**
215
+ * The port for this API service.
216
+ * @returns {number} The default port for this service.
217
+ */
218
+ static get port() {
219
+ return 443;
220
+ }
221
+ /**
222
+ * The scopes needed to make gRPC calls for every method defined
223
+ * in this service.
224
+ * @returns {string[]} List of default scopes.
225
+ */
226
+ static get scopes() {
227
+ return ['https://www.googleapis.com/auth/cloud-platform'];
228
+ }
229
+ /**
230
+ * Return the project ID used by this class.
231
+ * @returns {Promise} A promise that resolves to string containing the project ID.
232
+ */
233
+ getProjectId(callback) {
234
+ if (callback) {
235
+ this.auth.getProjectId(callback);
236
+ return;
237
+ }
238
+ return this.auth.getProjectId();
239
+ }
240
+ completeQuery(request, optionsOrCallback, callback) {
241
+ var _a;
242
+ request = request || {};
243
+ let options;
244
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
245
+ callback = optionsOrCallback;
246
+ options = {};
247
+ }
248
+ else {
249
+ options = optionsOrCallback;
250
+ }
251
+ options = options || {};
252
+ options.otherArgs = options.otherArgs || {};
253
+ options.otherArgs.headers = options.otherArgs.headers || {};
254
+ options.otherArgs.headers['x-goog-request-params'] =
255
+ this._gaxModule.routingHeader.fromParams({
256
+ data_store: (_a = request.dataStore) !== null && _a !== void 0 ? _a : '',
257
+ });
258
+ this.initialize();
259
+ return this.innerApiCalls.completeQuery(request, options, callback);
260
+ }
261
+ // --------------------
262
+ // -- Path templates --
263
+ // --------------------
264
+ /**
265
+ * Return a fully-qualified projectLocationCollectionDataStore resource name string.
266
+ *
267
+ * @param {string} project
268
+ * @param {string} location
269
+ * @param {string} collection
270
+ * @param {string} data_store
271
+ * @returns {string} Resource name string.
272
+ */
273
+ projectLocationCollectionDataStorePath(project, location, collection, dataStore) {
274
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.render({
275
+ project: project,
276
+ location: location,
277
+ collection: collection,
278
+ data_store: dataStore,
279
+ });
280
+ }
281
+ /**
282
+ * Parse the project from ProjectLocationCollectionDataStore resource.
283
+ *
284
+ * @param {string} projectLocationCollectionDataStoreName
285
+ * A fully-qualified path representing project_location_collection_data_store resource.
286
+ * @returns {string} A string representing the project.
287
+ */
288
+ matchProjectFromProjectLocationCollectionDataStoreName(projectLocationCollectionDataStoreName) {
289
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match(projectLocationCollectionDataStoreName).project;
290
+ }
291
+ /**
292
+ * Parse the location from ProjectLocationCollectionDataStore resource.
293
+ *
294
+ * @param {string} projectLocationCollectionDataStoreName
295
+ * A fully-qualified path representing project_location_collection_data_store resource.
296
+ * @returns {string} A string representing the location.
297
+ */
298
+ matchLocationFromProjectLocationCollectionDataStoreName(projectLocationCollectionDataStoreName) {
299
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match(projectLocationCollectionDataStoreName).location;
300
+ }
301
+ /**
302
+ * Parse the collection from ProjectLocationCollectionDataStore resource.
303
+ *
304
+ * @param {string} projectLocationCollectionDataStoreName
305
+ * A fully-qualified path representing project_location_collection_data_store resource.
306
+ * @returns {string} A string representing the collection.
307
+ */
308
+ matchCollectionFromProjectLocationCollectionDataStoreName(projectLocationCollectionDataStoreName) {
309
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match(projectLocationCollectionDataStoreName).collection;
310
+ }
311
+ /**
312
+ * Parse the data_store from ProjectLocationCollectionDataStore resource.
313
+ *
314
+ * @param {string} projectLocationCollectionDataStoreName
315
+ * A fully-qualified path representing project_location_collection_data_store resource.
316
+ * @returns {string} A string representing the data_store.
317
+ */
318
+ matchDataStoreFromProjectLocationCollectionDataStoreName(projectLocationCollectionDataStoreName) {
319
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match(projectLocationCollectionDataStoreName).data_store;
320
+ }
321
+ /**
322
+ * Return a fully-qualified projectLocationCollectionDataStoreBranchDocument resource name string.
323
+ *
324
+ * @param {string} project
325
+ * @param {string} location
326
+ * @param {string} collection
327
+ * @param {string} data_store
328
+ * @param {string} branch
329
+ * @param {string} document
330
+ * @returns {string} Resource name string.
331
+ */
332
+ projectLocationCollectionDataStoreBranchDocumentPath(project, location, collection, dataStore, branch, document) {
333
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.render({
334
+ project: project,
335
+ location: location,
336
+ collection: collection,
337
+ data_store: dataStore,
338
+ branch: branch,
339
+ document: document,
340
+ });
341
+ }
342
+ /**
343
+ * Parse the project from ProjectLocationCollectionDataStoreBranchDocument resource.
344
+ *
345
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
346
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
347
+ * @returns {string} A string representing the project.
348
+ */
349
+ matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
350
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).project;
351
+ }
352
+ /**
353
+ * Parse the location from ProjectLocationCollectionDataStoreBranchDocument resource.
354
+ *
355
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
356
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
357
+ * @returns {string} A string representing the location.
358
+ */
359
+ matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
360
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).location;
361
+ }
362
+ /**
363
+ * Parse the collection from ProjectLocationCollectionDataStoreBranchDocument resource.
364
+ *
365
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
366
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
367
+ * @returns {string} A string representing the collection.
368
+ */
369
+ matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
370
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).collection;
371
+ }
372
+ /**
373
+ * Parse the data_store from ProjectLocationCollectionDataStoreBranchDocument resource.
374
+ *
375
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
376
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
377
+ * @returns {string} A string representing the data_store.
378
+ */
379
+ matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
380
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).data_store;
381
+ }
382
+ /**
383
+ * Parse the branch from ProjectLocationCollectionDataStoreBranchDocument resource.
384
+ *
385
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
386
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
387
+ * @returns {string} A string representing the branch.
388
+ */
389
+ matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
390
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).branch;
391
+ }
392
+ /**
393
+ * Parse the document from ProjectLocationCollectionDataStoreBranchDocument resource.
394
+ *
395
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
396
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
397
+ * @returns {string} A string representing the document.
398
+ */
399
+ matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
400
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).document;
401
+ }
402
+ /**
403
+ * Return a fully-qualified projectLocationCollectionDataStoreSchema resource name string.
404
+ *
405
+ * @param {string} project
406
+ * @param {string} location
407
+ * @param {string} collection
408
+ * @param {string} data_store
409
+ * @param {string} schema
410
+ * @returns {string} Resource name string.
411
+ */
412
+ projectLocationCollectionDataStoreSchemaPath(project, location, collection, dataStore, schema) {
413
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.render({
414
+ project: project,
415
+ location: location,
416
+ collection: collection,
417
+ data_store: dataStore,
418
+ schema: schema,
419
+ });
420
+ }
421
+ /**
422
+ * Parse the project from ProjectLocationCollectionDataStoreSchema resource.
423
+ *
424
+ * @param {string} projectLocationCollectionDataStoreSchemaName
425
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
426
+ * @returns {string} A string representing the project.
427
+ */
428
+ matchProjectFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
429
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).project;
430
+ }
431
+ /**
432
+ * Parse the location from ProjectLocationCollectionDataStoreSchema resource.
433
+ *
434
+ * @param {string} projectLocationCollectionDataStoreSchemaName
435
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
436
+ * @returns {string} A string representing the location.
437
+ */
438
+ matchLocationFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
439
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).location;
440
+ }
441
+ /**
442
+ * Parse the collection from ProjectLocationCollectionDataStoreSchema resource.
443
+ *
444
+ * @param {string} projectLocationCollectionDataStoreSchemaName
445
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
446
+ * @returns {string} A string representing the collection.
447
+ */
448
+ matchCollectionFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
449
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).collection;
450
+ }
451
+ /**
452
+ * Parse the data_store from ProjectLocationCollectionDataStoreSchema resource.
453
+ *
454
+ * @param {string} projectLocationCollectionDataStoreSchemaName
455
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
456
+ * @returns {string} A string representing the data_store.
457
+ */
458
+ matchDataStoreFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
459
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).data_store;
460
+ }
461
+ /**
462
+ * Parse the schema from ProjectLocationCollectionDataStoreSchema resource.
463
+ *
464
+ * @param {string} projectLocationCollectionDataStoreSchemaName
465
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
466
+ * @returns {string} A string representing the schema.
467
+ */
468
+ matchSchemaFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
469
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).schema;
470
+ }
471
+ /**
472
+ * Return a fully-qualified projectLocationDataStore resource name string.
473
+ *
474
+ * @param {string} project
475
+ * @param {string} location
476
+ * @param {string} data_store
477
+ * @returns {string} Resource name string.
478
+ */
479
+ projectLocationDataStorePath(project, location, dataStore) {
480
+ return this.pathTemplates.projectLocationDataStorePathTemplate.render({
481
+ project: project,
482
+ location: location,
483
+ data_store: dataStore,
484
+ });
485
+ }
486
+ /**
487
+ * Parse the project from ProjectLocationDataStore resource.
488
+ *
489
+ * @param {string} projectLocationDataStoreName
490
+ * A fully-qualified path representing project_location_data_store resource.
491
+ * @returns {string} A string representing the project.
492
+ */
493
+ matchProjectFromProjectLocationDataStoreName(projectLocationDataStoreName) {
494
+ return this.pathTemplates.projectLocationDataStorePathTemplate.match(projectLocationDataStoreName).project;
495
+ }
496
+ /**
497
+ * Parse the location from ProjectLocationDataStore resource.
498
+ *
499
+ * @param {string} projectLocationDataStoreName
500
+ * A fully-qualified path representing project_location_data_store resource.
501
+ * @returns {string} A string representing the location.
502
+ */
503
+ matchLocationFromProjectLocationDataStoreName(projectLocationDataStoreName) {
504
+ return this.pathTemplates.projectLocationDataStorePathTemplate.match(projectLocationDataStoreName).location;
505
+ }
506
+ /**
507
+ * Parse the data_store from ProjectLocationDataStore resource.
508
+ *
509
+ * @param {string} projectLocationDataStoreName
510
+ * A fully-qualified path representing project_location_data_store resource.
511
+ * @returns {string} A string representing the data_store.
512
+ */
513
+ matchDataStoreFromProjectLocationDataStoreName(projectLocationDataStoreName) {
514
+ return this.pathTemplates.projectLocationDataStorePathTemplate.match(projectLocationDataStoreName).data_store;
515
+ }
516
+ /**
517
+ * Return a fully-qualified projectLocationDataStoreBranchDocument resource name string.
518
+ *
519
+ * @param {string} project
520
+ * @param {string} location
521
+ * @param {string} data_store
522
+ * @param {string} branch
523
+ * @param {string} document
524
+ * @returns {string} Resource name string.
525
+ */
526
+ projectLocationDataStoreBranchDocumentPath(project, location, dataStore, branch, document) {
527
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.render({
528
+ project: project,
529
+ location: location,
530
+ data_store: dataStore,
531
+ branch: branch,
532
+ document: document,
533
+ });
534
+ }
535
+ /**
536
+ * Parse the project from ProjectLocationDataStoreBranchDocument resource.
537
+ *
538
+ * @param {string} projectLocationDataStoreBranchDocumentName
539
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
540
+ * @returns {string} A string representing the project.
541
+ */
542
+ matchProjectFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
543
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).project;
544
+ }
545
+ /**
546
+ * Parse the location from ProjectLocationDataStoreBranchDocument resource.
547
+ *
548
+ * @param {string} projectLocationDataStoreBranchDocumentName
549
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
550
+ * @returns {string} A string representing the location.
551
+ */
552
+ matchLocationFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
553
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).location;
554
+ }
555
+ /**
556
+ * Parse the data_store from ProjectLocationDataStoreBranchDocument resource.
557
+ *
558
+ * @param {string} projectLocationDataStoreBranchDocumentName
559
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
560
+ * @returns {string} A string representing the data_store.
561
+ */
562
+ matchDataStoreFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
563
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).data_store;
564
+ }
565
+ /**
566
+ * Parse the branch from ProjectLocationDataStoreBranchDocument resource.
567
+ *
568
+ * @param {string} projectLocationDataStoreBranchDocumentName
569
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
570
+ * @returns {string} A string representing the branch.
571
+ */
572
+ matchBranchFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
573
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).branch;
574
+ }
575
+ /**
576
+ * Parse the document from ProjectLocationDataStoreBranchDocument resource.
577
+ *
578
+ * @param {string} projectLocationDataStoreBranchDocumentName
579
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
580
+ * @returns {string} A string representing the document.
581
+ */
582
+ matchDocumentFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
583
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).document;
584
+ }
585
+ /**
586
+ * Return a fully-qualified projectLocationDataStoreSchema resource name string.
587
+ *
588
+ * @param {string} project
589
+ * @param {string} location
590
+ * @param {string} data_store
591
+ * @param {string} schema
592
+ * @returns {string} Resource name string.
593
+ */
594
+ projectLocationDataStoreSchemaPath(project, location, dataStore, schema) {
595
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.render({
596
+ project: project,
597
+ location: location,
598
+ data_store: dataStore,
599
+ schema: schema,
600
+ });
601
+ }
602
+ /**
603
+ * Parse the project from ProjectLocationDataStoreSchema resource.
604
+ *
605
+ * @param {string} projectLocationDataStoreSchemaName
606
+ * A fully-qualified path representing project_location_data_store_schema resource.
607
+ * @returns {string} A string representing the project.
608
+ */
609
+ matchProjectFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
610
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).project;
611
+ }
612
+ /**
613
+ * Parse the location from ProjectLocationDataStoreSchema resource.
614
+ *
615
+ * @param {string} projectLocationDataStoreSchemaName
616
+ * A fully-qualified path representing project_location_data_store_schema resource.
617
+ * @returns {string} A string representing the location.
618
+ */
619
+ matchLocationFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
620
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).location;
621
+ }
622
+ /**
623
+ * Parse the data_store from ProjectLocationDataStoreSchema resource.
624
+ *
625
+ * @param {string} projectLocationDataStoreSchemaName
626
+ * A fully-qualified path representing project_location_data_store_schema resource.
627
+ * @returns {string} A string representing the data_store.
628
+ */
629
+ matchDataStoreFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
630
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).data_store;
631
+ }
632
+ /**
633
+ * Parse the schema from ProjectLocationDataStoreSchema resource.
634
+ *
635
+ * @param {string} projectLocationDataStoreSchemaName
636
+ * A fully-qualified path representing project_location_data_store_schema resource.
637
+ * @returns {string} A string representing the schema.
638
+ */
639
+ matchSchemaFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
640
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).schema;
641
+ }
642
+ /**
643
+ * Terminate the gRPC channel and close the client.
644
+ *
645
+ * The client will no longer be usable and all future behavior is undefined.
646
+ * @returns {Promise} A promise that resolves when the client is closed.
647
+ */
648
+ close() {
649
+ if (this.completionServiceStub && !this._terminated) {
650
+ return this.completionServiceStub.then(stub => {
651
+ this._terminated = true;
652
+ stub.close();
653
+ });
654
+ }
655
+ return Promise.resolve();
656
+ }
657
+ }
658
+ exports.CompletionServiceClient = CompletionServiceClient;
659
+ //# sourceMappingURL=completion_service_client.js.map