@google-cloud/storage-control 0.4.0 → 0.6.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.
- package/README.md +18 -2
- package/build/protos/google/storage/control/v2/storage_control.proto +766 -1
- package/build/protos/protos.d.ts +8886 -3826
- package/build/protos/protos.js +31344 -18739
- package/build/protos/protos.json +1701 -137
- package/build/src/v2/gapic_metadata.json +164 -0
- package/build/src/v2/storage_control_client.d.ts +775 -92
- package/build/src/v2/storage_control_client.js +1178 -216
- package/build/src/v2/storage_control_client.js.map +1 -1
- package/build/src/v2/storage_control_client_config.json +82 -2
- package/package.json +4 -4
- package/CHANGELOG.md +0 -48
|
@@ -99,26 +99,17 @@ class StorageControlClient {
|
|
|
99
99
|
constructor(opts, gaxInstance) {
|
|
100
100
|
// Ensure that options include all the required fields.
|
|
101
101
|
const staticMembers = this.constructor;
|
|
102
|
-
if (opts?.universe_domain &&
|
|
103
|
-
opts?.universeDomain &&
|
|
104
|
-
opts?.universe_domain !== opts?.universeDomain) {
|
|
102
|
+
if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) {
|
|
105
103
|
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
|
106
104
|
}
|
|
107
|
-
const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
|
|
108
|
-
|
|
109
|
-
: undefined;
|
|
110
|
-
this._universeDomain =
|
|
111
|
-
opts?.universeDomain ??
|
|
112
|
-
opts?.universe_domain ??
|
|
113
|
-
universeDomainEnvVar ??
|
|
114
|
-
'googleapis.com';
|
|
105
|
+
const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
|
|
106
|
+
this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com';
|
|
115
107
|
this._servicePath = 'storage.' + this._universeDomain;
|
|
116
108
|
const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
|
|
117
109
|
this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
|
|
118
110
|
const port = opts?.port || staticMembers.port;
|
|
119
111
|
const clientConfig = opts?.clientConfig ?? {};
|
|
120
|
-
const fallback = opts?.fallback ??
|
|
121
|
-
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
|
112
|
+
const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
|
122
113
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
|
123
114
|
// Request numeric enum values if REST transport is used.
|
|
124
115
|
opts.numericEnums = true;
|
|
@@ -147,7 +138,10 @@ class StorageControlClient {
|
|
|
147
138
|
this.auth.defaultScopes = staticMembers.scopes;
|
|
148
139
|
}
|
|
149
140
|
// Determine the client header string.
|
|
150
|
-
const clientHeader = [
|
|
141
|
+
const clientHeader = [
|
|
142
|
+
`gax/${this._gaxModule.version}`,
|
|
143
|
+
`gapic/${version}`,
|
|
144
|
+
];
|
|
151
145
|
if (typeof process === 'object' && 'versions' in process) {
|
|
152
146
|
clientHeader.push(`gl-node/${process.versions.node}`);
|
|
153
147
|
}
|
|
@@ -169,10 +163,14 @@ class StorageControlClient {
|
|
|
169
163
|
// identifiers to uniquely identify resources within the API.
|
|
170
164
|
// Create useful helper objects for these.
|
|
171
165
|
this.pathTemplates = {
|
|
166
|
+
anywhereCachePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}'),
|
|
172
167
|
bucketPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/buckets/{bucket}'),
|
|
173
168
|
folderPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/buckets/{bucket}/folders/{folder=**}'),
|
|
169
|
+
folderLocationIntelligenceConfigPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/locations/{location}/intelligenceConfig'),
|
|
174
170
|
managedFolderPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}'),
|
|
171
|
+
orgLocationIntelligenceConfigPathTemplate: new this._gaxModule.PathTemplate('organizations/{org}/locations/{location}/intelligenceConfig'),
|
|
175
172
|
projectPathTemplate: new this._gaxModule.PathTemplate('projects/{project}'),
|
|
173
|
+
projectLocationIntelligenceConfigPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/intelligenceConfig'),
|
|
176
174
|
storageLayoutPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/buckets/{bucket}/storageLayout'),
|
|
177
175
|
};
|
|
178
176
|
// Some of the methods on this service return "paged" results,
|
|
@@ -181,26 +179,31 @@ class StorageControlClient {
|
|
|
181
179
|
this.descriptors.page = {
|
|
182
180
|
listFolders: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'folders'),
|
|
183
181
|
listManagedFolders: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'managedFolders'),
|
|
182
|
+
listAnywhereCaches: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'anywhereCaches')
|
|
184
183
|
};
|
|
185
|
-
const protoFilesRoot = this._gaxModule.
|
|
184
|
+
const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos);
|
|
186
185
|
// This API contains "long-running operations", which return a
|
|
187
186
|
// an Operation object that allows for tracking of the operation,
|
|
188
187
|
// rather than holding a request open.
|
|
189
188
|
const lroOptions = {
|
|
190
189
|
auth: this.auth,
|
|
191
|
-
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
|
|
190
|
+
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined
|
|
192
191
|
};
|
|
193
192
|
if (opts.fallback) {
|
|
194
193
|
lroOptions.protoJson = protoFilesRoot;
|
|
195
194
|
lroOptions.httpRules = [];
|
|
196
195
|
}
|
|
197
|
-
this.operationsClient = this._gaxModule
|
|
198
|
-
.lro(lroOptions)
|
|
199
|
-
.operationsClient(opts);
|
|
196
|
+
this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts);
|
|
200
197
|
const renameFolderResponse = protoFilesRoot.lookup('.google.storage.control.v2.Folder');
|
|
201
198
|
const renameFolderMetadata = protoFilesRoot.lookup('.google.storage.control.v2.RenameFolderMetadata');
|
|
199
|
+
const createAnywhereCacheResponse = protoFilesRoot.lookup('.google.storage.control.v2.AnywhereCache');
|
|
200
|
+
const createAnywhereCacheMetadata = protoFilesRoot.lookup('.google.storage.control.v2.CreateAnywhereCacheMetadata');
|
|
201
|
+
const updateAnywhereCacheResponse = protoFilesRoot.lookup('.google.storage.control.v2.AnywhereCache');
|
|
202
|
+
const updateAnywhereCacheMetadata = protoFilesRoot.lookup('.google.storage.control.v2.UpdateAnywhereCacheMetadata');
|
|
202
203
|
this.descriptors.longrunning = {
|
|
203
204
|
renameFolder: new this._gaxModule.LongrunningDescriptor(this.operationsClient, renameFolderResponse.decode.bind(renameFolderResponse), renameFolderMetadata.decode.bind(renameFolderMetadata)),
|
|
205
|
+
createAnywhereCache: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createAnywhereCacheResponse.decode.bind(createAnywhereCacheResponse), createAnywhereCacheMetadata.decode.bind(createAnywhereCacheMetadata)),
|
|
206
|
+
updateAnywhereCache: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateAnywhereCacheResponse.decode.bind(updateAnywhereCacheResponse), updateAnywhereCacheMetadata.decode.bind(updateAnywhereCacheMetadata))
|
|
204
207
|
};
|
|
205
208
|
// Put together the default options sent with requests.
|
|
206
209
|
this._defaults = this._gaxGrpc.constructSettings('google.storage.control.v2.StorageControl', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
|
@@ -229,24 +232,13 @@ class StorageControlClient {
|
|
|
229
232
|
}
|
|
230
233
|
// Put together the "service stub" for
|
|
231
234
|
// google.storage.control.v2.StorageControl.
|
|
232
|
-
this.storageControlStub = this._gaxGrpc.createStub(this._opts.fallback
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
235
|
+
this.storageControlStub = this._gaxGrpc.createStub(this._opts.fallback ?
|
|
236
|
+
this._protos.lookupService('google.storage.control.v2.StorageControl') :
|
|
237
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
238
|
+
this._protos.google.storage.control.v2.StorageControl, this._opts, this._providedCustomServicePath);
|
|
236
239
|
// Iterate over each of the methods that the service provides
|
|
237
240
|
// and create an API call method for each.
|
|
238
|
-
const storageControlStubMethods = [
|
|
239
|
-
'createFolder',
|
|
240
|
-
'deleteFolder',
|
|
241
|
-
'getFolder',
|
|
242
|
-
'listFolders',
|
|
243
|
-
'renameFolder',
|
|
244
|
-
'getStorageLayout',
|
|
245
|
-
'createManagedFolder',
|
|
246
|
-
'deleteManagedFolder',
|
|
247
|
-
'getManagedFolder',
|
|
248
|
-
'listManagedFolders',
|
|
249
|
-
];
|
|
241
|
+
const storageControlStubMethods = ['createFolder', 'deleteFolder', 'getFolder', 'listFolders', 'renameFolder', 'getStorageLayout', 'createManagedFolder', 'deleteManagedFolder', 'getManagedFolder', 'listManagedFolders', 'createAnywhereCache', 'updateAnywhereCache', 'disableAnywhereCache', 'pauseAnywhereCache', 'resumeAnywhereCache', 'getAnywhereCache', 'listAnywhereCaches', 'getProjectIntelligenceConfig', 'updateProjectIntelligenceConfig', 'getFolderIntelligenceConfig', 'updateFolderIntelligenceConfig', 'getOrganizationIntelligenceConfig', 'updateOrganizationIntelligenceConfig', 'getIamPolicy', 'setIamPolicy', 'testIamPermissions'];
|
|
250
242
|
for (const methodName of storageControlStubMethods) {
|
|
251
243
|
const callPromise = this.storageControlStub.then(stub => (...args) => {
|
|
252
244
|
if (this._terminated) {
|
|
@@ -271,8 +263,7 @@ class StorageControlClient {
|
|
|
271
263
|
* @returns {string} The DNS address for this service.
|
|
272
264
|
*/
|
|
273
265
|
static get servicePath() {
|
|
274
|
-
if (typeof process === 'object' &&
|
|
275
|
-
typeof process.emitWarning === 'function') {
|
|
266
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
|
276
267
|
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
277
268
|
}
|
|
278
269
|
return 'storage.googleapis.com';
|
|
@@ -283,8 +274,7 @@ class StorageControlClient {
|
|
|
283
274
|
* @returns {string} The DNS address for this service.
|
|
284
275
|
*/
|
|
285
276
|
static get apiEndpoint() {
|
|
286
|
-
if (typeof process === 'object' &&
|
|
287
|
-
typeof process.emitWarning === 'function') {
|
|
277
|
+
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
|
|
288
278
|
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
289
279
|
}
|
|
290
280
|
return 'storage.googleapis.com';
|
|
@@ -317,7 +307,7 @@ class StorageControlClient {
|
|
|
317
307
|
'https://www.googleapis.com/auth/cloud-platform.read-only',
|
|
318
308
|
'https://www.googleapis.com/auth/devstorage.full_control',
|
|
319
309
|
'https://www.googleapis.com/auth/devstorage.read_only',
|
|
320
|
-
'https://www.googleapis.com/auth/devstorage.read_write'
|
|
310
|
+
'https://www.googleapis.com/auth/devstorage.read_write'
|
|
321
311
|
];
|
|
322
312
|
}
|
|
323
313
|
/**
|
|
@@ -347,7 +337,7 @@ class StorageControlClient {
|
|
|
347
337
|
options = options || {};
|
|
348
338
|
options.otherArgs = options.otherArgs || {};
|
|
349
339
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
350
|
-
|
|
340
|
+
let routingParameter = {};
|
|
351
341
|
{
|
|
352
342
|
const fieldValue = request.parent;
|
|
353
343
|
if (fieldValue !== undefined && fieldValue !== null) {
|
|
@@ -358,11 +348,8 @@ class StorageControlClient {
|
|
|
358
348
|
}
|
|
359
349
|
}
|
|
360
350
|
}
|
|
361
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
362
|
-
|
|
363
|
-
this.initialize().catch(err => {
|
|
364
|
-
throw err;
|
|
365
|
-
});
|
|
351
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
352
|
+
this.initialize().catch(err => { throw err; });
|
|
366
353
|
this._log.info('createFolder request %j', request);
|
|
367
354
|
const wrappedCallback = callback
|
|
368
355
|
? (error, response, options, rawResponse) => {
|
|
@@ -370,11 +357,16 @@ class StorageControlClient {
|
|
|
370
357
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
371
358
|
}
|
|
372
359
|
: undefined;
|
|
373
|
-
return this.innerApiCalls
|
|
374
|
-
.createFolder(request, options, wrappedCallback)
|
|
360
|
+
return this.innerApiCalls.createFolder(request, options, wrappedCallback)
|
|
375
361
|
?.then(([response, options, rawResponse]) => {
|
|
376
362
|
this._log.info('createFolder response %j', response);
|
|
377
363
|
return [response, options, rawResponse];
|
|
364
|
+
}).catch((error) => {
|
|
365
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
366
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
367
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
368
|
+
}
|
|
369
|
+
throw error;
|
|
378
370
|
});
|
|
379
371
|
}
|
|
380
372
|
deleteFolder(request, optionsOrCallback, callback) {
|
|
@@ -393,24 +385,19 @@ class StorageControlClient {
|
|
|
393
385
|
options = options || {};
|
|
394
386
|
options.otherArgs = options.otherArgs || {};
|
|
395
387
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
396
|
-
|
|
388
|
+
let routingParameter = {};
|
|
397
389
|
{
|
|
398
390
|
const fieldValue = request.name;
|
|
399
391
|
if (fieldValue !== undefined && fieldValue !== null) {
|
|
400
|
-
const match = fieldValue
|
|
401
|
-
.toString()
|
|
402
|
-
.match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
392
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
403
393
|
if (match) {
|
|
404
394
|
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
405
395
|
Object.assign(routingParameter, { bucket: parameterValue });
|
|
406
396
|
}
|
|
407
397
|
}
|
|
408
398
|
}
|
|
409
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
410
|
-
|
|
411
|
-
this.initialize().catch(err => {
|
|
412
|
-
throw err;
|
|
413
|
-
});
|
|
399
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
400
|
+
this.initialize().catch(err => { throw err; });
|
|
414
401
|
this._log.info('deleteFolder request %j', request);
|
|
415
402
|
const wrappedCallback = callback
|
|
416
403
|
? (error, response, options, rawResponse) => {
|
|
@@ -418,11 +405,16 @@ class StorageControlClient {
|
|
|
418
405
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
419
406
|
}
|
|
420
407
|
: undefined;
|
|
421
|
-
return this.innerApiCalls
|
|
422
|
-
.deleteFolder(request, options, wrappedCallback)
|
|
408
|
+
return this.innerApiCalls.deleteFolder(request, options, wrappedCallback)
|
|
423
409
|
?.then(([response, options, rawResponse]) => {
|
|
424
410
|
this._log.info('deleteFolder response %j', response);
|
|
425
411
|
return [response, options, rawResponse];
|
|
412
|
+
}).catch((error) => {
|
|
413
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
414
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
415
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
416
|
+
}
|
|
417
|
+
throw error;
|
|
426
418
|
});
|
|
427
419
|
}
|
|
428
420
|
getFolder(request, optionsOrCallback, callback) {
|
|
@@ -441,24 +433,19 @@ class StorageControlClient {
|
|
|
441
433
|
options = options || {};
|
|
442
434
|
options.otherArgs = options.otherArgs || {};
|
|
443
435
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
444
|
-
|
|
436
|
+
let routingParameter = {};
|
|
445
437
|
{
|
|
446
438
|
const fieldValue = request.name;
|
|
447
439
|
if (fieldValue !== undefined && fieldValue !== null) {
|
|
448
|
-
const match = fieldValue
|
|
449
|
-
.toString()
|
|
450
|
-
.match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
440
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
451
441
|
if (match) {
|
|
452
442
|
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
453
443
|
Object.assign(routingParameter, { bucket: parameterValue });
|
|
454
444
|
}
|
|
455
445
|
}
|
|
456
446
|
}
|
|
457
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
458
|
-
|
|
459
|
-
this.initialize().catch(err => {
|
|
460
|
-
throw err;
|
|
461
|
-
});
|
|
447
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
448
|
+
this.initialize().catch(err => { throw err; });
|
|
462
449
|
this._log.info('getFolder request %j', request);
|
|
463
450
|
const wrappedCallback = callback
|
|
464
451
|
? (error, response, options, rawResponse) => {
|
|
@@ -466,11 +453,16 @@ class StorageControlClient {
|
|
|
466
453
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
467
454
|
}
|
|
468
455
|
: undefined;
|
|
469
|
-
return this.innerApiCalls
|
|
470
|
-
.getFolder(request, options, wrappedCallback)
|
|
456
|
+
return this.innerApiCalls.getFolder(request, options, wrappedCallback)
|
|
471
457
|
?.then(([response, options, rawResponse]) => {
|
|
472
458
|
this._log.info('getFolder response %j', response);
|
|
473
459
|
return [response, options, rawResponse];
|
|
460
|
+
}).catch((error) => {
|
|
461
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
462
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
463
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
464
|
+
}
|
|
465
|
+
throw error;
|
|
474
466
|
});
|
|
475
467
|
}
|
|
476
468
|
getStorageLayout(request, optionsOrCallback, callback) {
|
|
@@ -489,24 +481,19 @@ class StorageControlClient {
|
|
|
489
481
|
options = options || {};
|
|
490
482
|
options.otherArgs = options.otherArgs || {};
|
|
491
483
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
492
|
-
|
|
484
|
+
let routingParameter = {};
|
|
493
485
|
{
|
|
494
486
|
const fieldValue = request.name;
|
|
495
487
|
if (fieldValue !== undefined && fieldValue !== null) {
|
|
496
|
-
const match = fieldValue
|
|
497
|
-
.toString()
|
|
498
|
-
.match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
488
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
499
489
|
if (match) {
|
|
500
490
|
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
501
491
|
Object.assign(routingParameter, { bucket: parameterValue });
|
|
502
492
|
}
|
|
503
493
|
}
|
|
504
494
|
}
|
|
505
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
506
|
-
|
|
507
|
-
this.initialize().catch(err => {
|
|
508
|
-
throw err;
|
|
509
|
-
});
|
|
495
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
496
|
+
this.initialize().catch(err => { throw err; });
|
|
510
497
|
this._log.info('getStorageLayout request %j', request);
|
|
511
498
|
const wrappedCallback = callback
|
|
512
499
|
? (error, response, options, rawResponse) => {
|
|
@@ -514,11 +501,16 @@ class StorageControlClient {
|
|
|
514
501
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
515
502
|
}
|
|
516
503
|
: undefined;
|
|
517
|
-
return this.innerApiCalls
|
|
518
|
-
.getStorageLayout(request, options, wrappedCallback)
|
|
504
|
+
return this.innerApiCalls.getStorageLayout(request, options, wrappedCallback)
|
|
519
505
|
?.then(([response, options, rawResponse]) => {
|
|
520
506
|
this._log.info('getStorageLayout response %j', response);
|
|
521
507
|
return [response, options, rawResponse];
|
|
508
|
+
}).catch((error) => {
|
|
509
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
510
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
511
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
512
|
+
}
|
|
513
|
+
throw error;
|
|
522
514
|
});
|
|
523
515
|
}
|
|
524
516
|
createManagedFolder(request, optionsOrCallback, callback) {
|
|
@@ -537,7 +529,7 @@ class StorageControlClient {
|
|
|
537
529
|
options = options || {};
|
|
538
530
|
options.otherArgs = options.otherArgs || {};
|
|
539
531
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
540
|
-
|
|
532
|
+
let routingParameter = {};
|
|
541
533
|
{
|
|
542
534
|
const fieldValue = request.parent;
|
|
543
535
|
if (fieldValue !== undefined && fieldValue !== null) {
|
|
@@ -548,11 +540,8 @@ class StorageControlClient {
|
|
|
548
540
|
}
|
|
549
541
|
}
|
|
550
542
|
}
|
|
551
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
552
|
-
|
|
553
|
-
this.initialize().catch(err => {
|
|
554
|
-
throw err;
|
|
555
|
-
});
|
|
543
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
544
|
+
this.initialize().catch(err => { throw err; });
|
|
556
545
|
this._log.info('createManagedFolder request %j', request);
|
|
557
546
|
const wrappedCallback = callback
|
|
558
547
|
? (error, response, options, rawResponse) => {
|
|
@@ -560,11 +549,16 @@ class StorageControlClient {
|
|
|
560
549
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
561
550
|
}
|
|
562
551
|
: undefined;
|
|
563
|
-
return this.innerApiCalls
|
|
564
|
-
.createManagedFolder(request, options, wrappedCallback)
|
|
552
|
+
return this.innerApiCalls.createManagedFolder(request, options, wrappedCallback)
|
|
565
553
|
?.then(([response, options, rawResponse]) => {
|
|
566
554
|
this._log.info('createManagedFolder response %j', response);
|
|
567
555
|
return [response, options, rawResponse];
|
|
556
|
+
}).catch((error) => {
|
|
557
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
558
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
559
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
560
|
+
}
|
|
561
|
+
throw error;
|
|
568
562
|
});
|
|
569
563
|
}
|
|
570
564
|
deleteManagedFolder(request, optionsOrCallback, callback) {
|
|
@@ -583,24 +577,19 @@ class StorageControlClient {
|
|
|
583
577
|
options = options || {};
|
|
584
578
|
options.otherArgs = options.otherArgs || {};
|
|
585
579
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
586
|
-
|
|
580
|
+
let routingParameter = {};
|
|
587
581
|
{
|
|
588
582
|
const fieldValue = request.name;
|
|
589
583
|
if (fieldValue !== undefined && fieldValue !== null) {
|
|
590
|
-
const match = fieldValue
|
|
591
|
-
.toString()
|
|
592
|
-
.match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
584
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
593
585
|
if (match) {
|
|
594
586
|
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
595
587
|
Object.assign(routingParameter, { bucket: parameterValue });
|
|
596
588
|
}
|
|
597
589
|
}
|
|
598
590
|
}
|
|
599
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
600
|
-
|
|
601
|
-
this.initialize().catch(err => {
|
|
602
|
-
throw err;
|
|
603
|
-
});
|
|
591
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
592
|
+
this.initialize().catch(err => { throw err; });
|
|
604
593
|
this._log.info('deleteManagedFolder request %j', request);
|
|
605
594
|
const wrappedCallback = callback
|
|
606
595
|
? (error, response, options, rawResponse) => {
|
|
@@ -608,14 +597,710 @@ class StorageControlClient {
|
|
|
608
597
|
callback(error, response, options, rawResponse); // We verified callback above.
|
|
609
598
|
}
|
|
610
599
|
: undefined;
|
|
611
|
-
return this.innerApiCalls
|
|
612
|
-
.deleteManagedFolder(request, options, wrappedCallback)
|
|
600
|
+
return this.innerApiCalls.deleteManagedFolder(request, options, wrappedCallback)
|
|
613
601
|
?.then(([response, options, rawResponse]) => {
|
|
614
602
|
this._log.info('deleteManagedFolder response %j', response);
|
|
615
603
|
return [response, options, rawResponse];
|
|
604
|
+
}).catch((error) => {
|
|
605
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
606
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
607
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
608
|
+
}
|
|
609
|
+
throw error;
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
getManagedFolder(request, optionsOrCallback, callback) {
|
|
613
|
+
request = request || {};
|
|
614
|
+
if (!request.requestId) {
|
|
615
|
+
request.requestId = gax.makeUUID();
|
|
616
|
+
}
|
|
617
|
+
let options;
|
|
618
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
619
|
+
callback = optionsOrCallback;
|
|
620
|
+
options = {};
|
|
621
|
+
}
|
|
622
|
+
else {
|
|
623
|
+
options = optionsOrCallback;
|
|
624
|
+
}
|
|
625
|
+
options = options || {};
|
|
626
|
+
options.otherArgs = options.otherArgs || {};
|
|
627
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
628
|
+
let routingParameter = {};
|
|
629
|
+
{
|
|
630
|
+
const fieldValue = request.name;
|
|
631
|
+
if (fieldValue !== undefined && fieldValue !== null) {
|
|
632
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
633
|
+
if (match) {
|
|
634
|
+
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
635
|
+
Object.assign(routingParameter, { bucket: parameterValue });
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
640
|
+
this.initialize().catch(err => { throw err; });
|
|
641
|
+
this._log.info('getManagedFolder request %j', request);
|
|
642
|
+
const wrappedCallback = callback
|
|
643
|
+
? (error, response, options, rawResponse) => {
|
|
644
|
+
this._log.info('getManagedFolder response %j', response);
|
|
645
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
646
|
+
}
|
|
647
|
+
: undefined;
|
|
648
|
+
return this.innerApiCalls.getManagedFolder(request, options, wrappedCallback)
|
|
649
|
+
?.then(([response, options, rawResponse]) => {
|
|
650
|
+
this._log.info('getManagedFolder response %j', response);
|
|
651
|
+
return [response, options, rawResponse];
|
|
652
|
+
}).catch((error) => {
|
|
653
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
654
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
655
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
656
|
+
}
|
|
657
|
+
throw error;
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
disableAnywhereCache(request, optionsOrCallback, callback) {
|
|
661
|
+
request = request || {};
|
|
662
|
+
if (!request.requestId) {
|
|
663
|
+
request.requestId = gax.makeUUID();
|
|
664
|
+
}
|
|
665
|
+
let options;
|
|
666
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
667
|
+
callback = optionsOrCallback;
|
|
668
|
+
options = {};
|
|
669
|
+
}
|
|
670
|
+
else {
|
|
671
|
+
options = optionsOrCallback;
|
|
672
|
+
}
|
|
673
|
+
options = options || {};
|
|
674
|
+
options.otherArgs = options.otherArgs || {};
|
|
675
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
676
|
+
let routingParameter = {};
|
|
677
|
+
{
|
|
678
|
+
const fieldValue = request.name;
|
|
679
|
+
if (fieldValue !== undefined && fieldValue !== null) {
|
|
680
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
681
|
+
if (match) {
|
|
682
|
+
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
683
|
+
Object.assign(routingParameter, { bucket: parameterValue });
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
688
|
+
this.initialize().catch(err => { throw err; });
|
|
689
|
+
this._log.info('disableAnywhereCache request %j', request);
|
|
690
|
+
const wrappedCallback = callback
|
|
691
|
+
? (error, response, options, rawResponse) => {
|
|
692
|
+
this._log.info('disableAnywhereCache response %j', response);
|
|
693
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
694
|
+
}
|
|
695
|
+
: undefined;
|
|
696
|
+
return this.innerApiCalls.disableAnywhereCache(request, options, wrappedCallback)
|
|
697
|
+
?.then(([response, options, rawResponse]) => {
|
|
698
|
+
this._log.info('disableAnywhereCache response %j', response);
|
|
699
|
+
return [response, options, rawResponse];
|
|
700
|
+
}).catch((error) => {
|
|
701
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
702
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
703
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
704
|
+
}
|
|
705
|
+
throw error;
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
pauseAnywhereCache(request, optionsOrCallback, callback) {
|
|
709
|
+
request = request || {};
|
|
710
|
+
if (!request.requestId) {
|
|
711
|
+
request.requestId = gax.makeUUID();
|
|
712
|
+
}
|
|
713
|
+
let options;
|
|
714
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
715
|
+
callback = optionsOrCallback;
|
|
716
|
+
options = {};
|
|
717
|
+
}
|
|
718
|
+
else {
|
|
719
|
+
options = optionsOrCallback;
|
|
720
|
+
}
|
|
721
|
+
options = options || {};
|
|
722
|
+
options.otherArgs = options.otherArgs || {};
|
|
723
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
724
|
+
let routingParameter = {};
|
|
725
|
+
{
|
|
726
|
+
const fieldValue = request.name;
|
|
727
|
+
if (fieldValue !== undefined && fieldValue !== null) {
|
|
728
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
729
|
+
if (match) {
|
|
730
|
+
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
731
|
+
Object.assign(routingParameter, { bucket: parameterValue });
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
736
|
+
this.initialize().catch(err => { throw err; });
|
|
737
|
+
this._log.info('pauseAnywhereCache request %j', request);
|
|
738
|
+
const wrappedCallback = callback
|
|
739
|
+
? (error, response, options, rawResponse) => {
|
|
740
|
+
this._log.info('pauseAnywhereCache response %j', response);
|
|
741
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
742
|
+
}
|
|
743
|
+
: undefined;
|
|
744
|
+
return this.innerApiCalls.pauseAnywhereCache(request, options, wrappedCallback)
|
|
745
|
+
?.then(([response, options, rawResponse]) => {
|
|
746
|
+
this._log.info('pauseAnywhereCache response %j', response);
|
|
747
|
+
return [response, options, rawResponse];
|
|
748
|
+
}).catch((error) => {
|
|
749
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
750
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
751
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
752
|
+
}
|
|
753
|
+
throw error;
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
resumeAnywhereCache(request, optionsOrCallback, callback) {
|
|
757
|
+
request = request || {};
|
|
758
|
+
if (!request.requestId) {
|
|
759
|
+
request.requestId = gax.makeUUID();
|
|
760
|
+
}
|
|
761
|
+
let options;
|
|
762
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
763
|
+
callback = optionsOrCallback;
|
|
764
|
+
options = {};
|
|
765
|
+
}
|
|
766
|
+
else {
|
|
767
|
+
options = optionsOrCallback;
|
|
768
|
+
}
|
|
769
|
+
options = options || {};
|
|
770
|
+
options.otherArgs = options.otherArgs || {};
|
|
771
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
772
|
+
let routingParameter = {};
|
|
773
|
+
{
|
|
774
|
+
const fieldValue = request.name;
|
|
775
|
+
if (fieldValue !== undefined && fieldValue !== null) {
|
|
776
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
777
|
+
if (match) {
|
|
778
|
+
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
779
|
+
Object.assign(routingParameter, { bucket: parameterValue });
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
784
|
+
this.initialize().catch(err => { throw err; });
|
|
785
|
+
this._log.info('resumeAnywhereCache request %j', request);
|
|
786
|
+
const wrappedCallback = callback
|
|
787
|
+
? (error, response, options, rawResponse) => {
|
|
788
|
+
this._log.info('resumeAnywhereCache response %j', response);
|
|
789
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
790
|
+
}
|
|
791
|
+
: undefined;
|
|
792
|
+
return this.innerApiCalls.resumeAnywhereCache(request, options, wrappedCallback)
|
|
793
|
+
?.then(([response, options, rawResponse]) => {
|
|
794
|
+
this._log.info('resumeAnywhereCache response %j', response);
|
|
795
|
+
return [response, options, rawResponse];
|
|
796
|
+
}).catch((error) => {
|
|
797
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
798
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
799
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
800
|
+
}
|
|
801
|
+
throw error;
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
getAnywhereCache(request, optionsOrCallback, callback) {
|
|
805
|
+
request = request || {};
|
|
806
|
+
if (!request.requestId) {
|
|
807
|
+
request.requestId = gax.makeUUID();
|
|
808
|
+
}
|
|
809
|
+
let options;
|
|
810
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
811
|
+
callback = optionsOrCallback;
|
|
812
|
+
options = {};
|
|
813
|
+
}
|
|
814
|
+
else {
|
|
815
|
+
options = optionsOrCallback;
|
|
816
|
+
}
|
|
817
|
+
options = options || {};
|
|
818
|
+
options.otherArgs = options.otherArgs || {};
|
|
819
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
820
|
+
let routingParameter = {};
|
|
821
|
+
{
|
|
822
|
+
const fieldValue = request.name;
|
|
823
|
+
if (fieldValue !== undefined && fieldValue !== null) {
|
|
824
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
825
|
+
if (match) {
|
|
826
|
+
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
827
|
+
Object.assign(routingParameter, { bucket: parameterValue });
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
832
|
+
this.initialize().catch(err => { throw err; });
|
|
833
|
+
this._log.info('getAnywhereCache request %j', request);
|
|
834
|
+
const wrappedCallback = callback
|
|
835
|
+
? (error, response, options, rawResponse) => {
|
|
836
|
+
this._log.info('getAnywhereCache response %j', response);
|
|
837
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
838
|
+
}
|
|
839
|
+
: undefined;
|
|
840
|
+
return this.innerApiCalls.getAnywhereCache(request, options, wrappedCallback)
|
|
841
|
+
?.then(([response, options, rawResponse]) => {
|
|
842
|
+
this._log.info('getAnywhereCache response %j', response);
|
|
843
|
+
return [response, options, rawResponse];
|
|
844
|
+
}).catch((error) => {
|
|
845
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
846
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
847
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
848
|
+
}
|
|
849
|
+
throw error;
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
getProjectIntelligenceConfig(request, optionsOrCallback, callback) {
|
|
853
|
+
request = request || {};
|
|
854
|
+
let options;
|
|
855
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
856
|
+
callback = optionsOrCallback;
|
|
857
|
+
options = {};
|
|
858
|
+
}
|
|
859
|
+
else {
|
|
860
|
+
options = optionsOrCallback;
|
|
861
|
+
}
|
|
862
|
+
options = options || {};
|
|
863
|
+
options.otherArgs = options.otherArgs || {};
|
|
864
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
865
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
866
|
+
'name': request.name ?? '',
|
|
867
|
+
});
|
|
868
|
+
this.initialize().catch(err => { throw err; });
|
|
869
|
+
this._log.info('getProjectIntelligenceConfig request %j', request);
|
|
870
|
+
const wrappedCallback = callback
|
|
871
|
+
? (error, response, options, rawResponse) => {
|
|
872
|
+
this._log.info('getProjectIntelligenceConfig response %j', response);
|
|
873
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
874
|
+
}
|
|
875
|
+
: undefined;
|
|
876
|
+
return this.innerApiCalls.getProjectIntelligenceConfig(request, options, wrappedCallback)
|
|
877
|
+
?.then(([response, options, rawResponse]) => {
|
|
878
|
+
this._log.info('getProjectIntelligenceConfig response %j', response);
|
|
879
|
+
return [response, options, rawResponse];
|
|
880
|
+
}).catch((error) => {
|
|
881
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
882
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
883
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
884
|
+
}
|
|
885
|
+
throw error;
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
updateProjectIntelligenceConfig(request, optionsOrCallback, callback) {
|
|
889
|
+
request = request || {};
|
|
890
|
+
let options;
|
|
891
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
892
|
+
callback = optionsOrCallback;
|
|
893
|
+
options = {};
|
|
894
|
+
}
|
|
895
|
+
else {
|
|
896
|
+
options = optionsOrCallback;
|
|
897
|
+
}
|
|
898
|
+
options = options || {};
|
|
899
|
+
options.otherArgs = options.otherArgs || {};
|
|
900
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
901
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
902
|
+
'intelligence_config.name': request.intelligenceConfig.name ?? '',
|
|
903
|
+
});
|
|
904
|
+
this.initialize().catch(err => { throw err; });
|
|
905
|
+
this._log.info('updateProjectIntelligenceConfig request %j', request);
|
|
906
|
+
const wrappedCallback = callback
|
|
907
|
+
? (error, response, options, rawResponse) => {
|
|
908
|
+
this._log.info('updateProjectIntelligenceConfig response %j', response);
|
|
909
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
910
|
+
}
|
|
911
|
+
: undefined;
|
|
912
|
+
return this.innerApiCalls.updateProjectIntelligenceConfig(request, options, wrappedCallback)
|
|
913
|
+
?.then(([response, options, rawResponse]) => {
|
|
914
|
+
this._log.info('updateProjectIntelligenceConfig response %j', response);
|
|
915
|
+
return [response, options, rawResponse];
|
|
916
|
+
}).catch((error) => {
|
|
917
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
918
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
919
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
920
|
+
}
|
|
921
|
+
throw error;
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
getFolderIntelligenceConfig(request, optionsOrCallback, callback) {
|
|
925
|
+
request = request || {};
|
|
926
|
+
let options;
|
|
927
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
928
|
+
callback = optionsOrCallback;
|
|
929
|
+
options = {};
|
|
930
|
+
}
|
|
931
|
+
else {
|
|
932
|
+
options = optionsOrCallback;
|
|
933
|
+
}
|
|
934
|
+
options = options || {};
|
|
935
|
+
options.otherArgs = options.otherArgs || {};
|
|
936
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
937
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
938
|
+
'name': request.name ?? '',
|
|
939
|
+
});
|
|
940
|
+
this.initialize().catch(err => { throw err; });
|
|
941
|
+
this._log.info('getFolderIntelligenceConfig request %j', request);
|
|
942
|
+
const wrappedCallback = callback
|
|
943
|
+
? (error, response, options, rawResponse) => {
|
|
944
|
+
this._log.info('getFolderIntelligenceConfig response %j', response);
|
|
945
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
946
|
+
}
|
|
947
|
+
: undefined;
|
|
948
|
+
return this.innerApiCalls.getFolderIntelligenceConfig(request, options, wrappedCallback)
|
|
949
|
+
?.then(([response, options, rawResponse]) => {
|
|
950
|
+
this._log.info('getFolderIntelligenceConfig response %j', response);
|
|
951
|
+
return [response, options, rawResponse];
|
|
952
|
+
}).catch((error) => {
|
|
953
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
954
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
955
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
956
|
+
}
|
|
957
|
+
throw error;
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
updateFolderIntelligenceConfig(request, optionsOrCallback, callback) {
|
|
961
|
+
request = request || {};
|
|
962
|
+
let options;
|
|
963
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
964
|
+
callback = optionsOrCallback;
|
|
965
|
+
options = {};
|
|
966
|
+
}
|
|
967
|
+
else {
|
|
968
|
+
options = optionsOrCallback;
|
|
969
|
+
}
|
|
970
|
+
options = options || {};
|
|
971
|
+
options.otherArgs = options.otherArgs || {};
|
|
972
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
973
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
974
|
+
'intelligence_config.name': request.intelligenceConfig.name ?? '',
|
|
975
|
+
});
|
|
976
|
+
this.initialize().catch(err => { throw err; });
|
|
977
|
+
this._log.info('updateFolderIntelligenceConfig request %j', request);
|
|
978
|
+
const wrappedCallback = callback
|
|
979
|
+
? (error, response, options, rawResponse) => {
|
|
980
|
+
this._log.info('updateFolderIntelligenceConfig response %j', response);
|
|
981
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
982
|
+
}
|
|
983
|
+
: undefined;
|
|
984
|
+
return this.innerApiCalls.updateFolderIntelligenceConfig(request, options, wrappedCallback)
|
|
985
|
+
?.then(([response, options, rawResponse]) => {
|
|
986
|
+
this._log.info('updateFolderIntelligenceConfig response %j', response);
|
|
987
|
+
return [response, options, rawResponse];
|
|
988
|
+
}).catch((error) => {
|
|
989
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
990
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
991
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
992
|
+
}
|
|
993
|
+
throw error;
|
|
994
|
+
});
|
|
995
|
+
}
|
|
996
|
+
getOrganizationIntelligenceConfig(request, optionsOrCallback, callback) {
|
|
997
|
+
request = request || {};
|
|
998
|
+
let options;
|
|
999
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
1000
|
+
callback = optionsOrCallback;
|
|
1001
|
+
options = {};
|
|
1002
|
+
}
|
|
1003
|
+
else {
|
|
1004
|
+
options = optionsOrCallback;
|
|
1005
|
+
}
|
|
1006
|
+
options = options || {};
|
|
1007
|
+
options.otherArgs = options.otherArgs || {};
|
|
1008
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1009
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
1010
|
+
'name': request.name ?? '',
|
|
1011
|
+
});
|
|
1012
|
+
this.initialize().catch(err => { throw err; });
|
|
1013
|
+
this._log.info('getOrganizationIntelligenceConfig request %j', request);
|
|
1014
|
+
const wrappedCallback = callback
|
|
1015
|
+
? (error, response, options, rawResponse) => {
|
|
1016
|
+
this._log.info('getOrganizationIntelligenceConfig response %j', response);
|
|
1017
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
1018
|
+
}
|
|
1019
|
+
: undefined;
|
|
1020
|
+
return this.innerApiCalls.getOrganizationIntelligenceConfig(request, options, wrappedCallback)
|
|
1021
|
+
?.then(([response, options, rawResponse]) => {
|
|
1022
|
+
this._log.info('getOrganizationIntelligenceConfig response %j', response);
|
|
1023
|
+
return [response, options, rawResponse];
|
|
1024
|
+
}).catch((error) => {
|
|
1025
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
1026
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
1027
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
1028
|
+
}
|
|
1029
|
+
throw error;
|
|
1030
|
+
});
|
|
1031
|
+
}
|
|
1032
|
+
updateOrganizationIntelligenceConfig(request, optionsOrCallback, callback) {
|
|
1033
|
+
request = request || {};
|
|
1034
|
+
let options;
|
|
1035
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
1036
|
+
callback = optionsOrCallback;
|
|
1037
|
+
options = {};
|
|
1038
|
+
}
|
|
1039
|
+
else {
|
|
1040
|
+
options = optionsOrCallback;
|
|
1041
|
+
}
|
|
1042
|
+
options = options || {};
|
|
1043
|
+
options.otherArgs = options.otherArgs || {};
|
|
1044
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1045
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
|
|
1046
|
+
'intelligence_config.name': request.intelligenceConfig.name ?? '',
|
|
1047
|
+
});
|
|
1048
|
+
this.initialize().catch(err => { throw err; });
|
|
1049
|
+
this._log.info('updateOrganizationIntelligenceConfig request %j', request);
|
|
1050
|
+
const wrappedCallback = callback
|
|
1051
|
+
? (error, response, options, rawResponse) => {
|
|
1052
|
+
this._log.info('updateOrganizationIntelligenceConfig response %j', response);
|
|
1053
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
1054
|
+
}
|
|
1055
|
+
: undefined;
|
|
1056
|
+
return this.innerApiCalls.updateOrganizationIntelligenceConfig(request, options, wrappedCallback)
|
|
1057
|
+
?.then(([response, options, rawResponse]) => {
|
|
1058
|
+
this._log.info('updateOrganizationIntelligenceConfig response %j', response);
|
|
1059
|
+
return [response, options, rawResponse];
|
|
1060
|
+
}).catch((error) => {
|
|
1061
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
1062
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
1063
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
1064
|
+
}
|
|
1065
|
+
throw error;
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1068
|
+
getIamPolicy(request, optionsOrCallback, callback) {
|
|
1069
|
+
request = request || {};
|
|
1070
|
+
let options;
|
|
1071
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
1072
|
+
callback = optionsOrCallback;
|
|
1073
|
+
options = {};
|
|
1074
|
+
}
|
|
1075
|
+
else {
|
|
1076
|
+
options = optionsOrCallback;
|
|
1077
|
+
}
|
|
1078
|
+
options = options || {};
|
|
1079
|
+
options.otherArgs = options.otherArgs || {};
|
|
1080
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1081
|
+
let routingParameter = {};
|
|
1082
|
+
{
|
|
1083
|
+
const fieldValue = request.resource;
|
|
1084
|
+
if (fieldValue !== undefined && fieldValue !== null) {
|
|
1085
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>(?:.*)?)'));
|
|
1086
|
+
if (match) {
|
|
1087
|
+
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
1088
|
+
Object.assign(routingParameter, { bucket: parameterValue });
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
{
|
|
1093
|
+
const fieldValue = request.resource;
|
|
1094
|
+
if (fieldValue !== undefined && fieldValue !== null) {
|
|
1095
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
1096
|
+
if (match) {
|
|
1097
|
+
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
1098
|
+
Object.assign(routingParameter, { bucket: parameterValue });
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
1103
|
+
this.initialize().catch(err => { throw err; });
|
|
1104
|
+
this._log.info('getIamPolicy request %j', request);
|
|
1105
|
+
const wrappedCallback = callback
|
|
1106
|
+
? (error, response, options, rawResponse) => {
|
|
1107
|
+
this._log.info('getIamPolicy response %j', response);
|
|
1108
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
1109
|
+
}
|
|
1110
|
+
: undefined;
|
|
1111
|
+
return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback)
|
|
1112
|
+
?.then(([response, options, rawResponse]) => {
|
|
1113
|
+
this._log.info('getIamPolicy response %j', response);
|
|
1114
|
+
return [response, options, rawResponse];
|
|
1115
|
+
}).catch((error) => {
|
|
1116
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
1117
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
1118
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
1119
|
+
}
|
|
1120
|
+
throw error;
|
|
616
1121
|
});
|
|
617
1122
|
}
|
|
618
|
-
|
|
1123
|
+
setIamPolicy(request, optionsOrCallback, callback) {
|
|
1124
|
+
request = request || {};
|
|
1125
|
+
let options;
|
|
1126
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
1127
|
+
callback = optionsOrCallback;
|
|
1128
|
+
options = {};
|
|
1129
|
+
}
|
|
1130
|
+
else {
|
|
1131
|
+
options = optionsOrCallback;
|
|
1132
|
+
}
|
|
1133
|
+
options = options || {};
|
|
1134
|
+
options.otherArgs = options.otherArgs || {};
|
|
1135
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1136
|
+
let routingParameter = {};
|
|
1137
|
+
{
|
|
1138
|
+
const fieldValue = request.resource;
|
|
1139
|
+
if (fieldValue !== undefined && fieldValue !== null) {
|
|
1140
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>(?:.*)?)'));
|
|
1141
|
+
if (match) {
|
|
1142
|
+
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
1143
|
+
Object.assign(routingParameter, { bucket: parameterValue });
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
{
|
|
1148
|
+
const fieldValue = request.resource;
|
|
1149
|
+
if (fieldValue !== undefined && fieldValue !== null) {
|
|
1150
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
1151
|
+
if (match) {
|
|
1152
|
+
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
1153
|
+
Object.assign(routingParameter, { bucket: parameterValue });
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
1158
|
+
this.initialize().catch(err => { throw err; });
|
|
1159
|
+
this._log.info('setIamPolicy request %j', request);
|
|
1160
|
+
const wrappedCallback = callback
|
|
1161
|
+
? (error, response, options, rawResponse) => {
|
|
1162
|
+
this._log.info('setIamPolicy response %j', response);
|
|
1163
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
1164
|
+
}
|
|
1165
|
+
: undefined;
|
|
1166
|
+
return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback)
|
|
1167
|
+
?.then(([response, options, rawResponse]) => {
|
|
1168
|
+
this._log.info('setIamPolicy response %j', response);
|
|
1169
|
+
return [response, options, rawResponse];
|
|
1170
|
+
}).catch((error) => {
|
|
1171
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
1172
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
1173
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
1174
|
+
}
|
|
1175
|
+
throw error;
|
|
1176
|
+
});
|
|
1177
|
+
}
|
|
1178
|
+
testIamPermissions(request, optionsOrCallback, callback) {
|
|
1179
|
+
request = request || {};
|
|
1180
|
+
let options;
|
|
1181
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
1182
|
+
callback = optionsOrCallback;
|
|
1183
|
+
options = {};
|
|
1184
|
+
}
|
|
1185
|
+
else {
|
|
1186
|
+
options = optionsOrCallback;
|
|
1187
|
+
}
|
|
1188
|
+
options = options || {};
|
|
1189
|
+
options.otherArgs = options.otherArgs || {};
|
|
1190
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1191
|
+
let routingParameter = {};
|
|
1192
|
+
{
|
|
1193
|
+
const fieldValue = request.resource;
|
|
1194
|
+
if (fieldValue !== undefined && fieldValue !== null) {
|
|
1195
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>(?:.*)?)'));
|
|
1196
|
+
if (match) {
|
|
1197
|
+
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
1198
|
+
Object.assign(routingParameter, { bucket: parameterValue });
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
{
|
|
1203
|
+
const fieldValue = request.resource;
|
|
1204
|
+
if (fieldValue !== undefined && fieldValue !== null) {
|
|
1205
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)/objects(?:/.*)?'));
|
|
1206
|
+
if (match) {
|
|
1207
|
+
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
1208
|
+
Object.assign(routingParameter, { bucket: parameterValue });
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
{
|
|
1213
|
+
const fieldValue = request.resource;
|
|
1214
|
+
if (fieldValue !== undefined && fieldValue !== null) {
|
|
1215
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)/managedFolders(?:/.*)?'));
|
|
1216
|
+
if (match) {
|
|
1217
|
+
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
1218
|
+
Object.assign(routingParameter, { bucket: parameterValue });
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
1223
|
+
this.initialize().catch(err => { throw err; });
|
|
1224
|
+
this._log.info('testIamPermissions request %j', request);
|
|
1225
|
+
const wrappedCallback = callback
|
|
1226
|
+
? (error, response, options, rawResponse) => {
|
|
1227
|
+
this._log.info('testIamPermissions response %j', response);
|
|
1228
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
1229
|
+
}
|
|
1230
|
+
: undefined;
|
|
1231
|
+
return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback)
|
|
1232
|
+
?.then(([response, options, rawResponse]) => {
|
|
1233
|
+
this._log.info('testIamPermissions response %j', response);
|
|
1234
|
+
return [response, options, rawResponse];
|
|
1235
|
+
}).catch((error) => {
|
|
1236
|
+
if (error && 'statusDetails' in error && error.statusDetails instanceof Array) {
|
|
1237
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
1238
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
1239
|
+
}
|
|
1240
|
+
throw error;
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1243
|
+
renameFolder(request, optionsOrCallback, callback) {
|
|
1244
|
+
request = request || {};
|
|
1245
|
+
if (!request.requestId) {
|
|
1246
|
+
request.requestId = gax.makeUUID();
|
|
1247
|
+
}
|
|
1248
|
+
let options;
|
|
1249
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
1250
|
+
callback = optionsOrCallback;
|
|
1251
|
+
options = {};
|
|
1252
|
+
}
|
|
1253
|
+
else {
|
|
1254
|
+
options = optionsOrCallback;
|
|
1255
|
+
}
|
|
1256
|
+
options = options || {};
|
|
1257
|
+
options.otherArgs = options.otherArgs || {};
|
|
1258
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1259
|
+
let routingParameter = {};
|
|
1260
|
+
{
|
|
1261
|
+
const fieldValue = request.name;
|
|
1262
|
+
if (fieldValue !== undefined && fieldValue !== null) {
|
|
1263
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
1264
|
+
if (match) {
|
|
1265
|
+
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
1266
|
+
Object.assign(routingParameter, { bucket: parameterValue });
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
1271
|
+
this.initialize().catch(err => { throw err; });
|
|
1272
|
+
const wrappedCallback = callback
|
|
1273
|
+
? (error, response, rawResponse, _) => {
|
|
1274
|
+
this._log.info('renameFolder response %j', rawResponse);
|
|
1275
|
+
callback(error, response, rawResponse, _); // We verified callback above.
|
|
1276
|
+
}
|
|
1277
|
+
: undefined;
|
|
1278
|
+
this._log.info('renameFolder request %j', request);
|
|
1279
|
+
return this.innerApiCalls.renameFolder(request, options, wrappedCallback)
|
|
1280
|
+
?.then(([response, rawResponse, _]) => {
|
|
1281
|
+
this._log.info('renameFolder response %j', rawResponse);
|
|
1282
|
+
return [response, rawResponse, _];
|
|
1283
|
+
});
|
|
1284
|
+
}
|
|
1285
|
+
/**
|
|
1286
|
+
* Check the status of the long running operation returned by `renameFolder()`.
|
|
1287
|
+
* @param {String} name
|
|
1288
|
+
* The operation name that will be passed.
|
|
1289
|
+
* @returns {Promise} - The promise which resolves to an object.
|
|
1290
|
+
* The decoded operation object has result and metadata field to get information from.
|
|
1291
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
|
|
1292
|
+
* for more details and examples.
|
|
1293
|
+
* @example <caption>include:samples/generated/v2/storage_control.rename_folder.js</caption>
|
|
1294
|
+
* region_tag:storage_v2_generated_StorageControl_RenameFolder_async
|
|
1295
|
+
*/
|
|
1296
|
+
async checkRenameFolderProgress(name) {
|
|
1297
|
+
this._log.info('renameFolder long-running');
|
|
1298
|
+
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
1299
|
+
const [operation] = await this.operationsClient.getOperation(request);
|
|
1300
|
+
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.renameFolder, this._gaxModule.createDefaultBackoffSettings());
|
|
1301
|
+
return decodeOperation;
|
|
1302
|
+
}
|
|
1303
|
+
createAnywhereCache(request, optionsOrCallback, callback) {
|
|
619
1304
|
request = request || {};
|
|
620
1305
|
if (!request.requestId) {
|
|
621
1306
|
request.requestId = gax.makeUUID();
|
|
@@ -631,39 +1316,51 @@ class StorageControlClient {
|
|
|
631
1316
|
options = options || {};
|
|
632
1317
|
options.otherArgs = options.otherArgs || {};
|
|
633
1318
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
634
|
-
|
|
1319
|
+
let routingParameter = {};
|
|
635
1320
|
{
|
|
636
|
-
const fieldValue = request.
|
|
1321
|
+
const fieldValue = request.parent;
|
|
637
1322
|
if (fieldValue !== undefined && fieldValue !== null) {
|
|
638
|
-
const match = fieldValue
|
|
639
|
-
.toString()
|
|
640
|
-
.match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
1323
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>(?:.*)?)'));
|
|
641
1324
|
if (match) {
|
|
642
1325
|
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
643
1326
|
Object.assign(routingParameter, { bucket: parameterValue });
|
|
644
1327
|
}
|
|
645
1328
|
}
|
|
646
1329
|
}
|
|
647
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
648
|
-
|
|
649
|
-
this.initialize().catch(err => {
|
|
650
|
-
throw err;
|
|
651
|
-
});
|
|
652
|
-
this._log.info('getManagedFolder request %j', request);
|
|
1330
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
1331
|
+
this.initialize().catch(err => { throw err; });
|
|
653
1332
|
const wrappedCallback = callback
|
|
654
|
-
? (error, response,
|
|
655
|
-
this._log.info('
|
|
656
|
-
callback(error, response,
|
|
1333
|
+
? (error, response, rawResponse, _) => {
|
|
1334
|
+
this._log.info('createAnywhereCache response %j', rawResponse);
|
|
1335
|
+
callback(error, response, rawResponse, _); // We verified callback above.
|
|
657
1336
|
}
|
|
658
1337
|
: undefined;
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
?.then(([response,
|
|
662
|
-
this._log.info('
|
|
663
|
-
return [response,
|
|
1338
|
+
this._log.info('createAnywhereCache request %j', request);
|
|
1339
|
+
return this.innerApiCalls.createAnywhereCache(request, options, wrappedCallback)
|
|
1340
|
+
?.then(([response, rawResponse, _]) => {
|
|
1341
|
+
this._log.info('createAnywhereCache response %j', rawResponse);
|
|
1342
|
+
return [response, rawResponse, _];
|
|
664
1343
|
});
|
|
665
1344
|
}
|
|
666
|
-
|
|
1345
|
+
/**
|
|
1346
|
+
* Check the status of the long running operation returned by `createAnywhereCache()`.
|
|
1347
|
+
* @param {String} name
|
|
1348
|
+
* The operation name that will be passed.
|
|
1349
|
+
* @returns {Promise} - The promise which resolves to an object.
|
|
1350
|
+
* The decoded operation object has result and metadata field to get information from.
|
|
1351
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
|
|
1352
|
+
* for more details and examples.
|
|
1353
|
+
* @example <caption>include:samples/generated/v2/storage_control.create_anywhere_cache.js</caption>
|
|
1354
|
+
* region_tag:storage_v2_generated_StorageControl_CreateAnywhereCache_async
|
|
1355
|
+
*/
|
|
1356
|
+
async checkCreateAnywhereCacheProgress(name) {
|
|
1357
|
+
this._log.info('createAnywhereCache long-running');
|
|
1358
|
+
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
1359
|
+
const [operation] = await this.operationsClient.getOperation(request);
|
|
1360
|
+
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createAnywhereCache, this._gaxModule.createDefaultBackoffSettings());
|
|
1361
|
+
return decodeOperation;
|
|
1362
|
+
}
|
|
1363
|
+
updateAnywhereCache(request, optionsOrCallback, callback) {
|
|
667
1364
|
request = request || {};
|
|
668
1365
|
if (!request.requestId) {
|
|
669
1366
|
request.requestId = gax.makeUUID();
|
|
@@ -679,54 +1376,48 @@ class StorageControlClient {
|
|
|
679
1376
|
options = options || {};
|
|
680
1377
|
options.otherArgs = options.otherArgs || {};
|
|
681
1378
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
682
|
-
|
|
1379
|
+
let routingParameter = {};
|
|
683
1380
|
{
|
|
684
|
-
const fieldValue = request.name;
|
|
1381
|
+
const fieldValue = request.anywhereCache?.name;
|
|
685
1382
|
if (fieldValue !== undefined && fieldValue !== null) {
|
|
686
|
-
const match = fieldValue
|
|
687
|
-
.toString()
|
|
688
|
-
.match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
1383
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?'));
|
|
689
1384
|
if (match) {
|
|
690
1385
|
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
691
1386
|
Object.assign(routingParameter, { bucket: parameterValue });
|
|
692
1387
|
}
|
|
693
1388
|
}
|
|
694
1389
|
}
|
|
695
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
696
|
-
|
|
697
|
-
this.initialize().catch(err => {
|
|
698
|
-
throw err;
|
|
699
|
-
});
|
|
1390
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
1391
|
+
this.initialize().catch(err => { throw err; });
|
|
700
1392
|
const wrappedCallback = callback
|
|
701
1393
|
? (error, response, rawResponse, _) => {
|
|
702
|
-
this._log.info('
|
|
1394
|
+
this._log.info('updateAnywhereCache response %j', rawResponse);
|
|
703
1395
|
callback(error, response, rawResponse, _); // We verified callback above.
|
|
704
1396
|
}
|
|
705
1397
|
: undefined;
|
|
706
|
-
this._log.info('
|
|
707
|
-
return this.innerApiCalls
|
|
708
|
-
.renameFolder(request, options, wrappedCallback)
|
|
1398
|
+
this._log.info('updateAnywhereCache request %j', request);
|
|
1399
|
+
return this.innerApiCalls.updateAnywhereCache(request, options, wrappedCallback)
|
|
709
1400
|
?.then(([response, rawResponse, _]) => {
|
|
710
|
-
this._log.info('
|
|
1401
|
+
this._log.info('updateAnywhereCache response %j', rawResponse);
|
|
711
1402
|
return [response, rawResponse, _];
|
|
712
1403
|
});
|
|
713
1404
|
}
|
|
714
1405
|
/**
|
|
715
|
-
* Check the status of the long running operation returned by `
|
|
1406
|
+
* Check the status of the long running operation returned by `updateAnywhereCache()`.
|
|
716
1407
|
* @param {String} name
|
|
717
1408
|
* The operation name that will be passed.
|
|
718
1409
|
* @returns {Promise} - The promise which resolves to an object.
|
|
719
1410
|
* The decoded operation object has result and metadata field to get information from.
|
|
720
1411
|
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
|
|
721
1412
|
* for more details and examples.
|
|
722
|
-
* @example <caption>include:samples/generated/v2/storage_control.
|
|
723
|
-
* region_tag:
|
|
1413
|
+
* @example <caption>include:samples/generated/v2/storage_control.update_anywhere_cache.js</caption>
|
|
1414
|
+
* region_tag:storage_v2_generated_StorageControl_UpdateAnywhereCache_async
|
|
724
1415
|
*/
|
|
725
|
-
async
|
|
726
|
-
this._log.info('
|
|
1416
|
+
async checkUpdateAnywhereCacheProgress(name) {
|
|
1417
|
+
this._log.info('updateAnywhereCache long-running');
|
|
727
1418
|
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
728
1419
|
const [operation] = await this.operationsClient.getOperation(request);
|
|
729
|
-
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.
|
|
1420
|
+
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateAnywhereCache, this._gaxModule.createDefaultBackoffSettings());
|
|
730
1421
|
return decodeOperation;
|
|
731
1422
|
}
|
|
732
1423
|
listFolders(request, optionsOrCallback, callback) {
|
|
@@ -742,7 +1433,7 @@ class StorageControlClient {
|
|
|
742
1433
|
options = options || {};
|
|
743
1434
|
options.otherArgs = options.otherArgs || {};
|
|
744
1435
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
745
|
-
|
|
1436
|
+
let routingParameter = {};
|
|
746
1437
|
{
|
|
747
1438
|
const fieldValue = request.parent;
|
|
748
1439
|
if (fieldValue !== undefined && fieldValue !== null) {
|
|
@@ -753,11 +1444,8 @@ class StorageControlClient {
|
|
|
753
1444
|
}
|
|
754
1445
|
}
|
|
755
1446
|
}
|
|
756
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
757
|
-
|
|
758
|
-
this.initialize().catch(err => {
|
|
759
|
-
throw err;
|
|
760
|
-
});
|
|
1447
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
1448
|
+
this.initialize().catch(err => { throw err; });
|
|
761
1449
|
const wrappedCallback = callback
|
|
762
1450
|
? (error, values, nextPageRequest, rawResponse) => {
|
|
763
1451
|
this._log.info('listFolders values %j', values);
|
|
@@ -821,7 +1509,7 @@ class StorageControlClient {
|
|
|
821
1509
|
options = options || {};
|
|
822
1510
|
options.otherArgs = options.otherArgs || {};
|
|
823
1511
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
824
|
-
|
|
1512
|
+
let routingParameter = {};
|
|
825
1513
|
{
|
|
826
1514
|
const fieldValue = request.parent;
|
|
827
1515
|
if (fieldValue !== undefined && fieldValue !== null) {
|
|
@@ -832,13 +1520,10 @@ class StorageControlClient {
|
|
|
832
1520
|
}
|
|
833
1521
|
}
|
|
834
1522
|
}
|
|
835
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
836
|
-
this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
1523
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
837
1524
|
const defaultCallSettings = this._defaults['listFolders'];
|
|
838
1525
|
const callSettings = defaultCallSettings.merge(options);
|
|
839
|
-
this.initialize().catch(err => {
|
|
840
|
-
throw err;
|
|
841
|
-
});
|
|
1526
|
+
this.initialize().catch(err => { throw err; });
|
|
842
1527
|
this._log.info('listFolders stream %j', request);
|
|
843
1528
|
return this.descriptors.page.listFolders.createStream(this.innerApiCalls.listFolders, request, callSettings);
|
|
844
1529
|
}
|
|
@@ -894,7 +1579,7 @@ class StorageControlClient {
|
|
|
894
1579
|
options = options || {};
|
|
895
1580
|
options.otherArgs = options.otherArgs || {};
|
|
896
1581
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
897
|
-
|
|
1582
|
+
let routingParameter = {};
|
|
898
1583
|
{
|
|
899
1584
|
const fieldValue = request.parent;
|
|
900
1585
|
if (fieldValue !== undefined && fieldValue !== null) {
|
|
@@ -905,13 +1590,10 @@ class StorageControlClient {
|
|
|
905
1590
|
}
|
|
906
1591
|
}
|
|
907
1592
|
}
|
|
908
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
909
|
-
this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
1593
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
910
1594
|
const defaultCallSettings = this._defaults['listFolders'];
|
|
911
1595
|
const callSettings = defaultCallSettings.merge(options);
|
|
912
|
-
this.initialize().catch(err => {
|
|
913
|
-
throw err;
|
|
914
|
-
});
|
|
1596
|
+
this.initialize().catch(err => { throw err; });
|
|
915
1597
|
this._log.info('listFolders iterate %j', request);
|
|
916
1598
|
return this.descriptors.page.listFolders.asyncIterate(this.innerApiCalls['listFolders'], request, callSettings);
|
|
917
1599
|
}
|
|
@@ -931,7 +1613,7 @@ class StorageControlClient {
|
|
|
931
1613
|
options = options || {};
|
|
932
1614
|
options.otherArgs = options.otherArgs || {};
|
|
933
1615
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
934
|
-
|
|
1616
|
+
let routingParameter = {};
|
|
935
1617
|
{
|
|
936
1618
|
const fieldValue = request.parent;
|
|
937
1619
|
if (fieldValue !== undefined && fieldValue !== null) {
|
|
@@ -942,11 +1624,8 @@ class StorageControlClient {
|
|
|
942
1624
|
}
|
|
943
1625
|
}
|
|
944
1626
|
}
|
|
945
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
946
|
-
|
|
947
|
-
this.initialize().catch(err => {
|
|
948
|
-
throw err;
|
|
949
|
-
});
|
|
1627
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
1628
|
+
this.initialize().catch(err => { throw err; });
|
|
950
1629
|
const wrappedCallback = callback
|
|
951
1630
|
? (error, values, nextPageRequest, rawResponse) => {
|
|
952
1631
|
this._log.info('listManagedFolders values %j', values);
|
|
@@ -998,7 +1677,7 @@ class StorageControlClient {
|
|
|
998
1677
|
options = options || {};
|
|
999
1678
|
options.otherArgs = options.otherArgs || {};
|
|
1000
1679
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1001
|
-
|
|
1680
|
+
let routingParameter = {};
|
|
1002
1681
|
{
|
|
1003
1682
|
const fieldValue = request.parent;
|
|
1004
1683
|
if (fieldValue !== undefined && fieldValue !== null) {
|
|
@@ -1009,13 +1688,10 @@ class StorageControlClient {
|
|
|
1009
1688
|
}
|
|
1010
1689
|
}
|
|
1011
1690
|
}
|
|
1012
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
1013
|
-
this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
1691
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
1014
1692
|
const defaultCallSettings = this._defaults['listManagedFolders'];
|
|
1015
1693
|
const callSettings = defaultCallSettings.merge(options);
|
|
1016
|
-
this.initialize().catch(err => {
|
|
1017
|
-
throw err;
|
|
1018
|
-
});
|
|
1694
|
+
this.initialize().catch(err => { throw err; });
|
|
1019
1695
|
this._log.info('listManagedFolders stream %j', request);
|
|
1020
1696
|
return this.descriptors.page.listManagedFolders.createStream(this.innerApiCalls.listManagedFolders, request, callSettings);
|
|
1021
1697
|
}
|
|
@@ -1059,7 +1735,7 @@ class StorageControlClient {
|
|
|
1059
1735
|
options = options || {};
|
|
1060
1736
|
options.otherArgs = options.otherArgs || {};
|
|
1061
1737
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1062
|
-
|
|
1738
|
+
let routingParameter = {};
|
|
1063
1739
|
{
|
|
1064
1740
|
const fieldValue = request.parent;
|
|
1065
1741
|
if (fieldValue !== undefined && fieldValue !== null) {
|
|
@@ -1070,46 +1746,193 @@ class StorageControlClient {
|
|
|
1070
1746
|
}
|
|
1071
1747
|
}
|
|
1072
1748
|
}
|
|
1073
|
-
options.otherArgs.headers['x-goog-request-params'] =
|
|
1074
|
-
this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
1749
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
1075
1750
|
const defaultCallSettings = this._defaults['listManagedFolders'];
|
|
1076
1751
|
const callSettings = defaultCallSettings.merge(options);
|
|
1077
|
-
this.initialize().catch(err => {
|
|
1078
|
-
throw err;
|
|
1079
|
-
});
|
|
1752
|
+
this.initialize().catch(err => { throw err; });
|
|
1080
1753
|
this._log.info('listManagedFolders iterate %j', request);
|
|
1081
1754
|
return this.descriptors.page.listManagedFolders.asyncIterate(this.innerApiCalls['listManagedFolders'], request, callSettings);
|
|
1082
1755
|
}
|
|
1756
|
+
listAnywhereCaches(request, optionsOrCallback, callback) {
|
|
1757
|
+
request = request || {};
|
|
1758
|
+
if (!request.requestId) {
|
|
1759
|
+
request.requestId = gax.makeUUID();
|
|
1760
|
+
}
|
|
1761
|
+
let options;
|
|
1762
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
1763
|
+
callback = optionsOrCallback;
|
|
1764
|
+
options = {};
|
|
1765
|
+
}
|
|
1766
|
+
else {
|
|
1767
|
+
options = optionsOrCallback;
|
|
1768
|
+
}
|
|
1769
|
+
options = options || {};
|
|
1770
|
+
options.otherArgs = options.otherArgs || {};
|
|
1771
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1772
|
+
let routingParameter = {};
|
|
1773
|
+
{
|
|
1774
|
+
const fieldValue = request.parent;
|
|
1775
|
+
if (fieldValue !== undefined && fieldValue !== null) {
|
|
1776
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>(?:.*)?)'));
|
|
1777
|
+
if (match) {
|
|
1778
|
+
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
1779
|
+
Object.assign(routingParameter, { bucket: parameterValue });
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
1784
|
+
this.initialize().catch(err => { throw err; });
|
|
1785
|
+
const wrappedCallback = callback
|
|
1786
|
+
? (error, values, nextPageRequest, rawResponse) => {
|
|
1787
|
+
this._log.info('listAnywhereCaches values %j', values);
|
|
1788
|
+
callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
|
|
1789
|
+
}
|
|
1790
|
+
: undefined;
|
|
1791
|
+
this._log.info('listAnywhereCaches request %j', request);
|
|
1792
|
+
return this.innerApiCalls
|
|
1793
|
+
.listAnywhereCaches(request, options, wrappedCallback)
|
|
1794
|
+
?.then(([response, input, output]) => {
|
|
1795
|
+
this._log.info('listAnywhereCaches values %j', response);
|
|
1796
|
+
return [response, input, output];
|
|
1797
|
+
});
|
|
1798
|
+
}
|
|
1083
1799
|
/**
|
|
1084
|
-
*
|
|
1085
|
-
*
|
|
1086
|
-
*
|
|
1087
|
-
*
|
|
1088
|
-
*
|
|
1089
|
-
* @param {
|
|
1090
|
-
*
|
|
1091
|
-
*
|
|
1092
|
-
*
|
|
1093
|
-
*
|
|
1094
|
-
*
|
|
1095
|
-
* @param {
|
|
1096
|
-
*
|
|
1097
|
-
*
|
|
1098
|
-
*
|
|
1099
|
-
* {@link google.
|
|
1100
|
-
* @
|
|
1101
|
-
*
|
|
1102
|
-
*
|
|
1103
|
-
*
|
|
1800
|
+
* Equivalent to `listAnywhereCaches`, but returns a NodeJS Stream object.
|
|
1801
|
+
* @param {Object} request
|
|
1802
|
+
* The request object that will be sent.
|
|
1803
|
+
* @param {string} request.parent
|
|
1804
|
+
* Required. The bucket to which this cache belongs.
|
|
1805
|
+
* @param {number} request.pageSize
|
|
1806
|
+
* Maximum number of caches to return in a single response.
|
|
1807
|
+
* The service will use this parameter or 1,000 items, whichever is smaller.
|
|
1808
|
+
* @param {string} request.pageToken
|
|
1809
|
+
* A previously-returned page token representing part of the larger set of
|
|
1810
|
+
* results to view.
|
|
1811
|
+
* @param {string} [request.requestId]
|
|
1812
|
+
* Optional. A unique identifier for this request. UUID is the recommended
|
|
1813
|
+
* format, but other formats are still accepted.
|
|
1814
|
+
* @param {object} [options]
|
|
1815
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1816
|
+
* @returns {Stream}
|
|
1817
|
+
* An object stream which emits an object representing {@link protos.google.storage.control.v2.AnywhereCache|AnywhereCache} on 'data' event.
|
|
1818
|
+
* The client library will perform auto-pagination by default: it will call the API as many
|
|
1819
|
+
* times as needed. Note that it can affect your quota.
|
|
1820
|
+
* We recommend using `listAnywhereCachesAsync()`
|
|
1821
|
+
* method described below for async iteration which you can stop as needed.
|
|
1822
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
1823
|
+
* for more details and examples.
|
|
1824
|
+
*/
|
|
1825
|
+
listAnywhereCachesStream(request, options) {
|
|
1826
|
+
request = request || {};
|
|
1827
|
+
if (!request.requestId) {
|
|
1828
|
+
request.requestId = gax.makeUUID();
|
|
1829
|
+
}
|
|
1830
|
+
options = options || {};
|
|
1831
|
+
options.otherArgs = options.otherArgs || {};
|
|
1832
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1833
|
+
let routingParameter = {};
|
|
1834
|
+
{
|
|
1835
|
+
const fieldValue = request.parent;
|
|
1836
|
+
if (fieldValue !== undefined && fieldValue !== null) {
|
|
1837
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>(?:.*)?)'));
|
|
1838
|
+
if (match) {
|
|
1839
|
+
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
1840
|
+
Object.assign(routingParameter, { bucket: parameterValue });
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
1845
|
+
const defaultCallSettings = this._defaults['listAnywhereCaches'];
|
|
1846
|
+
const callSettings = defaultCallSettings.merge(options);
|
|
1847
|
+
this.initialize().catch(err => { throw err; });
|
|
1848
|
+
this._log.info('listAnywhereCaches stream %j', request);
|
|
1849
|
+
return this.descriptors.page.listAnywhereCaches.createStream(this.innerApiCalls.listAnywhereCaches, request, callSettings);
|
|
1850
|
+
}
|
|
1851
|
+
/**
|
|
1852
|
+
* Equivalent to `listAnywhereCaches`, but returns an iterable object.
|
|
1104
1853
|
*
|
|
1105
|
-
*
|
|
1106
|
-
*
|
|
1107
|
-
*
|
|
1108
|
-
*
|
|
1109
|
-
*
|
|
1110
|
-
*
|
|
1111
|
-
*
|
|
1854
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
|
1855
|
+
* @param {Object} request
|
|
1856
|
+
* The request object that will be sent.
|
|
1857
|
+
* @param {string} request.parent
|
|
1858
|
+
* Required. The bucket to which this cache belongs.
|
|
1859
|
+
* @param {number} request.pageSize
|
|
1860
|
+
* Maximum number of caches to return in a single response.
|
|
1861
|
+
* The service will use this parameter or 1,000 items, whichever is smaller.
|
|
1862
|
+
* @param {string} request.pageToken
|
|
1863
|
+
* A previously-returned page token representing part of the larger set of
|
|
1864
|
+
* results to view.
|
|
1865
|
+
* @param {string} [request.requestId]
|
|
1866
|
+
* Optional. A unique identifier for this request. UUID is the recommended
|
|
1867
|
+
* format, but other formats are still accepted.
|
|
1868
|
+
* @param {object} [options]
|
|
1869
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1870
|
+
* @returns {Object}
|
|
1871
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
|
1872
|
+
* When you iterate the returned iterable, each element will be an object representing
|
|
1873
|
+
* {@link protos.google.storage.control.v2.AnywhereCache|AnywhereCache}. The API will be called under the hood as needed, once per the page,
|
|
1874
|
+
* so you can stop the iteration when you don't need more results.
|
|
1875
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
1876
|
+
* for more details and examples.
|
|
1877
|
+
* @example <caption>include:samples/generated/v2/storage_control.list_anywhere_caches.js</caption>
|
|
1878
|
+
* region_tag:storage_v2_generated_StorageControl_ListAnywhereCaches_async
|
|
1112
1879
|
*/
|
|
1880
|
+
listAnywhereCachesAsync(request, options) {
|
|
1881
|
+
request = request || {};
|
|
1882
|
+
if (!request.requestId) {
|
|
1883
|
+
request.requestId = gax.makeUUID();
|
|
1884
|
+
}
|
|
1885
|
+
options = options || {};
|
|
1886
|
+
options.otherArgs = options.otherArgs || {};
|
|
1887
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1888
|
+
let routingParameter = {};
|
|
1889
|
+
{
|
|
1890
|
+
const fieldValue = request.parent;
|
|
1891
|
+
if (fieldValue !== undefined && fieldValue !== null) {
|
|
1892
|
+
const match = fieldValue.toString().match(RegExp('(?<bucket>(?:.*)?)'));
|
|
1893
|
+
if (match) {
|
|
1894
|
+
const parameterValue = match.groups?.['bucket'] ?? fieldValue;
|
|
1895
|
+
Object.assign(routingParameter, { bucket: parameterValue });
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams(routingParameter);
|
|
1900
|
+
const defaultCallSettings = this._defaults['listAnywhereCaches'];
|
|
1901
|
+
const callSettings = defaultCallSettings.merge(options);
|
|
1902
|
+
this.initialize().catch(err => { throw err; });
|
|
1903
|
+
this._log.info('listAnywhereCaches iterate %j', request);
|
|
1904
|
+
return this.descriptors.page.listAnywhereCaches.asyncIterate(this.innerApiCalls['listAnywhereCaches'], request, callSettings);
|
|
1905
|
+
}
|
|
1906
|
+
/**
|
|
1907
|
+
* Gets the latest state of a long-running operation. Clients can use this
|
|
1908
|
+
* method to poll the operation result at intervals as recommended by the API
|
|
1909
|
+
* service.
|
|
1910
|
+
*
|
|
1911
|
+
* @param {Object} request - The request object that will be sent.
|
|
1912
|
+
* @param {string} request.name - The name of the operation resource.
|
|
1913
|
+
* @param {Object=} options
|
|
1914
|
+
* Optional parameters. You can override the default settings for this call,
|
|
1915
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
|
1916
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
|
|
1917
|
+
* for the details.
|
|
1918
|
+
* @param {function(?Error, ?Object)=} callback
|
|
1919
|
+
* The function which will be called with the result of the API call.
|
|
1920
|
+
*
|
|
1921
|
+
* The second parameter to the callback is an object representing
|
|
1922
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
|
1923
|
+
* @return {Promise} - The promise which resolves to an array.
|
|
1924
|
+
* The first element of the array is an object representing
|
|
1925
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
|
1926
|
+
* The promise has a method named "cancel" which cancels the ongoing API call.
|
|
1927
|
+
*
|
|
1928
|
+
* @example
|
|
1929
|
+
* ```
|
|
1930
|
+
* const client = longrunning.operationsClient();
|
|
1931
|
+
* const name = '';
|
|
1932
|
+
* const [response] = await client.getOperation({name});
|
|
1933
|
+
* // doThingsWith(response)
|
|
1934
|
+
* ```
|
|
1935
|
+
*/
|
|
1113
1936
|
getOperation(request, optionsOrCallback, callback) {
|
|
1114
1937
|
let options;
|
|
1115
1938
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -1263,6 +2086,51 @@ class StorageControlClient {
|
|
|
1263
2086
|
// --------------------
|
|
1264
2087
|
// -- Path templates --
|
|
1265
2088
|
// --------------------
|
|
2089
|
+
/**
|
|
2090
|
+
* Return a fully-qualified anywhereCache resource name string.
|
|
2091
|
+
*
|
|
2092
|
+
* @param {string} project
|
|
2093
|
+
* @param {string} bucket
|
|
2094
|
+
* @param {string} anywhere_cache
|
|
2095
|
+
* @returns {string} Resource name string.
|
|
2096
|
+
*/
|
|
2097
|
+
anywhereCachePath(project, bucket, anywhereCache) {
|
|
2098
|
+
return this.pathTemplates.anywhereCachePathTemplate.render({
|
|
2099
|
+
project: project,
|
|
2100
|
+
bucket: bucket,
|
|
2101
|
+
anywhere_cache: anywhereCache,
|
|
2102
|
+
});
|
|
2103
|
+
}
|
|
2104
|
+
/**
|
|
2105
|
+
* Parse the project from AnywhereCache resource.
|
|
2106
|
+
*
|
|
2107
|
+
* @param {string} anywhereCacheName
|
|
2108
|
+
* A fully-qualified path representing AnywhereCache resource.
|
|
2109
|
+
* @returns {string} A string representing the project.
|
|
2110
|
+
*/
|
|
2111
|
+
matchProjectFromAnywhereCacheName(anywhereCacheName) {
|
|
2112
|
+
return this.pathTemplates.anywhereCachePathTemplate.match(anywhereCacheName).project;
|
|
2113
|
+
}
|
|
2114
|
+
/**
|
|
2115
|
+
* Parse the bucket from AnywhereCache resource.
|
|
2116
|
+
*
|
|
2117
|
+
* @param {string} anywhereCacheName
|
|
2118
|
+
* A fully-qualified path representing AnywhereCache resource.
|
|
2119
|
+
* @returns {string} A string representing the bucket.
|
|
2120
|
+
*/
|
|
2121
|
+
matchBucketFromAnywhereCacheName(anywhereCacheName) {
|
|
2122
|
+
return this.pathTemplates.anywhereCachePathTemplate.match(anywhereCacheName).bucket;
|
|
2123
|
+
}
|
|
2124
|
+
/**
|
|
2125
|
+
* Parse the anywhere_cache from AnywhereCache resource.
|
|
2126
|
+
*
|
|
2127
|
+
* @param {string} anywhereCacheName
|
|
2128
|
+
* A fully-qualified path representing AnywhereCache resource.
|
|
2129
|
+
* @returns {string} A string representing the anywhere_cache.
|
|
2130
|
+
*/
|
|
2131
|
+
matchAnywhereCacheFromAnywhereCacheName(anywhereCacheName) {
|
|
2132
|
+
return this.pathTemplates.anywhereCachePathTemplate.match(anywhereCacheName).anywhere_cache;
|
|
2133
|
+
}
|
|
1266
2134
|
/**
|
|
1267
2135
|
* Return a fully-qualified bucket resource name string.
|
|
1268
2136
|
*
|
|
@@ -1341,6 +2209,39 @@ class StorageControlClient {
|
|
|
1341
2209
|
matchFolderFromFolderName(folderName) {
|
|
1342
2210
|
return this.pathTemplates.folderPathTemplate.match(folderName).folder;
|
|
1343
2211
|
}
|
|
2212
|
+
/**
|
|
2213
|
+
* Return a fully-qualified folderLocationIntelligenceConfig resource name string.
|
|
2214
|
+
*
|
|
2215
|
+
* @param {string} folder
|
|
2216
|
+
* @param {string} location
|
|
2217
|
+
* @returns {string} Resource name string.
|
|
2218
|
+
*/
|
|
2219
|
+
folderLocationIntelligenceConfigPath(folder, location) {
|
|
2220
|
+
return this.pathTemplates.folderLocationIntelligenceConfigPathTemplate.render({
|
|
2221
|
+
folder: folder,
|
|
2222
|
+
location: location,
|
|
2223
|
+
});
|
|
2224
|
+
}
|
|
2225
|
+
/**
|
|
2226
|
+
* Parse the folder from FolderLocationIntelligenceConfig resource.
|
|
2227
|
+
*
|
|
2228
|
+
* @param {string} folderLocationIntelligenceConfigName
|
|
2229
|
+
* A fully-qualified path representing folder_location_intelligenceConfig resource.
|
|
2230
|
+
* @returns {string} A string representing the folder.
|
|
2231
|
+
*/
|
|
2232
|
+
matchFolderFromFolderLocationIntelligenceConfigName(folderLocationIntelligenceConfigName) {
|
|
2233
|
+
return this.pathTemplates.folderLocationIntelligenceConfigPathTemplate.match(folderLocationIntelligenceConfigName).folder;
|
|
2234
|
+
}
|
|
2235
|
+
/**
|
|
2236
|
+
* Parse the location from FolderLocationIntelligenceConfig resource.
|
|
2237
|
+
*
|
|
2238
|
+
* @param {string} folderLocationIntelligenceConfigName
|
|
2239
|
+
* A fully-qualified path representing folder_location_intelligenceConfig resource.
|
|
2240
|
+
* @returns {string} A string representing the location.
|
|
2241
|
+
*/
|
|
2242
|
+
matchLocationFromFolderLocationIntelligenceConfigName(folderLocationIntelligenceConfigName) {
|
|
2243
|
+
return this.pathTemplates.folderLocationIntelligenceConfigPathTemplate.match(folderLocationIntelligenceConfigName).location;
|
|
2244
|
+
}
|
|
1344
2245
|
/**
|
|
1345
2246
|
* Return a fully-qualified managedFolder resource name string.
|
|
1346
2247
|
*
|
|
@@ -1364,8 +2265,7 @@ class StorageControlClient {
|
|
|
1364
2265
|
* @returns {string} A string representing the project.
|
|
1365
2266
|
*/
|
|
1366
2267
|
matchProjectFromManagedFolderName(managedFolderName) {
|
|
1367
|
-
return this.pathTemplates.managedFolderPathTemplate.match(managedFolderName)
|
|
1368
|
-
.project;
|
|
2268
|
+
return this.pathTemplates.managedFolderPathTemplate.match(managedFolderName).project;
|
|
1369
2269
|
}
|
|
1370
2270
|
/**
|
|
1371
2271
|
* Parse the bucket from ManagedFolder resource.
|
|
@@ -1375,8 +2275,7 @@ class StorageControlClient {
|
|
|
1375
2275
|
* @returns {string} A string representing the bucket.
|
|
1376
2276
|
*/
|
|
1377
2277
|
matchBucketFromManagedFolderName(managedFolderName) {
|
|
1378
|
-
return this.pathTemplates.managedFolderPathTemplate.match(managedFolderName)
|
|
1379
|
-
.bucket;
|
|
2278
|
+
return this.pathTemplates.managedFolderPathTemplate.match(managedFolderName).bucket;
|
|
1380
2279
|
}
|
|
1381
2280
|
/**
|
|
1382
2281
|
* Parse the managed_folder from ManagedFolder resource.
|
|
@@ -1386,8 +2285,40 @@ class StorageControlClient {
|
|
|
1386
2285
|
* @returns {string} A string representing the managed_folder.
|
|
1387
2286
|
*/
|
|
1388
2287
|
matchManagedFolderFromManagedFolderName(managedFolderName) {
|
|
1389
|
-
return this.pathTemplates.managedFolderPathTemplate.match(managedFolderName)
|
|
1390
|
-
|
|
2288
|
+
return this.pathTemplates.managedFolderPathTemplate.match(managedFolderName).managed_folder;
|
|
2289
|
+
}
|
|
2290
|
+
/**
|
|
2291
|
+
* Return a fully-qualified orgLocationIntelligenceConfig resource name string.
|
|
2292
|
+
*
|
|
2293
|
+
* @param {string} org
|
|
2294
|
+
* @param {string} location
|
|
2295
|
+
* @returns {string} Resource name string.
|
|
2296
|
+
*/
|
|
2297
|
+
orgLocationIntelligenceConfigPath(org, location) {
|
|
2298
|
+
return this.pathTemplates.orgLocationIntelligenceConfigPathTemplate.render({
|
|
2299
|
+
org: org,
|
|
2300
|
+
location: location,
|
|
2301
|
+
});
|
|
2302
|
+
}
|
|
2303
|
+
/**
|
|
2304
|
+
* Parse the org from OrgLocationIntelligenceConfig resource.
|
|
2305
|
+
*
|
|
2306
|
+
* @param {string} orgLocationIntelligenceConfigName
|
|
2307
|
+
* A fully-qualified path representing org_location_intelligenceConfig resource.
|
|
2308
|
+
* @returns {string} A string representing the org.
|
|
2309
|
+
*/
|
|
2310
|
+
matchOrgFromOrgLocationIntelligenceConfigName(orgLocationIntelligenceConfigName) {
|
|
2311
|
+
return this.pathTemplates.orgLocationIntelligenceConfigPathTemplate.match(orgLocationIntelligenceConfigName).org;
|
|
2312
|
+
}
|
|
2313
|
+
/**
|
|
2314
|
+
* Parse the location from OrgLocationIntelligenceConfig resource.
|
|
2315
|
+
*
|
|
2316
|
+
* @param {string} orgLocationIntelligenceConfigName
|
|
2317
|
+
* A fully-qualified path representing org_location_intelligenceConfig resource.
|
|
2318
|
+
* @returns {string} A string representing the location.
|
|
2319
|
+
*/
|
|
2320
|
+
matchLocationFromOrgLocationIntelligenceConfigName(orgLocationIntelligenceConfigName) {
|
|
2321
|
+
return this.pathTemplates.orgLocationIntelligenceConfigPathTemplate.match(orgLocationIntelligenceConfigName).location;
|
|
1391
2322
|
}
|
|
1392
2323
|
/**
|
|
1393
2324
|
* Return a fully-qualified project resource name string.
|
|
@@ -1410,6 +2341,39 @@ class StorageControlClient {
|
|
|
1410
2341
|
matchProjectFromProjectName(projectName) {
|
|
1411
2342
|
return this.pathTemplates.projectPathTemplate.match(projectName).project;
|
|
1412
2343
|
}
|
|
2344
|
+
/**
|
|
2345
|
+
* Return a fully-qualified projectLocationIntelligenceConfig resource name string.
|
|
2346
|
+
*
|
|
2347
|
+
* @param {string} project
|
|
2348
|
+
* @param {string} location
|
|
2349
|
+
* @returns {string} Resource name string.
|
|
2350
|
+
*/
|
|
2351
|
+
projectLocationIntelligenceConfigPath(project, location) {
|
|
2352
|
+
return this.pathTemplates.projectLocationIntelligenceConfigPathTemplate.render({
|
|
2353
|
+
project: project,
|
|
2354
|
+
location: location,
|
|
2355
|
+
});
|
|
2356
|
+
}
|
|
2357
|
+
/**
|
|
2358
|
+
* Parse the project from ProjectLocationIntelligenceConfig resource.
|
|
2359
|
+
*
|
|
2360
|
+
* @param {string} projectLocationIntelligenceConfigName
|
|
2361
|
+
* A fully-qualified path representing project_location_intelligenceConfig resource.
|
|
2362
|
+
* @returns {string} A string representing the project.
|
|
2363
|
+
*/
|
|
2364
|
+
matchProjectFromProjectLocationIntelligenceConfigName(projectLocationIntelligenceConfigName) {
|
|
2365
|
+
return this.pathTemplates.projectLocationIntelligenceConfigPathTemplate.match(projectLocationIntelligenceConfigName).project;
|
|
2366
|
+
}
|
|
2367
|
+
/**
|
|
2368
|
+
* Parse the location from ProjectLocationIntelligenceConfig resource.
|
|
2369
|
+
*
|
|
2370
|
+
* @param {string} projectLocationIntelligenceConfigName
|
|
2371
|
+
* A fully-qualified path representing project_location_intelligenceConfig resource.
|
|
2372
|
+
* @returns {string} A string representing the location.
|
|
2373
|
+
*/
|
|
2374
|
+
matchLocationFromProjectLocationIntelligenceConfigName(projectLocationIntelligenceConfigName) {
|
|
2375
|
+
return this.pathTemplates.projectLocationIntelligenceConfigPathTemplate.match(projectLocationIntelligenceConfigName).location;
|
|
2376
|
+
}
|
|
1413
2377
|
/**
|
|
1414
2378
|
* Return a fully-qualified storageLayout resource name string.
|
|
1415
2379
|
*
|
|
@@ -1431,8 +2395,7 @@ class StorageControlClient {
|
|
|
1431
2395
|
* @returns {string} A string representing the project.
|
|
1432
2396
|
*/
|
|
1433
2397
|
matchProjectFromStorageLayoutName(storageLayoutName) {
|
|
1434
|
-
return this.pathTemplates.storageLayoutPathTemplate.match(storageLayoutName)
|
|
1435
|
-
.project;
|
|
2398
|
+
return this.pathTemplates.storageLayoutPathTemplate.match(storageLayoutName).project;
|
|
1436
2399
|
}
|
|
1437
2400
|
/**
|
|
1438
2401
|
* Parse the bucket from StorageLayout resource.
|
|
@@ -1442,8 +2405,7 @@ class StorageControlClient {
|
|
|
1442
2405
|
* @returns {string} A string representing the bucket.
|
|
1443
2406
|
*/
|
|
1444
2407
|
matchBucketFromStorageLayoutName(storageLayoutName) {
|
|
1445
|
-
return this.pathTemplates.storageLayoutPathTemplate.match(storageLayoutName)
|
|
1446
|
-
.bucket;
|
|
2408
|
+
return this.pathTemplates.storageLayoutPathTemplate.match(storageLayoutName).bucket;
|
|
1447
2409
|
}
|
|
1448
2410
|
/**
|
|
1449
2411
|
* Terminate the gRPC channel and close the client.
|
|
@@ -1457,7 +2419,7 @@ class StorageControlClient {
|
|
|
1457
2419
|
this._log.info('ending gRPC channel');
|
|
1458
2420
|
this._terminated = true;
|
|
1459
2421
|
stub.close();
|
|
1460
|
-
this.operationsClient.close();
|
|
2422
|
+
void this.operationsClient.close();
|
|
1461
2423
|
});
|
|
1462
2424
|
}
|
|
1463
2425
|
return Promise.resolve();
|