@google-cloud/filestore
Advanced tools
Comparing version
/// <reference types="node" /> | ||
import * as gax from 'google-gax'; | ||
import { Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback } from 'google-gax'; | ||
import type * as gax from 'google-gax'; | ||
import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback } from 'google-gax'; | ||
import { Transform } from 'stream'; | ||
@@ -82,4 +82,11 @@ import * as protos from '../../protos/protos'; | ||
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. | ||
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you | ||
* need to avoid loading the default gRPC version and want to use the fallback | ||
* HTTP implementation. Load only fallback version and pass it to the constructor: | ||
* ``` | ||
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC | ||
* const client = new CloudFilestoreManagerClient({fallback: 'rest'}, gax); | ||
* ``` | ||
*/ | ||
constructor(opts?: ClientOptions); | ||
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback); | ||
/** | ||
@@ -86,0 +93,0 @@ * Initialize the client. |
@@ -21,4 +21,2 @@ "use strict"; | ||
exports.CloudFilestoreManagerClient = void 0; | ||
/* global window */ | ||
const gax = require("google-gax"); | ||
const jsonProtos = require("../../protos/protos.json"); | ||
@@ -31,3 +29,2 @@ /** | ||
const gapicConfig = require("./cloud_filestore_manager_client_config.json"); | ||
const google_gax_1 = require("google-gax"); | ||
const version = require('../../../package.json').version; | ||
@@ -90,4 +87,11 @@ /** | ||
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. | ||
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you | ||
* need to avoid loading the default gRPC version and want to use the fallback | ||
* HTTP implementation. Load only fallback version and pass it to the constructor: | ||
* ``` | ||
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC | ||
* const client = new CloudFilestoreManagerClient({fallback: 'rest'}, gax); | ||
* ``` | ||
*/ | ||
constructor(opts) { | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
@@ -114,4 +118,8 @@ this._terminated = false; | ||
} | ||
// Load google-gax module synchronously if needed | ||
if (!gaxInstance) { | ||
gaxInstance = require('google-gax'); | ||
} | ||
// Choose either gRPC or proto-over-HTTP implementation of google-gax. | ||
this._gaxModule = opts.fallback ? gax.fallback : gax; | ||
this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; | ||
// Create a `gaxGrpc` object, with any grpc-specific options sent to the client. | ||
@@ -236,3 +244,3 @@ this._gaxGrpc = new this._gaxModule.GrpcClient(opts); | ||
// Add a warn function to the client constructor so it can be easily tested. | ||
this.warn = gax.warn; | ||
this.warn = this._gaxModule.warn; | ||
} | ||
@@ -289,3 +297,3 @@ /** | ||
undefined; | ||
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor); | ||
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback); | ||
this.innerApiCalls[methodName] = apiCall; | ||
@@ -337,2 +345,3 @@ } | ||
getInstance(request, optionsOrCallback, callback) { | ||
var _a; | ||
request = request || {}; | ||
@@ -351,4 +360,4 @@ let options; | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
name: request.name || '', | ||
this._gaxModule.routingHeader.fromParams({ | ||
name: (_a = request.name) !== null && _a !== void 0 ? _a : '', | ||
}); | ||
@@ -359,2 +368,3 @@ this.initialize(); | ||
getBackup(request, optionsOrCallback, callback) { | ||
var _a; | ||
request = request || {}; | ||
@@ -373,4 +383,4 @@ let options; | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
name: request.name || '', | ||
this._gaxModule.routingHeader.fromParams({ | ||
name: (_a = request.name) !== null && _a !== void 0 ? _a : '', | ||
}); | ||
@@ -381,2 +391,3 @@ this.initialize(); | ||
createInstance(request, optionsOrCallback, callback) { | ||
var _a; | ||
request = request || {}; | ||
@@ -395,4 +406,4 @@ let options; | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
this._gaxModule.routingHeader.fromParams({ | ||
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '', | ||
}); | ||
@@ -415,8 +426,9 @@ this.initialize(); | ||
async checkCreateInstanceProgress(name) { | ||
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const [operation] = await this.operationsClient.getOperation(request); | ||
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createInstance, gax.createDefaultBackoffSettings()); | ||
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings()); | ||
return decodeOperation; | ||
} | ||
updateInstance(request, optionsOrCallback, callback) { | ||
var _a; | ||
request = request || {}; | ||
@@ -435,4 +447,4 @@ let options; | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
'instance.name': request.instance.name || '', | ||
this._gaxModule.routingHeader.fromParams({ | ||
'instance.name': (_a = request.instance.name) !== null && _a !== void 0 ? _a : '', | ||
}); | ||
@@ -455,8 +467,9 @@ this.initialize(); | ||
async checkUpdateInstanceProgress(name) { | ||
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const [operation] = await this.operationsClient.getOperation(request); | ||
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateInstance, gax.createDefaultBackoffSettings()); | ||
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstance, this._gaxModule.createDefaultBackoffSettings()); | ||
return decodeOperation; | ||
} | ||
restoreInstance(request, optionsOrCallback, callback) { | ||
var _a; | ||
request = request || {}; | ||
@@ -475,4 +488,4 @@ let options; | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
name: request.name || '', | ||
this._gaxModule.routingHeader.fromParams({ | ||
name: (_a = request.name) !== null && _a !== void 0 ? _a : '', | ||
}); | ||
@@ -495,8 +508,9 @@ this.initialize(); | ||
async checkRestoreInstanceProgress(name) { | ||
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const [operation] = await this.operationsClient.getOperation(request); | ||
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.restoreInstance, gax.createDefaultBackoffSettings()); | ||
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreInstance, this._gaxModule.createDefaultBackoffSettings()); | ||
return decodeOperation; | ||
} | ||
deleteInstance(request, optionsOrCallback, callback) { | ||
var _a; | ||
request = request || {}; | ||
@@ -515,4 +529,4 @@ let options; | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
name: request.name || '', | ||
this._gaxModule.routingHeader.fromParams({ | ||
name: (_a = request.name) !== null && _a !== void 0 ? _a : '', | ||
}); | ||
@@ -535,8 +549,9 @@ this.initialize(); | ||
async checkDeleteInstanceProgress(name) { | ||
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const [operation] = await this.operationsClient.getOperation(request); | ||
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteInstance, gax.createDefaultBackoffSettings()); | ||
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteInstance, this._gaxModule.createDefaultBackoffSettings()); | ||
return decodeOperation; | ||
} | ||
createBackup(request, optionsOrCallback, callback) { | ||
var _a; | ||
request = request || {}; | ||
@@ -555,4 +570,4 @@ let options; | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
this._gaxModule.routingHeader.fromParams({ | ||
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '', | ||
}); | ||
@@ -575,8 +590,9 @@ this.initialize(); | ||
async checkCreateBackupProgress(name) { | ||
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const [operation] = await this.operationsClient.getOperation(request); | ||
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createBackup, gax.createDefaultBackoffSettings()); | ||
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createBackup, this._gaxModule.createDefaultBackoffSettings()); | ||
return decodeOperation; | ||
} | ||
deleteBackup(request, optionsOrCallback, callback) { | ||
var _a; | ||
request = request || {}; | ||
@@ -595,4 +611,4 @@ let options; | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
name: request.name || '', | ||
this._gaxModule.routingHeader.fromParams({ | ||
name: (_a = request.name) !== null && _a !== void 0 ? _a : '', | ||
}); | ||
@@ -615,8 +631,9 @@ this.initialize(); | ||
async checkDeleteBackupProgress(name) { | ||
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const [operation] = await this.operationsClient.getOperation(request); | ||
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteBackup, gax.createDefaultBackoffSettings()); | ||
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteBackup, this._gaxModule.createDefaultBackoffSettings()); | ||
return decodeOperation; | ||
} | ||
updateBackup(request, optionsOrCallback, callback) { | ||
var _a; | ||
request = request || {}; | ||
@@ -635,4 +652,4 @@ let options; | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
'backup.name': request.backup.name || '', | ||
this._gaxModule.routingHeader.fromParams({ | ||
'backup.name': (_a = request.backup.name) !== null && _a !== void 0 ? _a : '', | ||
}); | ||
@@ -655,8 +672,9 @@ this.initialize(); | ||
async checkUpdateBackupProgress(name) { | ||
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const [operation] = await this.operationsClient.getOperation(request); | ||
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateBackup, gax.createDefaultBackoffSettings()); | ||
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateBackup, this._gaxModule.createDefaultBackoffSettings()); | ||
return decodeOperation; | ||
} | ||
listInstances(request, optionsOrCallback, callback) { | ||
var _a; | ||
request = request || {}; | ||
@@ -675,4 +693,4 @@ let options; | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
this._gaxModule.routingHeader.fromParams({ | ||
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '', | ||
}); | ||
@@ -714,2 +732,3 @@ this.initialize(); | ||
listInstancesStream(request, options) { | ||
var _a; | ||
request = request || {}; | ||
@@ -720,4 +739,4 @@ options = options || {}; | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
this._gaxModule.routingHeader.fromParams({ | ||
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '', | ||
}); | ||
@@ -764,2 +783,3 @@ const defaultCallSettings = this._defaults['listInstances']; | ||
listInstancesAsync(request, options) { | ||
var _a; | ||
request = request || {}; | ||
@@ -770,4 +790,4 @@ options = options || {}; | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
this._gaxModule.routingHeader.fromParams({ | ||
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '', | ||
}); | ||
@@ -780,2 +800,3 @@ const defaultCallSettings = this._defaults['listInstances']; | ||
listBackups(request, optionsOrCallback, callback) { | ||
var _a; | ||
request = request || {}; | ||
@@ -794,4 +815,4 @@ let options; | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
this._gaxModule.routingHeader.fromParams({ | ||
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '', | ||
}); | ||
@@ -834,2 +855,3 @@ this.initialize(); | ||
listBackupsStream(request, options) { | ||
var _a; | ||
request = request || {}; | ||
@@ -840,4 +862,4 @@ options = options || {}; | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
this._gaxModule.routingHeader.fromParams({ | ||
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '', | ||
}); | ||
@@ -885,2 +907,3 @@ const defaultCallSettings = this._defaults['listBackups']; | ||
listBackupsAsync(request, options) { | ||
var _a; | ||
request = request || {}; | ||
@@ -891,4 +914,4 @@ options = options || {}; | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
this._gaxModule.routingHeader.fromParams({ | ||
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '', | ||
}); | ||
@@ -895,0 +918,0 @@ const defaultCallSettings = this._defaults['listBackups']; |
@@ -60,2 +60,6 @@ { | ||
}, | ||
"RevertInstance": { | ||
"retry_codes_name": "non_idempotent", | ||
"retry_params_name": "default" | ||
}, | ||
"DeleteInstance": { | ||
@@ -66,2 +70,26 @@ "timeout_millis": 600000, | ||
}, | ||
"ListSnapshots": { | ||
"timeout_millis": 60000, | ||
"retry_codes_name": "unavailable", | ||
"retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" | ||
}, | ||
"GetSnapshot": { | ||
"retry_codes_name": "non_idempotent", | ||
"retry_params_name": "default" | ||
}, | ||
"CreateSnapshot": { | ||
"timeout_millis": 600000, | ||
"retry_codes_name": "non_idempotent", | ||
"retry_params_name": "default" | ||
}, | ||
"DeleteSnapshot": { | ||
"timeout_millis": 600000, | ||
"retry_codes_name": "non_idempotent", | ||
"retry_params_name": "default" | ||
}, | ||
"UpdateSnapshot": { | ||
"timeout_millis": 600000, | ||
"retry_codes_name": "non_idempotent", | ||
"retry_params_name": "default" | ||
}, | ||
"ListBackups": { | ||
@@ -91,2 +119,22 @@ "timeout_millis": 60000, | ||
"retry_params_name": "default" | ||
}, | ||
"ListShares": { | ||
"retry_codes_name": "non_idempotent", | ||
"retry_params_name": "default" | ||
}, | ||
"GetShare": { | ||
"retry_codes_name": "non_idempotent", | ||
"retry_params_name": "default" | ||
}, | ||
"CreateShare": { | ||
"retry_codes_name": "non_idempotent", | ||
"retry_params_name": "default" | ||
}, | ||
"DeleteShare": { | ||
"retry_codes_name": "non_idempotent", | ||
"retry_params_name": "default" | ||
}, | ||
"UpdateShare": { | ||
"retry_codes_name": "non_idempotent", | ||
"retry_params_name": "default" | ||
} | ||
@@ -93,0 +141,0 @@ } |
# Changelog | ||
## [2.2.0](https://github.com/googleapis/nodejs-filestore/compare/v2.1.0...v2.2.0) (2022-11-11) | ||
### Features | ||
* New APIs added to reflect updates to the filestore service ([#93](https://github.com/googleapis/nodejs-filestore/issues/93)) ([619e7f1](https://github.com/googleapis/nodejs-filestore/commit/619e7f142a621303afc58b38261711d33584ea5f)) | ||
### Bug Fixes | ||
* Allow passing gax instance to client constructor ([#82](https://github.com/googleapis/nodejs-filestore/issues/82)) ([37a928b](https://github.com/googleapis/nodejs-filestore/commit/37a928bf3c049d0cd66e4efa5d41717fa5ff9a28)) | ||
* Better support for fallback mode ([#77](https://github.com/googleapis/nodejs-filestore/issues/77)) ([c339f3f](https://github.com/googleapis/nodejs-filestore/commit/c339f3f49c0a10fd2d42a64de20a9d2f06ae061e)) | ||
* Change import long to require ([#78](https://github.com/googleapis/nodejs-filestore/issues/78)) ([c9ce9d1](https://github.com/googleapis/nodejs-filestore/commit/c9ce9d147dd1cc6f99b63e53af9cf75c1999dc90)) | ||
* **deps:** Use google-gax v3.5.2 ([#89](https://github.com/googleapis/nodejs-filestore/issues/89)) ([5fde972](https://github.com/googleapis/nodejs-filestore/commit/5fde972b08be1106b42bce644f1282f690b93677)) | ||
* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-filestore/issues/1553)) ([#81](https://github.com/googleapis/nodejs-filestore/issues/81)) ([e0b4ac4](https://github.com/googleapis/nodejs-filestore/commit/e0b4ac42145ad648f3ae5f6c77917a2dd94d5192)) | ||
* Preserve default values in x-goog-request-params header ([#83](https://github.com/googleapis/nodejs-filestore/issues/83)) ([2cd3cb0](https://github.com/googleapis/nodejs-filestore/commit/2cd3cb022d1cb11fa3d04dbda58fd32de995c462)) | ||
* Regenerated protos JS and TS definitions ([#92](https://github.com/googleapis/nodejs-filestore/issues/92)) ([cb324b9](https://github.com/googleapis/nodejs-filestore/commit/cb324b9f3f93eaea7228386e5bf406ed570bafcc)) | ||
* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-filestore/issues/1546)) ([#80](https://github.com/googleapis/nodejs-filestore/issues/80)) ([73de8d6](https://github.com/googleapis/nodejs-filestore/commit/73de8d63b8b221df09c193400d1028cf3924a6ae)) | ||
* use google-gax v3.3.0 ([e0b4ac4](https://github.com/googleapis/nodejs-filestore/commit/e0b4ac42145ad648f3ae5f6c77917a2dd94d5192)) | ||
## [2.1.0](https://github.com/googleapis/nodejs-filestore/compare/v2.0.0...v2.1.0) (2022-06-30) | ||
@@ -4,0 +24,0 @@ |
{ | ||
"name": "@google-cloud/filestore", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "file client for Node.js", | ||
@@ -42,14 +42,14 @@ "repository": "googleapis/nodejs-filestore", | ||
"dependencies": { | ||
"google-gax": "^3.0.1" | ||
"google-gax": "^3.5.2" | ||
}, | ||
"devDependencies": { | ||
"@types/mocha": "^9.0.0", | ||
"@types/node": "^16.0.0", | ||
"@types/node": "^18.0.0", | ||
"@types/sinon": "^10.0.0", | ||
"c8": "^7.7.2", | ||
"gts": "^3.1.0", | ||
"jsdoc": "^3.6.6", | ||
"jsdoc": "^4.0.0", | ||
"jsdoc-fresh": "^2.0.0", | ||
"jsdoc-region-tag": "^2.0.0", | ||
"linkinator": "^2.13.6", | ||
"linkinator": "^4.0.0", | ||
"mocha": "^9.2.2", | ||
@@ -56,0 +56,0 @@ "null-loader": "^4.0.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
3247928
26.48%52473
25.01%Updated