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