@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,1129 @@
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.SchemaServiceClient = void 0;
21
+ const jsonProtos = require("../../protos/protos.json");
22
+ /**
23
+ * Client JSON configuration object, loaded from
24
+ * `src/v1/schema_service_client_config.json`.
25
+ * This file defines retry strategy and timeouts for all API methods in this library.
26
+ */
27
+ const gapicConfig = require("./schema_service_client_config.json");
28
+ const version = require('../../../package.json').version;
29
+ /**
30
+ * Service for managing {@link google.cloud.discoveryengine.v1.Schema|Schema}s.
31
+ * @class
32
+ * @memberof v1
33
+ */
34
+ class SchemaServiceClient {
35
+ /**
36
+ * Construct an instance of SchemaServiceClient.
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 SchemaServiceClient({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
+ // Some of the methods on this service return "paged" results,
149
+ // (e.g. 50 results at a time, with tokens to get subsequent
150
+ // pages). Denote the keys used for pagination and results.
151
+ this.descriptors.page = {
152
+ listSchemas: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'schemas'),
153
+ };
154
+ const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
155
+ // This API contains "long-running operations", which return a
156
+ // an Operation object that allows for tracking of the operation,
157
+ // rather than holding a request open.
158
+ const lroOptions = {
159
+ auth: this.auth,
160
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
161
+ };
162
+ if (opts.fallback === 'rest') {
163
+ lroOptions.protoJson = protoFilesRoot;
164
+ lroOptions.httpRules = [
165
+ {
166
+ selector: 'google.longrunning.Operations.GetOperation',
167
+ get: '/v1/{name=projects/*/operations/*}',
168
+ additional_bindings: [
169
+ {
170
+ get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}',
171
+ },
172
+ {
173
+ get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}',
174
+ },
175
+ {
176
+ get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}',
177
+ },
178
+ {
179
+ get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}',
180
+ },
181
+ {
182
+ get: '/v1/{name=projects/*/locations/*/collections/*/operations/*}',
183
+ },
184
+ {
185
+ get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}',
186
+ },
187
+ {
188
+ get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}',
189
+ },
190
+ {
191
+ get: '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}',
192
+ },
193
+ { get: '/v1/{name=projects/*/locations/*/operations/*}' },
194
+ { get: '/v1/{name=projects/*/operations/*}' },
195
+ ],
196
+ },
197
+ {
198
+ selector: 'google.longrunning.Operations.ListOperations',
199
+ get: '/v1/{name=projects/*}/operations',
200
+ additional_bindings: [
201
+ {
202
+ get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations',
203
+ },
204
+ {
205
+ get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations',
206
+ },
207
+ {
208
+ get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations',
209
+ },
210
+ {
211
+ get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations',
212
+ },
213
+ { get: '/v1/{name=projects/*/locations/*/collections/*}/operations' },
214
+ {
215
+ get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations',
216
+ },
217
+ {
218
+ get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations',
219
+ },
220
+ { get: '/v1/{name=projects/*/locations/*/dataStores/*}/operations' },
221
+ { get: '/v1/{name=projects/*/locations/*}/operations' },
222
+ { get: '/v1/{name=projects/*}/operations' },
223
+ ],
224
+ },
225
+ ];
226
+ }
227
+ this.operationsClient = this._gaxModule
228
+ .lro(lroOptions)
229
+ .operationsClient(opts);
230
+ const createSchemaResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.Schema');
231
+ const createSchemaMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.CreateSchemaMetadata');
232
+ const updateSchemaResponse = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.Schema');
233
+ const updateSchemaMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.UpdateSchemaMetadata');
234
+ const deleteSchemaResponse = protoFilesRoot.lookup('.google.protobuf.Empty');
235
+ const deleteSchemaMetadata = protoFilesRoot.lookup('.google.cloud.discoveryengine.v1.DeleteSchemaMetadata');
236
+ this.descriptors.longrunning = {
237
+ createSchema: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createSchemaResponse.decode.bind(createSchemaResponse), createSchemaMetadata.decode.bind(createSchemaMetadata)),
238
+ updateSchema: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateSchemaResponse.decode.bind(updateSchemaResponse), updateSchemaMetadata.decode.bind(updateSchemaMetadata)),
239
+ deleteSchema: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteSchemaResponse.decode.bind(deleteSchemaResponse), deleteSchemaMetadata.decode.bind(deleteSchemaMetadata)),
240
+ };
241
+ // Put together the default options sent with requests.
242
+ this._defaults = this._gaxGrpc.constructSettings('google.cloud.discoveryengine.v1.SchemaService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
243
+ // Set up a dictionary of "inner API calls"; the core implementation
244
+ // of calling the API is handled in `google-gax`, with this code
245
+ // merely providing the destination and request information.
246
+ this.innerApiCalls = {};
247
+ // Add a warn function to the client constructor so it can be easily tested.
248
+ this.warn = this._gaxModule.warn;
249
+ }
250
+ /**
251
+ * Initialize the client.
252
+ * Performs asynchronous operations (such as authentication) and prepares the client.
253
+ * This function will be called automatically when any class method is called for the
254
+ * first time, but if you need to initialize it before calling an actual method,
255
+ * feel free to call initialize() directly.
256
+ *
257
+ * You can await on this method if you want to make sure the client is initialized.
258
+ *
259
+ * @returns {Promise} A promise that resolves to an authenticated service stub.
260
+ */
261
+ initialize() {
262
+ // If the client stub promise is already initialized, return immediately.
263
+ if (this.schemaServiceStub) {
264
+ return this.schemaServiceStub;
265
+ }
266
+ // Put together the "service stub" for
267
+ // google.cloud.discoveryengine.v1.SchemaService.
268
+ this.schemaServiceStub = this._gaxGrpc.createStub(this._opts.fallback
269
+ ? this._protos.lookupService('google.cloud.discoveryengine.v1.SchemaService')
270
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any
271
+ this._protos.google.cloud.discoveryengine.v1.SchemaService, this._opts, this._providedCustomServicePath);
272
+ // Iterate over each of the methods that the service provides
273
+ // and create an API call method for each.
274
+ const schemaServiceStubMethods = [
275
+ 'getSchema',
276
+ 'listSchemas',
277
+ 'createSchema',
278
+ 'updateSchema',
279
+ 'deleteSchema',
280
+ ];
281
+ for (const methodName of schemaServiceStubMethods) {
282
+ const callPromise = this.schemaServiceStub.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.schemaServiceStub;
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
+ getSchema(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.getSchema(request, options, callback);
360
+ }
361
+ createSchema(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.createSchema(request, options, callback);
381
+ }
382
+ /**
383
+ * Check the status of the long running operation returned by `createSchema()`.
384
+ * @param {String} name
385
+ * The operation name that will be passed.
386
+ * @returns {Promise} - The promise which resolves to an object.
387
+ * The decoded operation object has result and metadata field to get information from.
388
+ * Please see the
389
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
390
+ * for more details and examples.
391
+ * @example <caption>include:samples/generated/v1/schema_service.create_schema.js</caption>
392
+ * region_tag:discoveryengine_v1_generated_SchemaService_CreateSchema_async
393
+ */
394
+ async checkCreateSchemaProgress(name) {
395
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
396
+ const [operation] = await this.operationsClient.getOperation(request);
397
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSchema, this._gaxModule.createDefaultBackoffSettings());
398
+ return decodeOperation;
399
+ }
400
+ updateSchema(request, optionsOrCallback, callback) {
401
+ var _a;
402
+ request = request || {};
403
+ let options;
404
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
405
+ callback = optionsOrCallback;
406
+ options = {};
407
+ }
408
+ else {
409
+ options = optionsOrCallback;
410
+ }
411
+ options = options || {};
412
+ options.otherArgs = options.otherArgs || {};
413
+ options.otherArgs.headers = options.otherArgs.headers || {};
414
+ options.otherArgs.headers['x-goog-request-params'] =
415
+ this._gaxModule.routingHeader.fromParams({
416
+ 'schema.name': (_a = request.schema.name) !== null && _a !== void 0 ? _a : '',
417
+ });
418
+ this.initialize();
419
+ return this.innerApiCalls.updateSchema(request, options, callback);
420
+ }
421
+ /**
422
+ * Check the status of the long running operation returned by `updateSchema()`.
423
+ * @param {String} name
424
+ * The operation name that will be passed.
425
+ * @returns {Promise} - The promise which resolves to an object.
426
+ * The decoded operation object has result and metadata field to get information from.
427
+ * Please see the
428
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
429
+ * for more details and examples.
430
+ * @example <caption>include:samples/generated/v1/schema_service.update_schema.js</caption>
431
+ * region_tag:discoveryengine_v1_generated_SchemaService_UpdateSchema_async
432
+ */
433
+ async checkUpdateSchemaProgress(name) {
434
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
435
+ const [operation] = await this.operationsClient.getOperation(request);
436
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateSchema, this._gaxModule.createDefaultBackoffSettings());
437
+ return decodeOperation;
438
+ }
439
+ deleteSchema(request, optionsOrCallback, callback) {
440
+ var _a;
441
+ request = request || {};
442
+ let options;
443
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
444
+ callback = optionsOrCallback;
445
+ options = {};
446
+ }
447
+ else {
448
+ options = optionsOrCallback;
449
+ }
450
+ options = options || {};
451
+ options.otherArgs = options.otherArgs || {};
452
+ options.otherArgs.headers = options.otherArgs.headers || {};
453
+ options.otherArgs.headers['x-goog-request-params'] =
454
+ this._gaxModule.routingHeader.fromParams({
455
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
456
+ });
457
+ this.initialize();
458
+ return this.innerApiCalls.deleteSchema(request, options, callback);
459
+ }
460
+ /**
461
+ * Check the status of the long running operation returned by `deleteSchema()`.
462
+ * @param {String} name
463
+ * The operation name that will be passed.
464
+ * @returns {Promise} - The promise which resolves to an object.
465
+ * The decoded operation object has result and metadata field to get information from.
466
+ * Please see the
467
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
468
+ * for more details and examples.
469
+ * @example <caption>include:samples/generated/v1/schema_service.delete_schema.js</caption>
470
+ * region_tag:discoveryengine_v1_generated_SchemaService_DeleteSchema_async
471
+ */
472
+ async checkDeleteSchemaProgress(name) {
473
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
474
+ const [operation] = await this.operationsClient.getOperation(request);
475
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteSchema, this._gaxModule.createDefaultBackoffSettings());
476
+ return decodeOperation;
477
+ }
478
+ listSchemas(request, optionsOrCallback, callback) {
479
+ var _a;
480
+ request = request || {};
481
+ let options;
482
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
483
+ callback = optionsOrCallback;
484
+ options = {};
485
+ }
486
+ else {
487
+ options = optionsOrCallback;
488
+ }
489
+ options = options || {};
490
+ options.otherArgs = options.otherArgs || {};
491
+ options.otherArgs.headers = options.otherArgs.headers || {};
492
+ options.otherArgs.headers['x-goog-request-params'] =
493
+ this._gaxModule.routingHeader.fromParams({
494
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
495
+ });
496
+ this.initialize();
497
+ return this.innerApiCalls.listSchemas(request, options, callback);
498
+ }
499
+ /**
500
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
501
+ * @param {Object} request
502
+ * The request object that will be sent.
503
+ * @param {string} request.parent
504
+ * Required. The parent data store resource name, in the format of
505
+ * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
506
+ * @param {number} request.pageSize
507
+ * The maximum number of {@link google.cloud.discoveryengine.v1.Schema|Schema}s to
508
+ * return. The service may return fewer than this value.
509
+ *
510
+ * If unspecified, at most 100
511
+ * {@link google.cloud.discoveryengine.v1.Schema|Schema}s will be returned.
512
+ *
513
+ * The maximum value is 1000; values above 1000 will be coerced to 1000.
514
+ * @param {string} request.pageToken
515
+ * A page token, received from a previous
516
+ * {@link google.cloud.discoveryengine.v1.SchemaService.ListSchemas|SchemaService.ListSchemas}
517
+ * call. Provide this to retrieve the subsequent page.
518
+ *
519
+ * When paginating, all other parameters provided to
520
+ * {@link google.cloud.discoveryengine.v1.SchemaService.ListSchemas|SchemaService.ListSchemas}
521
+ * must match the call that provided the page token.
522
+ * @param {object} [options]
523
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
524
+ * @returns {Stream}
525
+ * An object stream which emits an object representing {@link google.cloud.discoveryengine.v1.Schema | Schema} on 'data' event.
526
+ * The client library will perform auto-pagination by default: it will call the API as many
527
+ * times as needed. Note that it can affect your quota.
528
+ * We recommend using `listSchemasAsync()`
529
+ * method described below for async iteration which you can stop as needed.
530
+ * Please see the
531
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
532
+ * for more details and examples.
533
+ */
534
+ listSchemasStream(request, options) {
535
+ var _a;
536
+ request = request || {};
537
+ options = options || {};
538
+ options.otherArgs = options.otherArgs || {};
539
+ options.otherArgs.headers = options.otherArgs.headers || {};
540
+ options.otherArgs.headers['x-goog-request-params'] =
541
+ this._gaxModule.routingHeader.fromParams({
542
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
543
+ });
544
+ const defaultCallSettings = this._defaults['listSchemas'];
545
+ const callSettings = defaultCallSettings.merge(options);
546
+ this.initialize();
547
+ return this.descriptors.page.listSchemas.createStream(this.innerApiCalls.listSchemas, request, callSettings);
548
+ }
549
+ /**
550
+ * Equivalent to `listSchemas`, but returns an iterable object.
551
+ *
552
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
553
+ * @param {Object} request
554
+ * The request object that will be sent.
555
+ * @param {string} request.parent
556
+ * Required. The parent data store resource name, in the format of
557
+ * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
558
+ * @param {number} request.pageSize
559
+ * The maximum number of {@link google.cloud.discoveryengine.v1.Schema|Schema}s to
560
+ * return. The service may return fewer than this value.
561
+ *
562
+ * If unspecified, at most 100
563
+ * {@link google.cloud.discoveryengine.v1.Schema|Schema}s will be returned.
564
+ *
565
+ * The maximum value is 1000; values above 1000 will be coerced to 1000.
566
+ * @param {string} request.pageToken
567
+ * A page token, received from a previous
568
+ * {@link google.cloud.discoveryengine.v1.SchemaService.ListSchemas|SchemaService.ListSchemas}
569
+ * call. Provide this to retrieve the subsequent page.
570
+ *
571
+ * When paginating, all other parameters provided to
572
+ * {@link google.cloud.discoveryengine.v1.SchemaService.ListSchemas|SchemaService.ListSchemas}
573
+ * must match the call that provided the page token.
574
+ * @param {object} [options]
575
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
576
+ * @returns {Object}
577
+ * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
578
+ * When you iterate the returned iterable, each element will be an object representing
579
+ * {@link google.cloud.discoveryengine.v1.Schema | Schema}. The API will be called under the hood as needed, once per the page,
580
+ * so you can stop the iteration when you don't need more results.
581
+ * Please see the
582
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
583
+ * for more details and examples.
584
+ * @example <caption>include:samples/generated/v1/schema_service.list_schemas.js</caption>
585
+ * region_tag:discoveryengine_v1_generated_SchemaService_ListSchemas_async
586
+ */
587
+ listSchemasAsync(request, options) {
588
+ var _a;
589
+ request = request || {};
590
+ options = options || {};
591
+ options.otherArgs = options.otherArgs || {};
592
+ options.otherArgs.headers = options.otherArgs.headers || {};
593
+ options.otherArgs.headers['x-goog-request-params'] =
594
+ this._gaxModule.routingHeader.fromParams({
595
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
596
+ });
597
+ const defaultCallSettings = this._defaults['listSchemas'];
598
+ const callSettings = defaultCallSettings.merge(options);
599
+ this.initialize();
600
+ return this.descriptors.page.listSchemas.asyncIterate(this.innerApiCalls['listSchemas'], request, callSettings);
601
+ }
602
+ /**
603
+ * Gets the latest state of a long-running operation. Clients can use this
604
+ * method to poll the operation result at intervals as recommended by the API
605
+ * service.
606
+ *
607
+ * @param {Object} request - The request object that will be sent.
608
+ * @param {string} request.name - The name of the operation resource.
609
+ * @param {Object=} options
610
+ * Optional parameters. You can override the default settings for this call,
611
+ * e.g, timeout, retries, paginations, etc. See {@link
612
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
613
+ * for the details.
614
+ * @param {function(?Error, ?Object)=} callback
615
+ * The function which will be called with the result of the API call.
616
+ *
617
+ * The second parameter to the callback is an object representing
618
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
619
+ * @return {Promise} - The promise which resolves to an array.
620
+ * The first element of the array is an object representing
621
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
622
+ * The promise has a method named "cancel" which cancels the ongoing API call.
623
+ *
624
+ * @example
625
+ * ```
626
+ * const client = longrunning.operationsClient();
627
+ * const name = '';
628
+ * const [response] = await client.getOperation({name});
629
+ * // doThingsWith(response)
630
+ * ```
631
+ */
632
+ getOperation(request, options, callback) {
633
+ return this.operationsClient.getOperation(request, options, callback);
634
+ }
635
+ /**
636
+ * Lists operations that match the specified filter in the request. If the
637
+ * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
638
+ *
639
+ * For-await-of syntax is used with the iterable to recursively get response element on-demand.
640
+ *
641
+ * @param {Object} request - The request object that will be sent.
642
+ * @param {string} request.name - The name of the operation collection.
643
+ * @param {string} request.filter - The standard list filter.
644
+ * @param {number=} request.pageSize -
645
+ * The maximum number of resources contained in the underlying API
646
+ * response. If page streaming is performed per-resource, this
647
+ * parameter does not affect the return value. If page streaming is
648
+ * performed per-page, this determines the maximum number of
649
+ * resources in a page.
650
+ * @param {Object=} options
651
+ * Optional parameters. You can override the default settings for this call,
652
+ * e.g, timeout, retries, paginations, etc. See {@link
653
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
654
+ * details.
655
+ * @returns {Object}
656
+ * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}.
657
+ *
658
+ * @example
659
+ * ```
660
+ * const client = longrunning.operationsClient();
661
+ * for await (const response of client.listOperationsAsync(request));
662
+ * // doThingsWith(response)
663
+ * ```
664
+ */
665
+ listOperationsAsync(request, options) {
666
+ return this.operationsClient.listOperationsAsync(request, options);
667
+ }
668
+ /**
669
+ * Starts asynchronous cancellation on a long-running operation. The server
670
+ * makes a best effort to cancel the operation, but success is not
671
+ * guaranteed. If the server doesn't support this method, it returns
672
+ * `google.rpc.Code.UNIMPLEMENTED`. Clients can use
673
+ * {@link Operations.GetOperation} or
674
+ * other methods to check whether the cancellation succeeded or whether the
675
+ * operation completed despite cancellation. On successful cancellation,
676
+ * the operation is not deleted; instead, it becomes an operation with
677
+ * an {@link Operation.error} value with a {@link google.rpc.Status.code} of
678
+ * 1, corresponding to `Code.CANCELLED`.
679
+ *
680
+ * @param {Object} request - The request object that will be sent.
681
+ * @param {string} request.name - The name of the operation resource to be cancelled.
682
+ * @param {Object=} options
683
+ * Optional parameters. You can override the default settings for this call,
684
+ * e.g, timeout, retries, paginations, etc. See {@link
685
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
686
+ * details.
687
+ * @param {function(?Error)=} callback
688
+ * The function which will be called with the result of the API call.
689
+ * @return {Promise} - The promise which resolves when API call finishes.
690
+ * The promise has a method named "cancel" which cancels the ongoing API
691
+ * call.
692
+ *
693
+ * @example
694
+ * ```
695
+ * const client = longrunning.operationsClient();
696
+ * await client.cancelOperation({name: ''});
697
+ * ```
698
+ */
699
+ cancelOperation(request, options, callback) {
700
+ return this.operationsClient.cancelOperation(request, options, callback);
701
+ }
702
+ /**
703
+ * Deletes a long-running operation. This method indicates that the client is
704
+ * no longer interested in the operation result. It does not cancel the
705
+ * operation. If the server doesn't support this method, it returns
706
+ * `google.rpc.Code.UNIMPLEMENTED`.
707
+ *
708
+ * @param {Object} request - The request object that will be sent.
709
+ * @param {string} request.name - The name of the operation resource to be deleted.
710
+ * @param {Object=} options
711
+ * Optional parameters. You can override the default settings for this call,
712
+ * e.g, timeout, retries, paginations, etc. See {@link
713
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
714
+ * for the details.
715
+ * @param {function(?Error)=} callback
716
+ * The function which will be called with the result of the API call.
717
+ * @return {Promise} - The promise which resolves when API call finishes.
718
+ * The promise has a method named "cancel" which cancels the ongoing API
719
+ * call.
720
+ *
721
+ * @example
722
+ * ```
723
+ * const client = longrunning.operationsClient();
724
+ * await client.deleteOperation({name: ''});
725
+ * ```
726
+ */
727
+ deleteOperation(request, options, callback) {
728
+ return this.operationsClient.deleteOperation(request, options, callback);
729
+ }
730
+ // --------------------
731
+ // -- Path templates --
732
+ // --------------------
733
+ /**
734
+ * Return a fully-qualified projectLocationCollectionDataStore resource name string.
735
+ *
736
+ * @param {string} project
737
+ * @param {string} location
738
+ * @param {string} collection
739
+ * @param {string} data_store
740
+ * @returns {string} Resource name string.
741
+ */
742
+ projectLocationCollectionDataStorePath(project, location, collection, dataStore) {
743
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.render({
744
+ project: project,
745
+ location: location,
746
+ collection: collection,
747
+ data_store: dataStore,
748
+ });
749
+ }
750
+ /**
751
+ * Parse the project from ProjectLocationCollectionDataStore resource.
752
+ *
753
+ * @param {string} projectLocationCollectionDataStoreName
754
+ * A fully-qualified path representing project_location_collection_data_store resource.
755
+ * @returns {string} A string representing the project.
756
+ */
757
+ matchProjectFromProjectLocationCollectionDataStoreName(projectLocationCollectionDataStoreName) {
758
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match(projectLocationCollectionDataStoreName).project;
759
+ }
760
+ /**
761
+ * Parse the location from ProjectLocationCollectionDataStore resource.
762
+ *
763
+ * @param {string} projectLocationCollectionDataStoreName
764
+ * A fully-qualified path representing project_location_collection_data_store resource.
765
+ * @returns {string} A string representing the location.
766
+ */
767
+ matchLocationFromProjectLocationCollectionDataStoreName(projectLocationCollectionDataStoreName) {
768
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match(projectLocationCollectionDataStoreName).location;
769
+ }
770
+ /**
771
+ * Parse the collection from ProjectLocationCollectionDataStore resource.
772
+ *
773
+ * @param {string} projectLocationCollectionDataStoreName
774
+ * A fully-qualified path representing project_location_collection_data_store resource.
775
+ * @returns {string} A string representing the collection.
776
+ */
777
+ matchCollectionFromProjectLocationCollectionDataStoreName(projectLocationCollectionDataStoreName) {
778
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match(projectLocationCollectionDataStoreName).collection;
779
+ }
780
+ /**
781
+ * Parse the data_store from ProjectLocationCollectionDataStore resource.
782
+ *
783
+ * @param {string} projectLocationCollectionDataStoreName
784
+ * A fully-qualified path representing project_location_collection_data_store resource.
785
+ * @returns {string} A string representing the data_store.
786
+ */
787
+ matchDataStoreFromProjectLocationCollectionDataStoreName(projectLocationCollectionDataStoreName) {
788
+ return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match(projectLocationCollectionDataStoreName).data_store;
789
+ }
790
+ /**
791
+ * Return a fully-qualified projectLocationCollectionDataStoreBranchDocument resource name string.
792
+ *
793
+ * @param {string} project
794
+ * @param {string} location
795
+ * @param {string} collection
796
+ * @param {string} data_store
797
+ * @param {string} branch
798
+ * @param {string} document
799
+ * @returns {string} Resource name string.
800
+ */
801
+ projectLocationCollectionDataStoreBranchDocumentPath(project, location, collection, dataStore, branch, document) {
802
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.render({
803
+ project: project,
804
+ location: location,
805
+ collection: collection,
806
+ data_store: dataStore,
807
+ branch: branch,
808
+ document: document,
809
+ });
810
+ }
811
+ /**
812
+ * Parse the project from ProjectLocationCollectionDataStoreBranchDocument resource.
813
+ *
814
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
815
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
816
+ * @returns {string} A string representing the project.
817
+ */
818
+ matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
819
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).project;
820
+ }
821
+ /**
822
+ * Parse the location from ProjectLocationCollectionDataStoreBranchDocument resource.
823
+ *
824
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
825
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
826
+ * @returns {string} A string representing the location.
827
+ */
828
+ matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
829
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).location;
830
+ }
831
+ /**
832
+ * Parse the collection from ProjectLocationCollectionDataStoreBranchDocument resource.
833
+ *
834
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
835
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
836
+ * @returns {string} A string representing the collection.
837
+ */
838
+ matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
839
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).collection;
840
+ }
841
+ /**
842
+ * Parse the data_store from ProjectLocationCollectionDataStoreBranchDocument resource.
843
+ *
844
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
845
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
846
+ * @returns {string} A string representing the data_store.
847
+ */
848
+ matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
849
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).data_store;
850
+ }
851
+ /**
852
+ * Parse the branch from ProjectLocationCollectionDataStoreBranchDocument resource.
853
+ *
854
+ * @param {string} projectLocationCollectionDataStoreBranchDocumentName
855
+ * A fully-qualified path representing project_location_collection_data_store_branch_document resource.
856
+ * @returns {string} A string representing the branch.
857
+ */
858
+ matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
859
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).branch;
860
+ }
861
+ /**
862
+ * Parse the document 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 document.
867
+ */
868
+ matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName) {
869
+ return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match(projectLocationCollectionDataStoreBranchDocumentName).document;
870
+ }
871
+ /**
872
+ * Return a fully-qualified projectLocationCollectionDataStoreSchema resource name string.
873
+ *
874
+ * @param {string} project
875
+ * @param {string} location
876
+ * @param {string} collection
877
+ * @param {string} data_store
878
+ * @param {string} schema
879
+ * @returns {string} Resource name string.
880
+ */
881
+ projectLocationCollectionDataStoreSchemaPath(project, location, collection, dataStore, schema) {
882
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.render({
883
+ project: project,
884
+ location: location,
885
+ collection: collection,
886
+ data_store: dataStore,
887
+ schema: schema,
888
+ });
889
+ }
890
+ /**
891
+ * Parse the project from ProjectLocationCollectionDataStoreSchema resource.
892
+ *
893
+ * @param {string} projectLocationCollectionDataStoreSchemaName
894
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
895
+ * @returns {string} A string representing the project.
896
+ */
897
+ matchProjectFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
898
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).project;
899
+ }
900
+ /**
901
+ * Parse the location from ProjectLocationCollectionDataStoreSchema resource.
902
+ *
903
+ * @param {string} projectLocationCollectionDataStoreSchemaName
904
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
905
+ * @returns {string} A string representing the location.
906
+ */
907
+ matchLocationFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
908
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).location;
909
+ }
910
+ /**
911
+ * Parse the collection from ProjectLocationCollectionDataStoreSchema resource.
912
+ *
913
+ * @param {string} projectLocationCollectionDataStoreSchemaName
914
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
915
+ * @returns {string} A string representing the collection.
916
+ */
917
+ matchCollectionFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
918
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).collection;
919
+ }
920
+ /**
921
+ * Parse the data_store from ProjectLocationCollectionDataStoreSchema resource.
922
+ *
923
+ * @param {string} projectLocationCollectionDataStoreSchemaName
924
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
925
+ * @returns {string} A string representing the data_store.
926
+ */
927
+ matchDataStoreFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
928
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).data_store;
929
+ }
930
+ /**
931
+ * Parse the schema from ProjectLocationCollectionDataStoreSchema resource.
932
+ *
933
+ * @param {string} projectLocationCollectionDataStoreSchemaName
934
+ * A fully-qualified path representing project_location_collection_data_store_schema resource.
935
+ * @returns {string} A string representing the schema.
936
+ */
937
+ matchSchemaFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName) {
938
+ return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match(projectLocationCollectionDataStoreSchemaName).schema;
939
+ }
940
+ /**
941
+ * Return a fully-qualified projectLocationDataStore resource name string.
942
+ *
943
+ * @param {string} project
944
+ * @param {string} location
945
+ * @param {string} data_store
946
+ * @returns {string} Resource name string.
947
+ */
948
+ projectLocationDataStorePath(project, location, dataStore) {
949
+ return this.pathTemplates.projectLocationDataStorePathTemplate.render({
950
+ project: project,
951
+ location: location,
952
+ data_store: dataStore,
953
+ });
954
+ }
955
+ /**
956
+ * Parse the project from ProjectLocationDataStore resource.
957
+ *
958
+ * @param {string} projectLocationDataStoreName
959
+ * A fully-qualified path representing project_location_data_store resource.
960
+ * @returns {string} A string representing the project.
961
+ */
962
+ matchProjectFromProjectLocationDataStoreName(projectLocationDataStoreName) {
963
+ return this.pathTemplates.projectLocationDataStorePathTemplate.match(projectLocationDataStoreName).project;
964
+ }
965
+ /**
966
+ * Parse the location from ProjectLocationDataStore resource.
967
+ *
968
+ * @param {string} projectLocationDataStoreName
969
+ * A fully-qualified path representing project_location_data_store resource.
970
+ * @returns {string} A string representing the location.
971
+ */
972
+ matchLocationFromProjectLocationDataStoreName(projectLocationDataStoreName) {
973
+ return this.pathTemplates.projectLocationDataStorePathTemplate.match(projectLocationDataStoreName).location;
974
+ }
975
+ /**
976
+ * Parse the data_store from ProjectLocationDataStore resource.
977
+ *
978
+ * @param {string} projectLocationDataStoreName
979
+ * A fully-qualified path representing project_location_data_store resource.
980
+ * @returns {string} A string representing the data_store.
981
+ */
982
+ matchDataStoreFromProjectLocationDataStoreName(projectLocationDataStoreName) {
983
+ return this.pathTemplates.projectLocationDataStorePathTemplate.match(projectLocationDataStoreName).data_store;
984
+ }
985
+ /**
986
+ * Return a fully-qualified projectLocationDataStoreBranchDocument resource name string.
987
+ *
988
+ * @param {string} project
989
+ * @param {string} location
990
+ * @param {string} data_store
991
+ * @param {string} branch
992
+ * @param {string} document
993
+ * @returns {string} Resource name string.
994
+ */
995
+ projectLocationDataStoreBranchDocumentPath(project, location, dataStore, branch, document) {
996
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.render({
997
+ project: project,
998
+ location: location,
999
+ data_store: dataStore,
1000
+ branch: branch,
1001
+ document: document,
1002
+ });
1003
+ }
1004
+ /**
1005
+ * Parse the project from ProjectLocationDataStoreBranchDocument resource.
1006
+ *
1007
+ * @param {string} projectLocationDataStoreBranchDocumentName
1008
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
1009
+ * @returns {string} A string representing the project.
1010
+ */
1011
+ matchProjectFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
1012
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).project;
1013
+ }
1014
+ /**
1015
+ * Parse the location from ProjectLocationDataStoreBranchDocument resource.
1016
+ *
1017
+ * @param {string} projectLocationDataStoreBranchDocumentName
1018
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
1019
+ * @returns {string} A string representing the location.
1020
+ */
1021
+ matchLocationFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
1022
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).location;
1023
+ }
1024
+ /**
1025
+ * Parse the data_store from ProjectLocationDataStoreBranchDocument resource.
1026
+ *
1027
+ * @param {string} projectLocationDataStoreBranchDocumentName
1028
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
1029
+ * @returns {string} A string representing the data_store.
1030
+ */
1031
+ matchDataStoreFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
1032
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).data_store;
1033
+ }
1034
+ /**
1035
+ * Parse the branch from ProjectLocationDataStoreBranchDocument resource.
1036
+ *
1037
+ * @param {string} projectLocationDataStoreBranchDocumentName
1038
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
1039
+ * @returns {string} A string representing the branch.
1040
+ */
1041
+ matchBranchFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
1042
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).branch;
1043
+ }
1044
+ /**
1045
+ * Parse the document from ProjectLocationDataStoreBranchDocument resource.
1046
+ *
1047
+ * @param {string} projectLocationDataStoreBranchDocumentName
1048
+ * A fully-qualified path representing project_location_data_store_branch_document resource.
1049
+ * @returns {string} A string representing the document.
1050
+ */
1051
+ matchDocumentFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName) {
1052
+ return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match(projectLocationDataStoreBranchDocumentName).document;
1053
+ }
1054
+ /**
1055
+ * Return a fully-qualified projectLocationDataStoreSchema resource name string.
1056
+ *
1057
+ * @param {string} project
1058
+ * @param {string} location
1059
+ * @param {string} data_store
1060
+ * @param {string} schema
1061
+ * @returns {string} Resource name string.
1062
+ */
1063
+ projectLocationDataStoreSchemaPath(project, location, dataStore, schema) {
1064
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.render({
1065
+ project: project,
1066
+ location: location,
1067
+ data_store: dataStore,
1068
+ schema: schema,
1069
+ });
1070
+ }
1071
+ /**
1072
+ * Parse the project from ProjectLocationDataStoreSchema resource.
1073
+ *
1074
+ * @param {string} projectLocationDataStoreSchemaName
1075
+ * A fully-qualified path representing project_location_data_store_schema resource.
1076
+ * @returns {string} A string representing the project.
1077
+ */
1078
+ matchProjectFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
1079
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).project;
1080
+ }
1081
+ /**
1082
+ * Parse the location from ProjectLocationDataStoreSchema resource.
1083
+ *
1084
+ * @param {string} projectLocationDataStoreSchemaName
1085
+ * A fully-qualified path representing project_location_data_store_schema resource.
1086
+ * @returns {string} A string representing the location.
1087
+ */
1088
+ matchLocationFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
1089
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).location;
1090
+ }
1091
+ /**
1092
+ * Parse the data_store from ProjectLocationDataStoreSchema resource.
1093
+ *
1094
+ * @param {string} projectLocationDataStoreSchemaName
1095
+ * A fully-qualified path representing project_location_data_store_schema resource.
1096
+ * @returns {string} A string representing the data_store.
1097
+ */
1098
+ matchDataStoreFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
1099
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).data_store;
1100
+ }
1101
+ /**
1102
+ * Parse the schema from ProjectLocationDataStoreSchema resource.
1103
+ *
1104
+ * @param {string} projectLocationDataStoreSchemaName
1105
+ * A fully-qualified path representing project_location_data_store_schema resource.
1106
+ * @returns {string} A string representing the schema.
1107
+ */
1108
+ matchSchemaFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName) {
1109
+ return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match(projectLocationDataStoreSchemaName).schema;
1110
+ }
1111
+ /**
1112
+ * Terminate the gRPC channel and close the client.
1113
+ *
1114
+ * The client will no longer be usable and all future behavior is undefined.
1115
+ * @returns {Promise} A promise that resolves when the client is closed.
1116
+ */
1117
+ close() {
1118
+ if (this.schemaServiceStub && !this._terminated) {
1119
+ return this.schemaServiceStub.then(stub => {
1120
+ this._terminated = true;
1121
+ stub.close();
1122
+ this.operationsClient.close();
1123
+ });
1124
+ }
1125
+ return Promise.resolve();
1126
+ }
1127
+ }
1128
+ exports.SchemaServiceClient = SchemaServiceClient;
1129
+ //# sourceMappingURL=schema_service_client.js.map