diff --git a/package.json b/package.json index d176db97..3947f78f 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "disks", "disk types", "external vpn gateways", + "firewall policies", "firewalls", "forwarding rules", "global addresses", @@ -39,6 +40,7 @@ "global network endpoint groups", "global operations", "global organization operations", + "global public delegated prefixes", "health checks", "images", "instance group managers", @@ -58,6 +60,8 @@ "node types", "packet mirrorings", "projects", + "public advertised prefixes", + "public delegated prefixes", "region autoscalers", "region backend services", "region commitments", @@ -67,6 +71,7 @@ "region health check services", "region instance group managers", "region instance groups", + "region instances", "region network endpoint groups", "region notification endpoints", "region operations", @@ -115,27 +120,27 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.24.1" + "google-gax": "^2.25.2" }, "devDependencies": { - "@types/mocha": "^8.2.0", - "@types/node": "^14.14.13", - "@types/sinon": "^10.0.0", - "c8": "^7.3.5", + "@types/mocha": "^9.0.0", + "@types/node": "^14.17.3", + "@types/sinon": "^10.0.2", + "c8": "^7.7.3", "chai": "^4.3.4", "gts": "^3.1.0", - "jsdoc": "^3.6.6", - "jsdoc-fresh": "^1.0.2", - "jsdoc-region-tag": "^1.0.6", - "linkinator": "^2.8.0", - "mocha": "^8.2.1", + "jsdoc": "^3.6.7", + "jsdoc-fresh": "^1.1.0", + "jsdoc-region-tag": "^1.1.0", + "linkinator": "^2.13.6", + "mocha": "^9.0.2", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", - "sinon": "^11.0.0", - "ts-loader": "^9.0.0", - "typescript": "^4.1.3", + "sinon": "^11.1.1", + "ts-loader": "^9.2.3", + "typescript": "^4.3.4", "uuid": "^8.0.0", - "webpack": "^5.10.1", - "webpack-cli": "^4.2.0" + "webpack": "^5.39.1", + "webpack-cli": "^4.7.2" } } diff --git a/protos/protos.d.ts b/protos/protos.d.ts index cc7993d3..bd3ea534 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -152399,7 +152399,8 @@ export namespace google { OUTPUT_ONLY = 3, INPUT_ONLY = 4, IMMUTABLE = 5, - UNORDERED_LIST = 6 + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 } /** Properties of a ResourceDescriptor. */ diff --git a/protos/protos.js b/protos/protos.js index 44bde96a..01414143 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -400746,6 +400746,7 @@ * @property {number} INPUT_ONLY=4 INPUT_ONLY value * @property {number} IMMUTABLE=5 IMMUTABLE value * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value */ api.FieldBehavior = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -400756,6 +400757,7 @@ values[valuesById[4] = "INPUT_ONLY"] = 4; values[valuesById[5] = "IMMUTABLE"] = 5; values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; return values; })(); @@ -406924,6 +406926,7 @@ case 4: case 5: case 6: + case 7: break; } } @@ -407028,6 +407031,10 @@ case 6: message[".google.api.fieldBehavior"][i] = 6; break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; } } if (object[".google.api.resourceReference"] != null) { diff --git a/protos/protos.json b/protos/protos.json index 15f8b63d..d37404a7 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -71656,7 +71656,8 @@ "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, "IMMUTABLE": 5, - "UNORDERED_LIST": 6 + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 } }, "resourceReference": { @@ -72299,6 +72300,18 @@ ] ], "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], [ 8, 8 diff --git a/samples/createInstance.js b/samples/createInstance.js index c9b32a81..46df9d67 100644 --- a/samples/createInstance.js +++ b/samples/createInstance.js @@ -60,7 +60,7 @@ function main( console.log(`Creating the ${instanceName} instance in ${zone}...`); - let [operation] = await instancesClient.insert({ + const [response] = await instancesClient.insert({ instanceResource: { name: instanceName, disks: [ @@ -86,7 +86,7 @@ function main( project: projectId, zone, }); - + let operation = response.latestResponse; const operationsClient = new compute.ZoneOperationsClient(); // Wait for the create operation to complete. diff --git a/samples/deleteInstance.js b/samples/deleteInstance.js index bd1a4858..2c604dd3 100644 --- a/samples/deleteInstance.js +++ b/samples/deleteInstance.js @@ -36,12 +36,12 @@ function main(projectId, zone, instanceName) { console.log(`Deleting ${instanceName} from ${zone}...`); - let [operation] = await instancesClient.delete({ + const [response] = await instancesClient.delete({ project: projectId, zone, instance: instanceName, }); - + let operation = response.latestResponse; const operationsClient = new compute.ZoneOperationsClient(); // Wait for the delete operation to complete. diff --git a/samples/disableUsageExport.js b/samples/disableUsageExport.js index 4924d550..c2bedac3 100644 --- a/samples/disableUsageExport.js +++ b/samples/disableUsageExport.js @@ -31,11 +31,11 @@ function main(projectId) { const operationsClient = new compute.GlobalOperationsClient(); // Updating the setting with empty usageExportLocationResource will disable the usage report generation. - let [operation] = await projectsClient.setUsageExportBucket({ + const [response] = await projectsClient.setUsageExportBucket({ project: projectId, usageExportLocationResource: {}, }); - + let operation = response.latestResponse; while (operation.status !== 'DONE') { [operation] = await operationsClient.wait({ operation: operation.name, diff --git a/samples/package.json b/samples/package.json index 7a99f4a3..7fc9fcc2 100644 --- a/samples/package.json +++ b/samples/package.json @@ -14,7 +14,7 @@ "test": "mocha test --timeout 1200000" }, "dependencies": { - "@google-cloud/compute": "^3.0.0", + "@google-cloud/compute": "^3.0.0-alpha.4", "@sendgrid/mail": "^7.0.0", "nodemailer": "^6.0.0", "nodemailer-smtp-transport": "^2.7.4" diff --git a/samples/test/samples.test.js b/samples/test/samples.test.js index 982db6a6..f6acce59 100644 --- a/samples/test/samples.test.js +++ b/samples/test/samples.test.js @@ -69,13 +69,13 @@ describe('samples', () => { execSync(`node createInstance ${projectId} ${zone} ${newinstanceName}`); - const [operation] = await instancesClient.delete({ + const [response] = await instancesClient.delete({ project: projectId, zone, instance: newinstanceName, }); - const operationString = JSON.stringify(operation); + const operationString = JSON.stringify(response.latestResponse); const output = execSync( `node waitForOperation ${projectId} '${operationString}'` diff --git a/src/v1/accelerator_types_client.ts b/src/v1/accelerator_types_client.ts index 6c288e46..e838923b 100644 --- a/src/v1/accelerator_types_client.ts +++ b/src/v1/accelerator_types_client.ts @@ -139,6 +139,9 @@ export class AcceleratorTypesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; diff --git a/src/v1/addresses_client.ts b/src/v1/addresses_client.ts index 616dfdad..49c94cbd 100644 --- a/src/v1/addresses_client.ts +++ b/src/v1/addresses_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class AddressesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -320,8 +324,8 @@ export class AddressesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteAddressRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -362,12 +366,17 @@ export class AddressesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteAddressRequest, @@ -387,8 +396,8 @@ export class AddressesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteAddressRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -408,7 +417,27 @@ export class AddressesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetAddressRequest, @@ -502,8 +531,8 @@ export class AddressesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertAddressRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -544,12 +573,17 @@ export class AddressesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertAddressRequest, @@ -569,8 +603,8 @@ export class AddressesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertAddressRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -590,7 +624,27 @@ export class AddressesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/autoscalers_client.ts b/src/v1/autoscalers_client.ts index 8e0bbab3..89e5b532 100644 --- a/src/v1/autoscalers_client.ts +++ b/src/v1/autoscalers_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class AutoscalersClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -322,8 +326,8 @@ export class AutoscalersClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteAutoscalerRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -368,12 +372,17 @@ export class AutoscalersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteAutoscalerRequest, @@ -395,8 +404,8 @@ export class AutoscalersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteAutoscalerRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -416,7 +425,27 @@ export class AutoscalersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetAutoscalerRequest, @@ -512,8 +541,8 @@ export class AutoscalersClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertAutoscalerRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -558,12 +587,17 @@ export class AutoscalersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertAutoscalerRequest, @@ -585,8 +619,8 @@ export class AutoscalersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertAutoscalerRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -606,15 +640,35 @@ export class AutoscalersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchAutoscalerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchAutoscalerRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -657,12 +711,17 @@ export class AutoscalersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchAutoscalerRequest, @@ -682,8 +741,8 @@ export class AutoscalersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchAutoscalerRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -703,15 +762,35 @@ export class AutoscalersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } update( request?: protos.google.cloud.compute.v1.IUpdateAutoscalerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateAutoscalerRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -758,12 +837,17 @@ export class AutoscalersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.update(request); + * const [operation] = await client.update(request); */ update( request?: protos.google.cloud.compute.v1.IUpdateAutoscalerRequest, @@ -785,8 +869,8 @@ export class AutoscalersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateAutoscalerRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -806,7 +890,27 @@ export class AutoscalersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.update(request, options, callback); + return this.innerApiCalls + .update(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/backend_buckets_client.ts b/src/v1/backend_buckets_client.ts index a780deec..061e2eb2 100644 --- a/src/v1/backend_buckets_client.ts +++ b/src/v1/backend_buckets_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class BackendBucketsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -318,11 +322,8 @@ export class BackendBucketsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -367,12 +368,17 @@ export class BackendBucketsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.addSignedUrlKey(request); + * const [operation] = await client.addSignedUrlKey(request); */ addSignedUrlKey( request?: protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest, @@ -394,11 +400,8 @@ export class BackendBucketsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -418,15 +421,35 @@ export class BackendBucketsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.addSignedUrlKey(request, options, callback); + return this.innerApiCalls + .addSignedUrlKey(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } delete( request?: protos.google.cloud.compute.v1.IDeleteBackendBucketRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteBackendBucketRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -469,12 +492,17 @@ export class BackendBucketsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteBackendBucketRequest, @@ -496,8 +524,8 @@ export class BackendBucketsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteBackendBucketRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -517,18 +545,35 @@ export class BackendBucketsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } deleteSignedUrlKey( request?: protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -573,12 +618,17 @@ export class BackendBucketsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.deleteSignedUrlKey(request); + * const [operation] = await client.deleteSignedUrlKey(request); */ deleteSignedUrlKey( request?: protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest, @@ -600,11 +650,8 @@ export class BackendBucketsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -624,7 +671,27 @@ export class BackendBucketsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.deleteSignedUrlKey(request, options, callback); + return this.innerApiCalls + .deleteSignedUrlKey(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetBackendBucketRequest, @@ -724,8 +791,8 @@ export class BackendBucketsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertBackendBucketRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -768,12 +835,17 @@ export class BackendBucketsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertBackendBucketRequest, @@ -795,8 +867,8 @@ export class BackendBucketsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertBackendBucketRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -816,15 +888,35 @@ export class BackendBucketsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchBackendBucketRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchBackendBucketRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -869,12 +961,17 @@ export class BackendBucketsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchBackendBucketRequest, @@ -896,8 +993,8 @@ export class BackendBucketsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchBackendBucketRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -917,15 +1014,35 @@ export class BackendBucketsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } update( request?: protos.google.cloud.compute.v1.IUpdateBackendBucketRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateBackendBucketRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -970,12 +1087,17 @@ export class BackendBucketsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.update(request); + * const [operation] = await client.update(request); */ update( request?: protos.google.cloud.compute.v1.IUpdateBackendBucketRequest, @@ -997,8 +1119,8 @@ export class BackendBucketsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateBackendBucketRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1018,7 +1140,27 @@ export class BackendBucketsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.update(request, options, callback); + return this.innerApiCalls + .update(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/backend_services_client.ts b/src/v1/backend_services_client.ts index 3950e377..e868a35d 100644 --- a/src/v1/backend_services_client.ts +++ b/src/v1/backend_services_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class BackendServicesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -326,11 +330,8 @@ export class BackendServicesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -375,12 +376,17 @@ export class BackendServicesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.addSignedUrlKey(request); + * const [operation] = await client.addSignedUrlKey(request); */ addSignedUrlKey( request?: protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest, @@ -402,11 +408,8 @@ export class BackendServicesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -426,15 +429,35 @@ export class BackendServicesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.addSignedUrlKey(request, options, callback); + return this.innerApiCalls + .addSignedUrlKey(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } delete( request?: protos.google.cloud.compute.v1.IDeleteBackendServiceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteBackendServiceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -477,12 +500,17 @@ export class BackendServicesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteBackendServiceRequest, @@ -504,8 +532,8 @@ export class BackendServicesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteBackendServiceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -525,18 +553,35 @@ export class BackendServicesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } deleteSignedUrlKey( request?: protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -581,12 +626,17 @@ export class BackendServicesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.deleteSignedUrlKey(request); + * const [operation] = await client.deleteSignedUrlKey(request); */ deleteSignedUrlKey( request?: protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest, @@ -608,11 +658,8 @@ export class BackendServicesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -632,7 +679,27 @@ export class BackendServicesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.deleteSignedUrlKey(request, options, callback); + return this.innerApiCalls + .deleteSignedUrlKey(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetBackendServiceRequest, @@ -836,8 +903,8 @@ export class BackendServicesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertBackendServiceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -880,12 +947,17 @@ export class BackendServicesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertBackendServiceRequest, @@ -907,8 +979,8 @@ export class BackendServicesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertBackendServiceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -928,15 +1000,35 @@ export class BackendServicesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchBackendServiceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchBackendServiceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -981,12 +1073,17 @@ export class BackendServicesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchBackendServiceRequest, @@ -1008,8 +1105,8 @@ export class BackendServicesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchBackendServiceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1029,18 +1126,35 @@ export class BackendServicesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setSecurityPolicy( request?: protos.google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1085,12 +1199,17 @@ export class BackendServicesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setSecurityPolicy(request); + * const [operation] = await client.setSecurityPolicy(request); */ setSecurityPolicy( request?: protos.google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest, @@ -1112,11 +1231,8 @@ export class BackendServicesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1136,15 +1252,35 @@ export class BackendServicesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setSecurityPolicy(request, options, callback); + return this.innerApiCalls + .setSecurityPolicy(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } update( request?: protos.google.cloud.compute.v1.IUpdateBackendServiceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateBackendServiceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1189,12 +1325,17 @@ export class BackendServicesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.update(request); + * const [operation] = await client.update(request); */ update( request?: protos.google.cloud.compute.v1.IUpdateBackendServiceRequest, @@ -1216,8 +1357,8 @@ export class BackendServicesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateBackendServiceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1237,7 +1378,27 @@ export class BackendServicesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.update(request, options, callback); + return this.innerApiCalls + .update(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/disk_types_client.ts b/src/v1/disk_types_client.ts index e8c31f13..7a03942b 100644 --- a/src/v1/disk_types_client.ts +++ b/src/v1/disk_types_client.ts @@ -136,6 +136,9 @@ export class DiskTypesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; diff --git a/src/v1/disks_client.ts b/src/v1/disks_client.ts index 3f770518..65d4b351 100644 --- a/src/v1/disks_client.ts +++ b/src/v1/disks_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class DisksClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -328,11 +332,8 @@ export class DisksClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAddResourcePoliciesDiskRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -379,12 +380,17 @@ export class DisksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.addResourcePolicies(request); + * const [operation] = await client.addResourcePolicies(request); */ addResourcePolicies( request?: protos.google.cloud.compute.v1.IAddResourcePoliciesDiskRequest, @@ -406,11 +412,8 @@ export class DisksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAddResourcePoliciesDiskRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -430,15 +433,35 @@ export class DisksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.addResourcePolicies(request, options, callback); + return this.innerApiCalls + .addResourcePolicies(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } createSnapshot( request?: protos.google.cloud.compute.v1.ICreateSnapshotDiskRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ICreateSnapshotDiskRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -487,12 +510,17 @@ export class DisksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.createSnapshot(request); + * const [operation] = await client.createSnapshot(request); */ createSnapshot( request?: protos.google.cloud.compute.v1.ICreateSnapshotDiskRequest, @@ -514,8 +542,8 @@ export class DisksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ICreateSnapshotDiskRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -535,15 +563,35 @@ export class DisksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.createSnapshot(request, options, callback); + return this.innerApiCalls + .createSnapshot(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } delete( request?: protos.google.cloud.compute.v1.IDeleteDiskRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteDiskRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -584,12 +632,17 @@ export class DisksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteDiskRequest, @@ -607,8 +660,8 @@ export class DisksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteDiskRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -628,7 +681,27 @@ export class DisksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetDiskRequest, @@ -819,8 +892,8 @@ export class DisksClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertDiskRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -863,12 +936,17 @@ export class DisksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertDiskRequest, @@ -886,8 +964,8 @@ export class DisksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertDiskRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -907,18 +985,35 @@ export class DisksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } removeResourcePolicies( request?: protos.google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -965,12 +1060,17 @@ export class DisksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.removeResourcePolicies(request); + * const [operation] = await client.removeResourcePolicies(request); */ removeResourcePolicies( request?: protos.google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest, @@ -992,11 +1092,8 @@ export class DisksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1016,19 +1113,35 @@ export class DisksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.removeResourcePolicies( - request, - options, - callback - ); + return this.innerApiCalls + .removeResourcePolicies(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } resize( request?: protos.google.cloud.compute.v1.IResizeDiskRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IResizeDiskRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1071,12 +1184,17 @@ export class DisksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.resize(request); + * const [operation] = await client.resize(request); */ resize( request?: protos.google.cloud.compute.v1.IResizeDiskRequest, @@ -1094,8 +1212,8 @@ export class DisksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IResizeDiskRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1115,7 +1233,27 @@ export class DisksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.resize(request, options, callback); + return this.innerApiCalls + .resize(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setIamPolicy( request?: protos.google.cloud.compute.v1.ISetIamPolicyDiskRequest, @@ -1219,8 +1357,8 @@ export class DisksClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetLabelsDiskRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1263,12 +1401,17 @@ export class DisksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setLabels(request); + * const [operation] = await client.setLabels(request); */ setLabels( request?: protos.google.cloud.compute.v1.ISetLabelsDiskRequest, @@ -1288,8 +1431,8 @@ export class DisksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetLabelsDiskRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1309,7 +1452,27 @@ export class DisksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setLabels(request, options, callback); + return this.innerApiCalls + .setLabels(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } testIamPermissions( request?: protos.google.cloud.compute.v1.ITestIamPermissionsDiskRequest, diff --git a/src/v1/external_vpn_gateways_client.ts b/src/v1/external_vpn_gateways_client.ts index 5bf8045d..a694072b 100644 --- a/src/v1/external_vpn_gateways_client.ts +++ b/src/v1/external_vpn_gateways_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class ExternalVpnGatewaysClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -316,11 +320,8 @@ export class ExternalVpnGatewaysClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -363,12 +364,17 @@ export class ExternalVpnGatewaysClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest, @@ -390,11 +396,8 @@ export class ExternalVpnGatewaysClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -414,7 +417,27 @@ export class ExternalVpnGatewaysClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetExternalVpnGatewayRequest, @@ -514,11 +537,8 @@ export class ExternalVpnGatewaysClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertExternalVpnGatewayRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -561,12 +581,17 @@ export class ExternalVpnGatewaysClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertExternalVpnGatewayRequest, @@ -588,11 +613,8 @@ export class ExternalVpnGatewaysClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertExternalVpnGatewayRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -612,18 +634,35 @@ export class ExternalVpnGatewaysClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setLabels( request?: protos.google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -662,12 +701,17 @@ export class ExternalVpnGatewaysClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setLabels(request); + * const [operation] = await client.setLabels(request); */ setLabels( request?: protos.google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest, @@ -689,11 +733,8 @@ export class ExternalVpnGatewaysClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -713,7 +754,27 @@ export class ExternalVpnGatewaysClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setLabels(request, options, callback); + return this.innerApiCalls + .setLabels(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } testIamPermissions( request?: protos.google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest, diff --git a/src/v1/firewall_policies_client.ts b/src/v1/firewall_policies_client.ts index 623cf2ff..4d80a8da 100644 --- a/src/v1/firewall_policies_client.ts +++ b/src/v1/firewall_policies_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class FirewallPoliciesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -328,11 +332,8 @@ export class FirewallPoliciesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -377,12 +378,17 @@ export class FirewallPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.addAssociation(request); + * const [operation] = await client.addAssociation(request); */ addAssociation( request?: protos.google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest, @@ -404,11 +410,8 @@ export class FirewallPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -428,15 +431,35 @@ export class FirewallPoliciesClient { firewall_policy: request.firewallPolicy || '', }); this.initialize(); - return this.innerApiCalls.addAssociation(request, options, callback); + return this.innerApiCalls + .addAssociation(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } addRule( request?: protos.google.cloud.compute.v1.IAddRuleFirewallPolicyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IAddRuleFirewallPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -479,12 +502,17 @@ export class FirewallPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.addRule(request); + * const [operation] = await client.addRule(request); */ addRule( request?: protos.google.cloud.compute.v1.IAddRuleFirewallPolicyRequest, @@ -506,8 +534,8 @@ export class FirewallPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IAddRuleFirewallPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -527,18 +555,35 @@ export class FirewallPoliciesClient { firewall_policy: request.firewallPolicy || '', }); this.initialize(); - return this.innerApiCalls.addRule(request, options, callback); + return this.innerApiCalls + .addRule(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } cloneRules( request?: protos.google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -581,12 +626,17 @@ export class FirewallPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.cloneRules(request); + * const [operation] = await client.cloneRules(request); */ cloneRules( request?: protos.google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest, @@ -608,11 +658,8 @@ export class FirewallPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -632,15 +679,35 @@ export class FirewallPoliciesClient { firewall_policy: request.firewallPolicy || '', }); this.initialize(); - return this.innerApiCalls.cloneRules(request, options, callback); + return this.innerApiCalls + .cloneRules(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } delete( request?: protos.google.cloud.compute.v1.IDeleteFirewallPolicyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteFirewallPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -681,12 +748,17 @@ export class FirewallPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteFirewallPolicyRequest, @@ -708,8 +780,8 @@ export class FirewallPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteFirewallPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -729,7 +801,27 @@ export class FirewallPoliciesClient { firewall_policy: request.firewallPolicy || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetFirewallPolicyRequest, @@ -1118,8 +1210,8 @@ export class FirewallPoliciesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertFirewallPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1162,12 +1254,17 @@ export class FirewallPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertFirewallPolicyRequest, @@ -1189,8 +1286,8 @@ export class FirewallPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertFirewallPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1204,7 +1301,27 @@ export class FirewallPoliciesClient { } options = options || {}; this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } listAssociations( request?: protos.google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest, @@ -1302,8 +1419,8 @@ export class FirewallPoliciesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IMoveFirewallPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1346,12 +1463,17 @@ export class FirewallPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.move(request); + * const [operation] = await client.move(request); */ move( request?: protos.google.cloud.compute.v1.IMoveFirewallPolicyRequest, @@ -1373,8 +1495,8 @@ export class FirewallPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IMoveFirewallPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1394,15 +1516,35 @@ export class FirewallPoliciesClient { firewall_policy: request.firewallPolicy || '', }); this.initialize(); - return this.innerApiCalls.move(request, options, callback); + return this.innerApiCalls + .move(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchFirewallPolicyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchFirewallPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1445,12 +1587,17 @@ export class FirewallPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchFirewallPolicyRequest, @@ -1472,8 +1619,8 @@ export class FirewallPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchFirewallPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1493,18 +1640,35 @@ export class FirewallPoliciesClient { firewall_policy: request.firewallPolicy || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patchRule( request?: protos.google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1549,12 +1713,17 @@ export class FirewallPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patchRule(request); + * const [operation] = await client.patchRule(request); */ patchRule( request?: protos.google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest, @@ -1576,11 +1745,8 @@ export class FirewallPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1600,18 +1766,35 @@ export class FirewallPoliciesClient { firewall_policy: request.firewallPolicy || '', }); this.initialize(); - return this.innerApiCalls.patchRule(request, options, callback); + return this.innerApiCalls + .patchRule(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } removeAssociation( request?: protos.google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1654,12 +1837,17 @@ export class FirewallPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.removeAssociation(request); + * const [operation] = await client.removeAssociation(request); */ removeAssociation( request?: protos.google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest, @@ -1681,11 +1869,8 @@ export class FirewallPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1705,18 +1890,35 @@ export class FirewallPoliciesClient { firewall_policy: request.firewallPolicy || '', }); this.initialize(); - return this.innerApiCalls.removeAssociation(request, options, callback); + return this.innerApiCalls + .removeAssociation(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } removeRule( request?: protos.google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1759,12 +1961,17 @@ export class FirewallPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.removeRule(request); + * const [operation] = await client.removeRule(request); */ removeRule( request?: protos.google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest, @@ -1786,11 +1993,8 @@ export class FirewallPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1810,7 +2014,27 @@ export class FirewallPoliciesClient { firewall_policy: request.firewallPolicy || '', }); this.initialize(); - return this.innerApiCalls.removeRule(request, options, callback); + return this.innerApiCalls + .removeRule(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setIamPolicy( request?: protos.google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest, diff --git a/src/v1/firewalls_client.ts b/src/v1/firewalls_client.ts index ca15d50b..88385c02 100644 --- a/src/v1/firewalls_client.ts +++ b/src/v1/firewalls_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class FirewallsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -316,8 +320,8 @@ export class FirewallsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteFirewallRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -356,12 +360,17 @@ export class FirewallsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteFirewallRequest, @@ -381,8 +390,8 @@ export class FirewallsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteFirewallRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -402,7 +411,27 @@ export class FirewallsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetFirewallRequest, @@ -494,8 +523,8 @@ export class FirewallsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertFirewallRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -534,12 +563,17 @@ export class FirewallsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertFirewallRequest, @@ -559,8 +593,8 @@ export class FirewallsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertFirewallRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -580,15 +614,35 @@ export class FirewallsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchFirewallRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchFirewallRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -629,12 +683,17 @@ export class FirewallsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchFirewallRequest, @@ -654,8 +713,8 @@ export class FirewallsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchFirewallRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -675,15 +734,35 @@ export class FirewallsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } update( request?: protos.google.cloud.compute.v1.IUpdateFirewallRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateFirewallRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -724,12 +803,17 @@ export class FirewallsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.update(request); + * const [operation] = await client.update(request); */ update( request?: protos.google.cloud.compute.v1.IUpdateFirewallRequest, @@ -749,8 +833,8 @@ export class FirewallsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateFirewallRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -770,7 +854,27 @@ export class FirewallsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.update(request, options, callback); + return this.innerApiCalls + .update(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/forwarding_rules_client.ts b/src/v1/forwarding_rules_client.ts index 418acb8e..7a452863 100644 --- a/src/v1/forwarding_rules_client.ts +++ b/src/v1/forwarding_rules_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class ForwardingRulesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -323,8 +327,8 @@ export class ForwardingRulesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteForwardingRuleRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -369,12 +373,17 @@ export class ForwardingRulesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteForwardingRuleRequest, @@ -396,8 +405,8 @@ export class ForwardingRulesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteForwardingRuleRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -417,7 +426,27 @@ export class ForwardingRulesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetForwardingRuleRequest, @@ -519,8 +548,8 @@ export class ForwardingRulesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertForwardingRuleRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -565,12 +594,17 @@ export class ForwardingRulesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertForwardingRuleRequest, @@ -592,8 +626,8 @@ export class ForwardingRulesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertForwardingRuleRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -613,15 +647,35 @@ export class ForwardingRulesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchForwardingRuleRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchForwardingRuleRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -668,12 +722,17 @@ export class ForwardingRulesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchForwardingRuleRequest, @@ -695,8 +754,8 @@ export class ForwardingRulesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchForwardingRuleRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -716,18 +775,35 @@ export class ForwardingRulesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setLabels( request?: protos.google.cloud.compute.v1.ISetLabelsForwardingRuleRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetLabelsForwardingRuleRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -774,12 +850,17 @@ export class ForwardingRulesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setLabels(request); + * const [operation] = await client.setLabels(request); */ setLabels( request?: protos.google.cloud.compute.v1.ISetLabelsForwardingRuleRequest, @@ -801,11 +882,8 @@ export class ForwardingRulesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetLabelsForwardingRuleRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -825,18 +903,35 @@ export class ForwardingRulesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setLabels(request, options, callback); + return this.innerApiCalls + .setLabels(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setTarget( request?: protos.google.cloud.compute.v1.ISetTargetForwardingRuleRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetTargetForwardingRuleRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -883,12 +978,17 @@ export class ForwardingRulesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setTarget(request); + * const [operation] = await client.setTarget(request); */ setTarget( request?: protos.google.cloud.compute.v1.ISetTargetForwardingRuleRequest, @@ -910,11 +1010,8 @@ export class ForwardingRulesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetTargetForwardingRuleRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -934,7 +1031,27 @@ export class ForwardingRulesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setTarget(request, options, callback); + return this.innerApiCalls + .setTarget(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/global_addresses_client.ts b/src/v1/global_addresses_client.ts index 3f30a3c4..4cc24ff2 100644 --- a/src/v1/global_addresses_client.ts +++ b/src/v1/global_addresses_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class GlobalAddressesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -309,8 +313,8 @@ export class GlobalAddressesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteGlobalAddressRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -353,12 +357,17 @@ export class GlobalAddressesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteGlobalAddressRequest, @@ -380,8 +389,8 @@ export class GlobalAddressesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteGlobalAddressRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -401,7 +410,27 @@ export class GlobalAddressesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetGlobalAddressRequest, @@ -501,8 +530,8 @@ export class GlobalAddressesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertGlobalAddressRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -545,12 +574,17 @@ export class GlobalAddressesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertGlobalAddressRequest, @@ -572,8 +606,8 @@ export class GlobalAddressesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertGlobalAddressRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -593,7 +627,27 @@ export class GlobalAddressesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/global_forwarding_rules_client.ts b/src/v1/global_forwarding_rules_client.ts index 614e36e1..73d5e9bf 100644 --- a/src/v1/global_forwarding_rules_client.ts +++ b/src/v1/global_forwarding_rules_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -137,6 +138,9 @@ export class GlobalForwardingRulesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -318,11 +322,8 @@ export class GlobalForwardingRulesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -365,12 +366,17 @@ export class GlobalForwardingRulesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest, @@ -392,11 +398,8 @@ export class GlobalForwardingRulesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -416,7 +419,27 @@ export class GlobalForwardingRulesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetGlobalForwardingRuleRequest, @@ -522,11 +545,8 @@ export class GlobalForwardingRulesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -569,12 +589,17 @@ export class GlobalForwardingRulesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest, @@ -596,11 +621,8 @@ export class GlobalForwardingRulesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -620,18 +642,35 @@ export class GlobalForwardingRulesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -676,12 +715,17 @@ export class GlobalForwardingRulesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest, @@ -703,11 +747,8 @@ export class GlobalForwardingRulesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -727,18 +768,35 @@ export class GlobalForwardingRulesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setLabels( request?: protos.google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -777,12 +835,17 @@ export class GlobalForwardingRulesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setLabels(request); + * const [operation] = await client.setLabels(request); */ setLabels( request?: protos.google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest, @@ -804,11 +867,8 @@ export class GlobalForwardingRulesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -828,18 +888,35 @@ export class GlobalForwardingRulesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setLabels(request, options, callback); + return this.innerApiCalls + .setLabels(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setTarget( request?: protos.google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -884,12 +961,17 @@ export class GlobalForwardingRulesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setTarget(request); + * const [operation] = await client.setTarget(request); */ setTarget( request?: protos.google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest, @@ -911,11 +993,8 @@ export class GlobalForwardingRulesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -935,7 +1014,27 @@ export class GlobalForwardingRulesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setTarget(request, options, callback); + return this.innerApiCalls + .setTarget(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/global_network_endpoint_groups_client.ts b/src/v1/global_network_endpoint_groups_client.ts index 8be9c98e..fc4ba73b 100644 --- a/src/v1/global_network_endpoint_groups_client.ts +++ b/src/v1/global_network_endpoint_groups_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -137,6 +138,9 @@ export class GlobalNetworkEndpointGroupsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -324,11 +328,8 @@ export class GlobalNetworkEndpointGroupsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -373,12 +374,17 @@ export class GlobalNetworkEndpointGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.attachNetworkEndpoints(request); + * const [operation] = await client.attachNetworkEndpoints(request); */ attachNetworkEndpoints( request?: protos.google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest, @@ -400,11 +406,8 @@ export class GlobalNetworkEndpointGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -424,22 +427,35 @@ export class GlobalNetworkEndpointGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.attachNetworkEndpoints( - request, - options, - callback - ); + return this.innerApiCalls + .attachNetworkEndpoints(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } delete( request?: protos.google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -482,12 +498,17 @@ export class GlobalNetworkEndpointGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest, @@ -509,11 +530,8 @@ export class GlobalNetworkEndpointGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -533,18 +551,35 @@ export class GlobalNetworkEndpointGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } detachNetworkEndpoints( request?: protos.google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -589,12 +624,17 @@ export class GlobalNetworkEndpointGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.detachNetworkEndpoints(request); + * const [operation] = await client.detachNetworkEndpoints(request); */ detachNetworkEndpoints( request?: protos.google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest, @@ -616,11 +656,8 @@ export class GlobalNetworkEndpointGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -640,11 +677,27 @@ export class GlobalNetworkEndpointGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.detachNetworkEndpoints( - request, - options, - callback - ); + return this.innerApiCalls + .detachNetworkEndpoints(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest, @@ -750,11 +803,8 @@ export class GlobalNetworkEndpointGroupsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -797,12 +847,17 @@ export class GlobalNetworkEndpointGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest, @@ -824,11 +879,8 @@ export class GlobalNetworkEndpointGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -848,7 +900,27 @@ export class GlobalNetworkEndpointGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/global_operations_client.ts b/src/v1/global_operations_client.ts index 2c49d9b1..cb3a009a 100644 --- a/src/v1/global_operations_client.ts +++ b/src/v1/global_operations_client.ts @@ -136,6 +136,9 @@ export class GlobalOperationsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; diff --git a/src/v1/global_organization_operations_client.ts b/src/v1/global_organization_operations_client.ts index cdb6e33f..d4138f14 100644 --- a/src/v1/global_organization_operations_client.ts +++ b/src/v1/global_organization_operations_client.ts @@ -137,6 +137,9 @@ export class GlobalOrganizationOperationsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; diff --git a/src/v1/global_public_delegated_prefixes_client.ts b/src/v1/global_public_delegated_prefixes_client.ts index 2efca7dd..4cc775e6 100644 --- a/src/v1/global_public_delegated_prefixes_client.ts +++ b/src/v1/global_public_delegated_prefixes_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -137,6 +138,9 @@ export class GlobalPublicDelegatedPrefixesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -317,11 +321,8 @@ export class GlobalPublicDelegatedPrefixesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -364,12 +365,17 @@ export class GlobalPublicDelegatedPrefixesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest, @@ -391,11 +397,8 @@ export class GlobalPublicDelegatedPrefixesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -415,7 +418,27 @@ export class GlobalPublicDelegatedPrefixesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest, @@ -521,11 +544,8 @@ export class GlobalPublicDelegatedPrefixesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -568,12 +588,17 @@ export class GlobalPublicDelegatedPrefixesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest, @@ -595,11 +620,8 @@ export class GlobalPublicDelegatedPrefixesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -619,18 +641,35 @@ export class GlobalPublicDelegatedPrefixesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -675,12 +714,17 @@ export class GlobalPublicDelegatedPrefixesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest, @@ -702,11 +746,8 @@ export class GlobalPublicDelegatedPrefixesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -726,7 +767,27 @@ export class GlobalPublicDelegatedPrefixesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/health_checks_client.ts b/src/v1/health_checks_client.ts index a5478ede..67d4790d 100644 --- a/src/v1/health_checks_client.ts +++ b/src/v1/health_checks_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class HealthChecksClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -322,8 +326,8 @@ export class HealthChecksClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteHealthCheckRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -366,12 +370,17 @@ export class HealthChecksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteHealthCheckRequest, @@ -393,8 +402,8 @@ export class HealthChecksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteHealthCheckRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -414,7 +423,27 @@ export class HealthChecksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetHealthCheckRequest, @@ -508,8 +537,8 @@ export class HealthChecksClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertHealthCheckRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -552,12 +581,17 @@ export class HealthChecksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertHealthCheckRequest, @@ -579,8 +613,8 @@ export class HealthChecksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertHealthCheckRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -600,15 +634,35 @@ export class HealthChecksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchHealthCheckRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchHealthCheckRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -653,12 +707,17 @@ export class HealthChecksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchHealthCheckRequest, @@ -680,8 +739,8 @@ export class HealthChecksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchHealthCheckRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -701,15 +760,35 @@ export class HealthChecksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } update( request?: protos.google.cloud.compute.v1.IUpdateHealthCheckRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateHealthCheckRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -754,12 +833,17 @@ export class HealthChecksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.update(request); + * const [operation] = await client.update(request); */ update( request?: protos.google.cloud.compute.v1.IUpdateHealthCheckRequest, @@ -781,8 +865,8 @@ export class HealthChecksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateHealthCheckRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -802,7 +886,27 @@ export class HealthChecksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.update(request, options, callback); + return this.innerApiCalls + .update(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/images_client.ts b/src/v1/images_client.ts index 5c562f56..3dd368ed 100644 --- a/src/v1/images_client.ts +++ b/src/v1/images_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class ImagesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -321,8 +325,8 @@ export class ImagesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteImageRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -361,12 +365,17 @@ export class ImagesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteImageRequest, @@ -384,8 +393,8 @@ export class ImagesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteImageRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -405,15 +414,35 @@ export class ImagesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } deprecate( request?: protos.google.cloud.compute.v1.IDeprecateImageRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeprecateImageRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -456,12 +485,17 @@ export class ImagesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.deprecate(request); + * const [operation] = await client.deprecate(request); */ deprecate( request?: protos.google.cloud.compute.v1.IDeprecateImageRequest, @@ -481,8 +515,8 @@ export class ImagesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeprecateImageRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -502,7 +536,27 @@ export class ImagesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.deprecate(request, options, callback); + return this.innerApiCalls + .deprecate(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetImageRequest, @@ -782,8 +836,8 @@ export class ImagesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertImageRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -824,12 +878,17 @@ export class ImagesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertImageRequest, @@ -847,8 +906,8 @@ export class ImagesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertImageRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -868,15 +927,35 @@ export class ImagesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchImageRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchImageRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -917,12 +996,17 @@ export class ImagesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchImageRequest, @@ -940,8 +1024,8 @@ export class ImagesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchImageRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -961,7 +1045,27 @@ export class ImagesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setIamPolicy( request?: protos.google.cloud.compute.v1.ISetIamPolicyImageRequest, @@ -1063,8 +1167,8 @@ export class ImagesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetLabelsImageRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1099,12 +1203,17 @@ export class ImagesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setLabels(request); + * const [operation] = await client.setLabels(request); */ setLabels( request?: protos.google.cloud.compute.v1.ISetLabelsImageRequest, @@ -1124,8 +1233,8 @@ export class ImagesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetLabelsImageRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1145,7 +1254,27 @@ export class ImagesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setLabels(request, options, callback); + return this.innerApiCalls + .setLabels(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } testIamPermissions( request?: protos.google.cloud.compute.v1.ITestIamPermissionsImageRequest, diff --git a/src/v1/instance_group_managers_client.ts b/src/v1/instance_group_managers_client.ts index 15e7186d..25e315f7 100644 --- a/src/v1/instance_group_managers_client.ts +++ b/src/v1/instance_group_managers_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -137,6 +138,9 @@ export class InstanceGroupManagersClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -351,11 +355,8 @@ export class InstanceGroupManagersClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -406,12 +407,17 @@ export class InstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.abandonInstances(request); + * const [operation] = await client.abandonInstances(request); */ abandonInstances( request?: protos.google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest, @@ -433,11 +439,8 @@ export class InstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -457,18 +460,35 @@ export class InstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.abandonInstances(request, options, callback); + return this.innerApiCalls + .abandonInstances(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } applyUpdatesToInstances( request?: protos.google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -509,12 +529,17 @@ export class InstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.applyUpdatesToInstances(request); + * const [operation] = await client.applyUpdatesToInstances(request); */ applyUpdatesToInstances( request?: protos.google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest, @@ -536,11 +561,8 @@ export class InstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -560,22 +582,35 @@ export class InstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.applyUpdatesToInstances( - request, - options, - callback - ); + return this.innerApiCalls + .applyUpdatesToInstances(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } createInstances( request?: protos.google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -622,12 +657,17 @@ export class InstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.createInstances(request); + * const [operation] = await client.createInstances(request); */ createInstances( request?: protos.google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest, @@ -649,11 +689,8 @@ export class InstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -673,18 +710,35 @@ export class InstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.createInstances(request, options, callback); + return this.innerApiCalls + .createInstances(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } delete( request?: protos.google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -729,12 +783,17 @@ export class InstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest, @@ -756,11 +815,8 @@ export class InstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -780,18 +836,35 @@ export class InstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } deleteInstances( request?: protos.google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -842,12 +915,17 @@ export class InstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.deleteInstances(request); + * const [operation] = await client.deleteInstances(request); */ deleteInstances( request?: protos.google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest, @@ -869,11 +947,8 @@ export class InstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -893,18 +968,35 @@ export class InstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.deleteInstances(request, options, callback); + return this.innerApiCalls + .deleteInstances(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } deletePerInstanceConfigs( request?: protos.google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -945,12 +1037,17 @@ export class InstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.deletePerInstanceConfigs(request); + * const [operation] = await client.deletePerInstanceConfigs(request); */ deletePerInstanceConfigs( request?: protos.google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest, @@ -972,11 +1069,8 @@ export class InstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -996,11 +1090,27 @@ export class InstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.deletePerInstanceConfigs( - request, - options, - callback - ); + return this.innerApiCalls + .deletePerInstanceConfigs(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetInstanceGroupManagerRequest, @@ -1108,11 +1218,8 @@ export class InstanceGroupManagersClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1159,12 +1266,17 @@ export class InstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertInstanceGroupManagerRequest, @@ -1186,11 +1298,8 @@ export class InstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1210,18 +1319,35 @@ export class InstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1268,12 +1394,17 @@ export class InstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchInstanceGroupManagerRequest, @@ -1295,11 +1426,8 @@ export class InstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1319,18 +1447,35 @@ export class InstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patchPerInstanceConfigs( request?: protos.google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1377,12 +1522,17 @@ export class InstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patchPerInstanceConfigs(request); + * const [operation] = await client.patchPerInstanceConfigs(request); */ patchPerInstanceConfigs( request?: protos.google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest, @@ -1404,11 +1554,8 @@ export class InstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1428,22 +1575,35 @@ export class InstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patchPerInstanceConfigs( - request, - options, - callback - ); + return this.innerApiCalls + .patchPerInstanceConfigs(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } recreateInstances( request?: protos.google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1494,12 +1654,17 @@ export class InstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.recreateInstances(request); + * const [operation] = await client.recreateInstances(request); */ recreateInstances( request?: protos.google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest, @@ -1521,11 +1686,8 @@ export class InstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1545,18 +1707,35 @@ export class InstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.recreateInstances(request, options, callback); + return this.innerApiCalls + .recreateInstances(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } resize( request?: protos.google.cloud.compute.v1.IResizeInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IResizeInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1611,12 +1790,17 @@ export class InstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.resize(request); + * const [operation] = await client.resize(request); */ resize( request?: protos.google.cloud.compute.v1.IResizeInstanceGroupManagerRequest, @@ -1638,11 +1822,8 @@ export class InstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IResizeInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1662,18 +1843,35 @@ export class InstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.resize(request, options, callback); + return this.innerApiCalls + .resize(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setInstanceTemplate( request?: protos.google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1720,12 +1918,17 @@ export class InstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setInstanceTemplate(request); + * const [operation] = await client.setInstanceTemplate(request); */ setInstanceTemplate( request?: protos.google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest, @@ -1747,11 +1950,8 @@ export class InstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1771,18 +1971,35 @@ export class InstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setInstanceTemplate(request, options, callback); + return this.innerApiCalls + .setInstanceTemplate(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setTargetPools( request?: protos.google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1829,12 +2046,17 @@ export class InstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setTargetPools(request); + * const [operation] = await client.setTargetPools(request); */ setTargetPools( request?: protos.google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest, @@ -1856,11 +2078,8 @@ export class InstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1880,18 +2099,35 @@ export class InstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setTargetPools(request, options, callback); + return this.innerApiCalls + .setTargetPools(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } updatePerInstanceConfigs( request?: protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1938,12 +2174,17 @@ export class InstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.updatePerInstanceConfigs(request); + * const [operation] = await client.updatePerInstanceConfigs(request); */ updatePerInstanceConfigs( request?: protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest, @@ -1965,11 +2206,8 @@ export class InstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1989,11 +2227,27 @@ export class InstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.updatePerInstanceConfigs( - request, - options, - callback - ); + return this.innerApiCalls + .updatePerInstanceConfigs(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/instance_groups_client.ts b/src/v1/instance_groups_client.ts index eb03f641..ac7b70b5 100644 --- a/src/v1/instance_groups_client.ts +++ b/src/v1/instance_groups_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class InstanceGroupsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -329,11 +333,8 @@ export class InstanceGroupsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAddInstancesInstanceGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -380,12 +381,17 @@ export class InstanceGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.addInstances(request); + * const [operation] = await client.addInstances(request); */ addInstances( request?: protos.google.cloud.compute.v1.IAddInstancesInstanceGroupRequest, @@ -407,11 +413,8 @@ export class InstanceGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAddInstancesInstanceGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -431,15 +434,35 @@ export class InstanceGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.addInstances(request, options, callback); + return this.innerApiCalls + .addInstances(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } delete( request?: protos.google.cloud.compute.v1.IDeleteInstanceGroupRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteInstanceGroupRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -484,12 +507,17 @@ export class InstanceGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteInstanceGroupRequest, @@ -511,8 +539,8 @@ export class InstanceGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteInstanceGroupRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -532,7 +560,27 @@ export class InstanceGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetInstanceGroupRequest, @@ -636,8 +684,8 @@ export class InstanceGroupsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertInstanceGroupRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -682,12 +730,17 @@ export class InstanceGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertInstanceGroupRequest, @@ -709,8 +762,8 @@ export class InstanceGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertInstanceGroupRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -730,18 +783,35 @@ export class InstanceGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } removeInstances( request?: protos.google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -790,12 +860,17 @@ export class InstanceGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.removeInstances(request); + * const [operation] = await client.removeInstances(request); */ removeInstances( request?: protos.google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest, @@ -817,11 +892,8 @@ export class InstanceGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -841,18 +913,35 @@ export class InstanceGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.removeInstances(request, options, callback); + return this.innerApiCalls + .removeInstances(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setNamedPorts( request?: protos.google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -899,12 +988,17 @@ export class InstanceGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setNamedPorts(request); + * const [operation] = await client.setNamedPorts(request); */ setNamedPorts( request?: protos.google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest, @@ -926,11 +1020,8 @@ export class InstanceGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -950,7 +1041,27 @@ export class InstanceGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setNamedPorts(request, options, callback); + return this.innerApiCalls + .setNamedPorts(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/instance_templates_client.ts b/src/v1/instance_templates_client.ts index ed073f27..2bd03a78 100644 --- a/src/v1/instance_templates_client.ts +++ b/src/v1/instance_templates_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class InstanceTemplatesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -317,8 +321,8 @@ export class InstanceTemplatesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteInstanceTemplateRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -361,12 +365,17 @@ export class InstanceTemplatesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteInstanceTemplateRequest, @@ -388,8 +397,8 @@ export class InstanceTemplatesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteInstanceTemplateRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -409,7 +418,27 @@ export class InstanceTemplatesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetInstanceTemplateRequest, @@ -610,8 +639,8 @@ export class InstanceTemplatesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertInstanceTemplateRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -654,12 +683,17 @@ export class InstanceTemplatesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertInstanceTemplateRequest, @@ -681,8 +715,8 @@ export class InstanceTemplatesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertInstanceTemplateRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -702,7 +736,27 @@ export class InstanceTemplatesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setIamPolicy( request?: protos.google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest, diff --git a/src/v1/instances_client.ts b/src/v1/instances_client.ts index d77f2eb9..b5bff76f 100644 --- a/src/v1/instances_client.ts +++ b/src/v1/instances_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class InstancesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -362,11 +366,8 @@ export class InstancesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -415,12 +416,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.addAccessConfig(request); + * const [operation] = await client.addAccessConfig(request); */ addAccessConfig( request?: protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest, @@ -442,11 +448,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -466,18 +469,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.addAccessConfig(request, options, callback); + return this.innerApiCalls + .addAccessConfig(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } addResourcePolicies( request?: protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -524,12 +544,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.addResourcePolicies(request); + * const [operation] = await client.addResourcePolicies(request); */ addResourcePolicies( request?: protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest, @@ -551,11 +576,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -575,15 +597,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.addResourcePolicies(request, options, callback); + return this.innerApiCalls + .addResourcePolicies(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } attachDisk( request?: protos.google.cloud.compute.v1.IAttachDiskInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IAttachDiskInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -632,12 +674,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.attachDisk(request); + * const [operation] = await client.attachDisk(request); */ attachDisk( request?: protos.google.cloud.compute.v1.IAttachDiskInstanceRequest, @@ -659,8 +706,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IAttachDiskInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -680,15 +727,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.attachDisk(request, options, callback); + return this.innerApiCalls + .attachDisk(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } bulkInsert( request?: protos.google.cloud.compute.v1.IBulkInsertInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IBulkInsertInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -733,12 +800,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.bulkInsert(request); + * const [operation] = await client.bulkInsert(request); */ bulkInsert( request?: protos.google.cloud.compute.v1.IBulkInsertInstanceRequest, @@ -760,8 +832,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IBulkInsertInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -781,15 +853,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.bulkInsert(request, options, callback); + return this.innerApiCalls + .bulkInsert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } delete( request?: protos.google.cloud.compute.v1.IDeleteInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -830,12 +922,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteInstanceRequest, @@ -855,8 +952,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -876,18 +973,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } deleteAccessConfig( request?: protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -936,12 +1050,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.deleteAccessConfig(request); + * const [operation] = await client.deleteAccessConfig(request); */ deleteAccessConfig( request?: protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest, @@ -963,11 +1082,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -987,15 +1103,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.deleteAccessConfig(request, options, callback); + return this.innerApiCalls + .deleteAccessConfig(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } detachDisk( request?: protos.google.cloud.compute.v1.IDetachDiskInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDetachDiskInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1042,12 +1178,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.detachDisk(request); + * const [operation] = await client.detachDisk(request); */ detachDisk( request?: protos.google.cloud.compute.v1.IDetachDiskInstanceRequest, @@ -1069,8 +1210,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDetachDiskInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1090,7 +1231,27 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.detachDisk(request, options, callback); + return this.innerApiCalls + .detachDisk(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetInstanceRequest, @@ -1798,8 +1959,8 @@ export class InstancesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1847,12 +2008,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertInstanceRequest, @@ -1872,8 +2038,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1893,18 +2059,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } removeResourcePolicies( request?: protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1951,12 +2134,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.removeResourcePolicies(request); + * const [operation] = await client.removeResourcePolicies(request); */ removeResourcePolicies( request?: protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest, @@ -1978,11 +2166,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -2002,19 +2187,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.removeResourcePolicies( - request, - options, - callback - ); + return this.innerApiCalls + .removeResourcePolicies(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } reset( request?: protos.google.cloud.compute.v1.IResetInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IResetInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -2055,12 +2256,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.reset(request); + * const [operation] = await client.reset(request); */ reset( request?: protos.google.cloud.compute.v1.IResetInstanceRequest, @@ -2080,8 +2286,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IResetInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -2101,18 +2307,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.reset(request, options, callback); + return this.innerApiCalls + .reset(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setDeletionProtection( request?: protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -2159,12 +2382,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setDeletionProtection(request); + * const [operation] = await client.setDeletionProtection(request); */ setDeletionProtection( request?: protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest, @@ -2186,11 +2414,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -2210,18 +2435,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setDeletionProtection(request, options, callback); + return this.innerApiCalls + .setDeletionProtection(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setDiskAutoDelete( request?: protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -2270,12 +2512,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setDiskAutoDelete(request); + * const [operation] = await client.setDiskAutoDelete(request); */ setDiskAutoDelete( request?: protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest, @@ -2297,11 +2544,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -2321,7 +2565,27 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setDiskAutoDelete(request, options, callback); + return this.innerApiCalls + .setDiskAutoDelete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setIamPolicy( request?: protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest, @@ -2425,8 +2689,8 @@ export class InstancesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetLabelsInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -2473,12 +2737,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setLabels(request); + * const [operation] = await client.setLabels(request); */ setLabels( request?: protos.google.cloud.compute.v1.ISetLabelsInstanceRequest, @@ -2500,8 +2769,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetLabelsInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -2521,18 +2790,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setLabels(request, options, callback); + return this.innerApiCalls + .setLabels(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setMachineResources( request?: protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -2579,12 +2865,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setMachineResources(request); + * const [operation] = await client.setMachineResources(request); */ setMachineResources( request?: protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest, @@ -2606,11 +2897,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -2630,15 +2918,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setMachineResources(request, options, callback); + return this.innerApiCalls + .setMachineResources(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setMachineType( request?: protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -2685,12 +2993,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setMachineType(request); + * const [operation] = await client.setMachineType(request); */ setMachineType( request?: protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest, @@ -2712,8 +3025,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -2733,15 +3046,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setMachineType(request, options, callback); + return this.innerApiCalls + .setMachineType(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setMetadata( request?: protos.google.cloud.compute.v1.ISetMetadataInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetMetadataInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -2788,12 +3121,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setMetadata(request); + * const [operation] = await client.setMetadata(request); */ setMetadata( request?: protos.google.cloud.compute.v1.ISetMetadataInstanceRequest, @@ -2815,8 +3153,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetMetadataInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -2836,18 +3174,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setMetadata(request, options, callback); + return this.innerApiCalls + .setMetadata(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setMinCpuPlatform( request?: protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -2894,12 +3249,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setMinCpuPlatform(request); + * const [operation] = await client.setMinCpuPlatform(request); */ setMinCpuPlatform( request?: protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest, @@ -2921,11 +3281,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -2945,15 +3302,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setMinCpuPlatform(request, options, callback); + return this.innerApiCalls + .setMinCpuPlatform(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setScheduling( request?: protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -3000,12 +3377,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setScheduling(request); + * const [operation] = await client.setScheduling(request); */ setScheduling( request?: protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest, @@ -3027,8 +3409,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -3048,18 +3430,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setScheduling(request, options, callback); + return this.innerApiCalls + .setScheduling(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setServiceAccount( request?: protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -3106,12 +3505,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setServiceAccount(request); + * const [operation] = await client.setServiceAccount(request); */ setServiceAccount( request?: protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest, @@ -3133,11 +3537,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -3157,18 +3558,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setServiceAccount(request, options, callback); + return this.innerApiCalls + .setServiceAccount(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setShieldedInstanceIntegrityPolicy( request?: protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -3215,12 +3633,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setShieldedInstanceIntegrityPolicy(request); + * const [operation] = await client.setShieldedInstanceIntegrityPolicy(request); */ setShieldedInstanceIntegrityPolicy( request?: protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest, @@ -3242,11 +3665,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -3266,19 +3686,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setShieldedInstanceIntegrityPolicy( - request, - options, - callback - ); + return this.innerApiCalls + .setShieldedInstanceIntegrityPolicy(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setTags( request?: protos.google.cloud.compute.v1.ISetTagsInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetTagsInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -3321,12 +3757,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setTags(request); + * const [operation] = await client.setTags(request); */ setTags( request?: protos.google.cloud.compute.v1.ISetTagsInstanceRequest, @@ -3346,8 +3787,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetTagsInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -3367,18 +3808,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setTags(request, options, callback); + return this.innerApiCalls + .setTags(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } simulateMaintenanceEvent( request?: protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -3417,12 +3875,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.simulateMaintenanceEvent(request); + * const [operation] = await client.simulateMaintenanceEvent(request); */ simulateMaintenanceEvent( request?: protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest, @@ -3444,11 +3907,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -3468,19 +3928,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.simulateMaintenanceEvent( - request, - options, - callback - ); + return this.innerApiCalls + .simulateMaintenanceEvent(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } start( request?: protos.google.cloud.compute.v1.IStartInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IStartInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -3521,12 +3997,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.start(request); + * const [operation] = await client.start(request); */ start( request?: protos.google.cloud.compute.v1.IStartInstanceRequest, @@ -3546,8 +4027,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IStartInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -3567,18 +4048,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.start(request, options, callback); + return this.innerApiCalls + .start(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } startWithEncryptionKey( request?: protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -3625,12 +4123,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.startWithEncryptionKey(request); + * const [operation] = await client.startWithEncryptionKey(request); */ startWithEncryptionKey( request?: protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest, @@ -3652,11 +4155,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -3676,19 +4176,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.startWithEncryptionKey( - request, - options, - callback - ); + return this.innerApiCalls + .startWithEncryptionKey(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } stop( request?: protos.google.cloud.compute.v1.IStopInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IStopInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -3729,12 +4245,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.stop(request); + * const [operation] = await client.stop(request); */ stop( request?: protos.google.cloud.compute.v1.IStopInstanceRequest, @@ -3754,8 +4275,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IStopInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -3775,7 +4296,27 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.stop(request, options, callback); + return this.innerApiCalls + .stop(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } testIamPermissions( request?: protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest, @@ -3885,8 +4426,8 @@ export class InstancesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -3933,12 +4474,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.update(request); + * const [operation] = await client.update(request); */ update( request?: protos.google.cloud.compute.v1.IUpdateInstanceRequest, @@ -3958,8 +4504,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -3979,18 +4525,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.update(request, options, callback); + return this.innerApiCalls + .update(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } updateAccessConfig( request?: protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -4039,12 +4602,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.updateAccessConfig(request); + * const [operation] = await client.updateAccessConfig(request); */ updateAccessConfig( request?: protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest, @@ -4066,11 +4634,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -4090,18 +4655,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.updateAccessConfig(request, options, callback); + return this.innerApiCalls + .updateAccessConfig(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } updateDisplayDevice( request?: protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -4148,12 +4730,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.updateDisplayDevice(request); + * const [operation] = await client.updateDisplayDevice(request); */ updateDisplayDevice( request?: protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest, @@ -4175,11 +4762,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -4199,18 +4783,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.updateDisplayDevice(request, options, callback); + return this.innerApiCalls + .updateDisplayDevice(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } updateNetworkInterface( request?: protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -4259,12 +4860,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.updateNetworkInterface(request); + * const [operation] = await client.updateNetworkInterface(request); */ updateNetworkInterface( request?: protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest, @@ -4286,11 +4892,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -4310,22 +4913,35 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.updateNetworkInterface( - request, - options, - callback - ); + return this.innerApiCalls + .updateNetworkInterface(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } updateShieldedInstanceConfig( request?: protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -4372,12 +4988,17 @@ export class InstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.updateShieldedInstanceConfig(request); + * const [operation] = await client.updateShieldedInstanceConfig(request); */ updateShieldedInstanceConfig( request?: protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest, @@ -4399,11 +5020,8 @@ export class InstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -4423,11 +5041,27 @@ export class InstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.updateShieldedInstanceConfig( - request, - options, - callback - ); + return this.innerApiCalls + .updateShieldedInstanceConfig(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/interconnect_attachments_client.ts b/src/v1/interconnect_attachments_client.ts index 3f213b9d..fd5d7b26 100644 --- a/src/v1/interconnect_attachments_client.ts +++ b/src/v1/interconnect_attachments_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -137,6 +138,9 @@ export class InterconnectAttachmentsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -322,11 +326,8 @@ export class InterconnectAttachmentsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -371,12 +372,17 @@ export class InterconnectAttachmentsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest, @@ -398,11 +404,8 @@ export class InterconnectAttachmentsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -422,7 +425,27 @@ export class InterconnectAttachmentsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetInterconnectAttachmentRequest, @@ -530,11 +553,8 @@ export class InterconnectAttachmentsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertInterconnectAttachmentRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -581,12 +601,17 @@ export class InterconnectAttachmentsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertInterconnectAttachmentRequest, @@ -608,11 +633,8 @@ export class InterconnectAttachmentsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertInterconnectAttachmentRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -632,18 +654,35 @@ export class InterconnectAttachmentsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchInterconnectAttachmentRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchInterconnectAttachmentRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -690,12 +729,17 @@ export class InterconnectAttachmentsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchInterconnectAttachmentRequest, @@ -717,11 +761,8 @@ export class InterconnectAttachmentsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchInterconnectAttachmentRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -741,7 +782,27 @@ export class InterconnectAttachmentsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/interconnect_locations_client.ts b/src/v1/interconnect_locations_client.ts index 9a8f23de..42ca8dce 100644 --- a/src/v1/interconnect_locations_client.ts +++ b/src/v1/interconnect_locations_client.ts @@ -137,6 +137,9 @@ export class InterconnectLocationsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; diff --git a/src/v1/interconnects_client.ts b/src/v1/interconnects_client.ts index c9e50d40..369345f3 100644 --- a/src/v1/interconnects_client.ts +++ b/src/v1/interconnects_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class InterconnectsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -316,8 +320,8 @@ export class InterconnectsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteInterconnectRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -360,12 +364,17 @@ export class InterconnectsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteInterconnectRequest, @@ -387,8 +396,8 @@ export class InterconnectsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteInterconnectRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -408,7 +417,27 @@ export class InterconnectsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetInterconnectRequest, @@ -601,8 +630,8 @@ export class InterconnectsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertInterconnectRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -645,12 +674,17 @@ export class InterconnectsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertInterconnectRequest, @@ -672,8 +706,8 @@ export class InterconnectsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertInterconnectRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -693,15 +727,35 @@ export class InterconnectsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchInterconnectRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchInterconnectRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -746,12 +800,17 @@ export class InterconnectsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchInterconnectRequest, @@ -773,8 +832,8 @@ export class InterconnectsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchInterconnectRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -794,7 +853,27 @@ export class InterconnectsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/license_codes_client.ts b/src/v1/license_codes_client.ts index 5c2eaf1c..e3292220 100644 --- a/src/v1/license_codes_client.ts +++ b/src/v1/license_codes_client.ts @@ -127,6 +127,9 @@ export class LicenseCodesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; diff --git a/src/v1/licenses_client.ts b/src/v1/licenses_client.ts index d78122d4..896dd365 100644 --- a/src/v1/licenses_client.ts +++ b/src/v1/licenses_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class LicensesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -317,8 +321,8 @@ export class LicensesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteLicenseRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -357,12 +361,17 @@ export class LicensesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteLicenseRequest, @@ -382,8 +391,8 @@ export class LicensesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteLicenseRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -403,7 +412,27 @@ export class LicensesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetLicenseRequest, @@ -590,8 +619,8 @@ export class LicensesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertLicenseRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -630,12 +659,17 @@ export class LicensesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertLicenseRequest, @@ -655,8 +689,8 @@ export class LicensesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertLicenseRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -676,7 +710,27 @@ export class LicensesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setIamPolicy( request?: protos.google.cloud.compute.v1.ISetIamPolicyLicenseRequest, diff --git a/src/v1/machine_types_client.ts b/src/v1/machine_types_client.ts index f97049d6..87e9319c 100644 --- a/src/v1/machine_types_client.ts +++ b/src/v1/machine_types_client.ts @@ -136,6 +136,9 @@ export class MachineTypesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; diff --git a/src/v1/network_endpoint_groups_client.ts b/src/v1/network_endpoint_groups_client.ts index bff94413..5be63b21 100644 --- a/src/v1/network_endpoint_groups_client.ts +++ b/src/v1/network_endpoint_groups_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -137,6 +138,9 @@ export class NetworkEndpointGroupsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -330,11 +334,8 @@ export class NetworkEndpointGroupsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -381,12 +382,17 @@ export class NetworkEndpointGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.attachNetworkEndpoints(request); + * const [operation] = await client.attachNetworkEndpoints(request); */ attachNetworkEndpoints( request?: protos.google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest, @@ -408,11 +414,8 @@ export class NetworkEndpointGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -432,22 +435,35 @@ export class NetworkEndpointGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.attachNetworkEndpoints( - request, - options, - callback - ); + return this.innerApiCalls + .attachNetworkEndpoints(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } delete( request?: protos.google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -492,12 +508,17 @@ export class NetworkEndpointGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest, @@ -519,11 +540,8 @@ export class NetworkEndpointGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -543,18 +561,35 @@ export class NetworkEndpointGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } detachNetworkEndpoints( request?: protos.google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -601,12 +636,17 @@ export class NetworkEndpointGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.detachNetworkEndpoints(request); + * const [operation] = await client.detachNetworkEndpoints(request); */ detachNetworkEndpoints( request?: protos.google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest, @@ -628,11 +668,8 @@ export class NetworkEndpointGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -652,11 +689,27 @@ export class NetworkEndpointGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.detachNetworkEndpoints( - request, - options, - callback - ); + return this.innerApiCalls + .detachNetworkEndpoints(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetNetworkEndpointGroupRequest, @@ -764,11 +817,8 @@ export class NetworkEndpointGroupsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -813,12 +863,17 @@ export class NetworkEndpointGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest, @@ -840,11 +895,8 @@ export class NetworkEndpointGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -864,7 +916,27 @@ export class NetworkEndpointGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } testIamPermissions( request?: protos.google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest, diff --git a/src/v1/networks_client.ts b/src/v1/networks_client.ts index f717e300..3e63eed2 100644 --- a/src/v1/networks_client.ts +++ b/src/v1/networks_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class NetworksClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -326,8 +330,8 @@ export class NetworksClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IAddPeeringNetworkRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -372,12 +376,17 @@ export class NetworksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.addPeering(request); + * const [operation] = await client.addPeering(request); */ addPeering( request?: protos.google.cloud.compute.v1.IAddPeeringNetworkRequest, @@ -399,8 +408,8 @@ export class NetworksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IAddPeeringNetworkRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -420,15 +429,35 @@ export class NetworksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.addPeering(request, options, callback); + return this.innerApiCalls + .addPeering(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } delete( request?: protos.google.cloud.compute.v1.IDeleteNetworkRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteNetworkRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -467,12 +496,17 @@ export class NetworksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteNetworkRequest, @@ -492,8 +526,8 @@ export class NetworksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteNetworkRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -513,7 +547,27 @@ export class NetworksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetNetworkRequest, @@ -704,8 +758,8 @@ export class NetworksClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertNetworkRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -744,12 +798,17 @@ export class NetworksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertNetworkRequest, @@ -769,8 +828,8 @@ export class NetworksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertNetworkRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -790,15 +849,35 @@ export class NetworksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchNetworkRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchNetworkRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -839,12 +918,17 @@ export class NetworksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchNetworkRequest, @@ -864,8 +948,8 @@ export class NetworksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchNetworkRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -885,15 +969,35 @@ export class NetworksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } removePeering( request?: protos.google.cloud.compute.v1.IRemovePeeringNetworkRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IRemovePeeringNetworkRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -938,12 +1042,17 @@ export class NetworksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.removePeering(request); + * const [operation] = await client.removePeering(request); */ removePeering( request?: protos.google.cloud.compute.v1.IRemovePeeringNetworkRequest, @@ -965,8 +1074,8 @@ export class NetworksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IRemovePeeringNetworkRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -986,18 +1095,35 @@ export class NetworksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.removePeering(request, options, callback); + return this.innerApiCalls + .removePeering(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } switchToCustomMode( request?: protos.google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1040,12 +1166,17 @@ export class NetworksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.switchToCustomMode(request); + * const [operation] = await client.switchToCustomMode(request); */ switchToCustomMode( request?: protos.google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest, @@ -1067,11 +1198,8 @@ export class NetworksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1091,15 +1219,35 @@ export class NetworksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.switchToCustomMode(request, options, callback); + return this.innerApiCalls + .switchToCustomMode(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } updatePeering( request?: protos.google.cloud.compute.v1.IUpdatePeeringNetworkRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdatePeeringNetworkRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1144,12 +1292,17 @@ export class NetworksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.updatePeering(request); + * const [operation] = await client.updatePeering(request); */ updatePeering( request?: protos.google.cloud.compute.v1.IUpdatePeeringNetworkRequest, @@ -1171,8 +1324,8 @@ export class NetworksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdatePeeringNetworkRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1192,7 +1345,27 @@ export class NetworksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.updatePeering(request, options, callback); + return this.innerApiCalls + .updatePeering(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/node_groups_client.ts b/src/v1/node_groups_client.ts index 58dcb89c..e59e6969 100644 --- a/src/v1/node_groups_client.ts +++ b/src/v1/node_groups_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class NodeGroupsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -333,8 +337,8 @@ export class NodeGroupsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IAddNodesNodeGroupRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -381,12 +385,17 @@ export class NodeGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.addNodes(request); + * const [operation] = await client.addNodes(request); */ addNodes( request?: protos.google.cloud.compute.v1.IAddNodesNodeGroupRequest, @@ -408,8 +417,8 @@ export class NodeGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IAddNodesNodeGroupRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -429,15 +438,35 @@ export class NodeGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.addNodes(request, options, callback); + return this.innerApiCalls + .addNodes(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } delete( request?: protos.google.cloud.compute.v1.IDeleteNodeGroupRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteNodeGroupRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -478,12 +507,17 @@ export class NodeGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteNodeGroupRequest, @@ -503,8 +537,8 @@ export class NodeGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteNodeGroupRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -524,15 +558,35 @@ export class NodeGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } deleteNodes( request?: protos.google.cloud.compute.v1.IDeleteNodesNodeGroupRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteNodesNodeGroupRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -579,12 +633,17 @@ export class NodeGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.deleteNodes(request); + * const [operation] = await client.deleteNodes(request); */ deleteNodes( request?: protos.google.cloud.compute.v1.IDeleteNodesNodeGroupRequest, @@ -606,8 +665,8 @@ export class NodeGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteNodesNodeGroupRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -627,7 +686,27 @@ export class NodeGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.deleteNodes(request, options, callback); + return this.innerApiCalls + .deleteNodes(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetNodeGroupRequest, @@ -820,8 +899,8 @@ export class NodeGroupsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertNodeGroupRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -864,12 +943,17 @@ export class NodeGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertNodeGroupRequest, @@ -889,8 +973,8 @@ export class NodeGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertNodeGroupRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -910,15 +994,35 @@ export class NodeGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchNodeGroupRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchNodeGroupRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -961,12 +1065,17 @@ export class NodeGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchNodeGroupRequest, @@ -986,8 +1095,8 @@ export class NodeGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchNodeGroupRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1007,7 +1116,27 @@ export class NodeGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setIamPolicy( request?: protos.google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest, @@ -1111,11 +1240,8 @@ export class NodeGroupsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1162,12 +1288,17 @@ export class NodeGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setNodeTemplate(request); + * const [operation] = await client.setNodeTemplate(request); */ setNodeTemplate( request?: protos.google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest, @@ -1189,11 +1320,8 @@ export class NodeGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1213,7 +1341,27 @@ export class NodeGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setNodeTemplate(request, options, callback); + return this.innerApiCalls + .setNodeTemplate(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } testIamPermissions( request?: protos.google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest, diff --git a/src/v1/node_templates_client.ts b/src/v1/node_templates_client.ts index 6fbf1b87..3f602195 100644 --- a/src/v1/node_templates_client.ts +++ b/src/v1/node_templates_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class NodeTemplatesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -323,8 +327,8 @@ export class NodeTemplatesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteNodeTemplateRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -369,12 +373,17 @@ export class NodeTemplatesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteNodeTemplateRequest, @@ -396,8 +405,8 @@ export class NodeTemplatesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteNodeTemplateRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -417,7 +426,27 @@ export class NodeTemplatesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetNodeTemplateRequest, @@ -616,8 +645,8 @@ export class NodeTemplatesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertNodeTemplateRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -662,12 +691,17 @@ export class NodeTemplatesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertNodeTemplateRequest, @@ -689,8 +723,8 @@ export class NodeTemplatesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertNodeTemplateRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -710,7 +744,27 @@ export class NodeTemplatesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setIamPolicy( request?: protos.google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest, diff --git a/src/v1/node_types_client.ts b/src/v1/node_types_client.ts index 9a0358b1..8fdd1ee1 100644 --- a/src/v1/node_types_client.ts +++ b/src/v1/node_types_client.ts @@ -136,6 +136,9 @@ export class NodeTypesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; diff --git a/src/v1/packet_mirrorings_client.ts b/src/v1/packet_mirrorings_client.ts index 2ac8ddf1..8e3a312a 100644 --- a/src/v1/packet_mirrorings_client.ts +++ b/src/v1/packet_mirrorings_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class PacketMirroringsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -322,8 +326,8 @@ export class PacketMirroringsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeletePacketMirroringRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -368,12 +372,17 @@ export class PacketMirroringsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeletePacketMirroringRequest, @@ -395,8 +404,8 @@ export class PacketMirroringsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeletePacketMirroringRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -416,7 +425,27 @@ export class PacketMirroringsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetPacketMirroringRequest, @@ -518,8 +547,8 @@ export class PacketMirroringsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertPacketMirroringRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -564,12 +593,17 @@ export class PacketMirroringsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertPacketMirroringRequest, @@ -591,8 +625,8 @@ export class PacketMirroringsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertPacketMirroringRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -612,15 +646,35 @@ export class PacketMirroringsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchPacketMirroringRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchPacketMirroringRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -667,12 +721,17 @@ export class PacketMirroringsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchPacketMirroringRequest, @@ -694,8 +753,8 @@ export class PacketMirroringsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchPacketMirroringRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -715,7 +774,27 @@ export class PacketMirroringsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } testIamPermissions( request?: protos.google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest, diff --git a/src/v1/projects_client.ts b/src/v1/projects_client.ts index 1475e3aa..4ad1f3d1 100644 --- a/src/v1/projects_client.ts +++ b/src/v1/projects_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class ProjectsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -328,8 +332,8 @@ export class ProjectsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -370,12 +374,17 @@ export class ProjectsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.disableXpnHost(request); + * const [operation] = await client.disableXpnHost(request); */ disableXpnHost( request?: protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest, @@ -397,8 +406,8 @@ export class ProjectsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -418,18 +427,35 @@ export class ProjectsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.disableXpnHost(request, options, callback); + return this.innerApiCalls + .disableXpnHost(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } disableXpnResource( request?: protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -472,12 +498,17 @@ export class ProjectsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.disableXpnResource(request); + * const [operation] = await client.disableXpnResource(request); */ disableXpnResource( request?: protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest, @@ -499,11 +530,8 @@ export class ProjectsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -523,15 +551,35 @@ export class ProjectsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.disableXpnResource(request, options, callback); + return this.innerApiCalls + .disableXpnResource(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } enableXpnHost( request?: protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -572,12 +620,17 @@ export class ProjectsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.enableXpnHost(request); + * const [operation] = await client.enableXpnHost(request); */ enableXpnHost( request?: protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest, @@ -599,8 +652,8 @@ export class ProjectsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -620,18 +673,35 @@ export class ProjectsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.enableXpnHost(request, options, callback); + return this.innerApiCalls + .enableXpnHost(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } enableXpnResource( request?: protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -674,12 +744,17 @@ export class ProjectsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.enableXpnResource(request); + * const [operation] = await client.enableXpnResource(request); */ enableXpnResource( request?: protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest, @@ -701,11 +776,8 @@ export class ProjectsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -725,7 +797,27 @@ export class ProjectsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.enableXpnResource(request, options, callback); + return this.innerApiCalls + .enableXpnResource(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetProjectRequest, @@ -906,8 +998,8 @@ export class ProjectsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IMoveDiskProjectRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -946,12 +1038,17 @@ export class ProjectsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.moveDisk(request); + * const [operation] = await client.moveDisk(request); */ moveDisk( request?: protos.google.cloud.compute.v1.IMoveDiskProjectRequest, @@ -971,8 +1068,8 @@ export class ProjectsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IMoveDiskProjectRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -992,15 +1089,35 @@ export class ProjectsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.moveDisk(request, options, callback); + return this.innerApiCalls + .moveDisk(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } moveInstance( request?: protos.google.cloud.compute.v1.IMoveInstanceProjectRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IMoveInstanceProjectRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1043,12 +1160,17 @@ export class ProjectsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.moveInstance(request); + * const [operation] = await client.moveInstance(request); */ moveInstance( request?: protos.google.cloud.compute.v1.IMoveInstanceProjectRequest, @@ -1070,8 +1192,8 @@ export class ProjectsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IMoveInstanceProjectRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1091,18 +1213,35 @@ export class ProjectsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.moveInstance(request, options, callback); + return this.innerApiCalls + .moveInstance(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setCommonInstanceMetadata( request?: protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1145,12 +1284,17 @@ export class ProjectsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setCommonInstanceMetadata(request); + * const [operation] = await client.setCommonInstanceMetadata(request); */ setCommonInstanceMetadata( request?: protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest, @@ -1172,11 +1316,8 @@ export class ProjectsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1196,22 +1337,35 @@ export class ProjectsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setCommonInstanceMetadata( - request, - options, - callback - ); + return this.innerApiCalls + .setCommonInstanceMetadata(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setDefaultNetworkTier( request?: protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1254,12 +1408,17 @@ export class ProjectsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setDefaultNetworkTier(request); + * const [operation] = await client.setDefaultNetworkTier(request); */ setDefaultNetworkTier( request?: protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest, @@ -1281,11 +1440,8 @@ export class ProjectsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1305,18 +1461,35 @@ export class ProjectsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setDefaultNetworkTier(request, options, callback); + return this.innerApiCalls + .setDefaultNetworkTier(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setUsageExportBucket( request?: protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1359,12 +1532,17 @@ export class ProjectsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setUsageExportBucket(request); + * const [operation] = await client.setUsageExportBucket(request); */ setUsageExportBucket( request?: protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest, @@ -1386,11 +1564,8 @@ export class ProjectsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1410,7 +1585,27 @@ export class ProjectsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setUsageExportBucket(request, options, callback); + return this.innerApiCalls + .setUsageExportBucket(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } getXpnResources( diff --git a/src/v1/public_advertised_prefixes_client.ts b/src/v1/public_advertised_prefixes_client.ts index bc25fee1..5c524d5c 100644 --- a/src/v1/public_advertised_prefixes_client.ts +++ b/src/v1/public_advertised_prefixes_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -137,6 +138,9 @@ export class PublicAdvertisedPrefixesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -317,11 +321,8 @@ export class PublicAdvertisedPrefixesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -364,12 +365,17 @@ export class PublicAdvertisedPrefixesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest, @@ -391,11 +397,8 @@ export class PublicAdvertisedPrefixesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -415,7 +418,27 @@ export class PublicAdvertisedPrefixesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest, @@ -521,11 +544,8 @@ export class PublicAdvertisedPrefixesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -568,12 +588,17 @@ export class PublicAdvertisedPrefixesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest, @@ -595,11 +620,8 @@ export class PublicAdvertisedPrefixesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -619,18 +641,35 @@ export class PublicAdvertisedPrefixesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -675,12 +714,17 @@ export class PublicAdvertisedPrefixesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest, @@ -702,11 +746,8 @@ export class PublicAdvertisedPrefixesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -726,7 +767,27 @@ export class PublicAdvertisedPrefixesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/public_delegated_prefixes_client.ts b/src/v1/public_delegated_prefixes_client.ts index 17f05851..52421129 100644 --- a/src/v1/public_delegated_prefixes_client.ts +++ b/src/v1/public_delegated_prefixes_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -137,6 +138,9 @@ export class PublicDelegatedPrefixesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -322,11 +326,8 @@ export class PublicDelegatedPrefixesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -371,12 +372,17 @@ export class PublicDelegatedPrefixesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest, @@ -398,11 +404,8 @@ export class PublicDelegatedPrefixesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -422,7 +425,27 @@ export class PublicDelegatedPrefixesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest, @@ -530,11 +553,8 @@ export class PublicDelegatedPrefixesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -579,12 +599,17 @@ export class PublicDelegatedPrefixesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest, @@ -606,11 +631,8 @@ export class PublicDelegatedPrefixesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -630,18 +652,35 @@ export class PublicDelegatedPrefixesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -688,12 +727,17 @@ export class PublicDelegatedPrefixesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest, @@ -715,11 +759,8 @@ export class PublicDelegatedPrefixesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -739,7 +780,27 @@ export class PublicDelegatedPrefixesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/region_autoscalers_client.ts b/src/v1/region_autoscalers_client.ts index 5458b2c7..72f69632 100644 --- a/src/v1/region_autoscalers_client.ts +++ b/src/v1/region_autoscalers_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class RegionAutoscalersClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -316,8 +320,8 @@ export class RegionAutoscalersClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteRegionAutoscalerRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -362,12 +366,17 @@ export class RegionAutoscalersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteRegionAutoscalerRequest, @@ -389,8 +398,8 @@ export class RegionAutoscalersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteRegionAutoscalerRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -410,7 +419,27 @@ export class RegionAutoscalersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetRegionAutoscalerRequest, @@ -512,8 +541,8 @@ export class RegionAutoscalersClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertRegionAutoscalerRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -558,12 +587,17 @@ export class RegionAutoscalersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertRegionAutoscalerRequest, @@ -585,8 +619,8 @@ export class RegionAutoscalersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertRegionAutoscalerRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -606,15 +640,35 @@ export class RegionAutoscalersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchRegionAutoscalerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchRegionAutoscalerRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -661,12 +715,17 @@ export class RegionAutoscalersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchRegionAutoscalerRequest, @@ -688,8 +747,8 @@ export class RegionAutoscalersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchRegionAutoscalerRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -709,15 +768,35 @@ export class RegionAutoscalersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } update( request?: protos.google.cloud.compute.v1.IUpdateRegionAutoscalerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateRegionAutoscalerRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -764,12 +843,17 @@ export class RegionAutoscalersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.update(request); + * const [operation] = await client.update(request); */ update( request?: protos.google.cloud.compute.v1.IUpdateRegionAutoscalerRequest, @@ -791,8 +875,8 @@ export class RegionAutoscalersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateRegionAutoscalerRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -812,7 +896,27 @@ export class RegionAutoscalersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.update(request, options, callback); + return this.innerApiCalls + .update(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/region_backend_services_client.ts b/src/v1/region_backend_services_client.ts index 26940d29..45d6d3c8 100644 --- a/src/v1/region_backend_services_client.ts +++ b/src/v1/region_backend_services_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -137,6 +138,9 @@ export class RegionBackendServicesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -318,11 +322,8 @@ export class RegionBackendServicesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteRegionBackendServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -367,12 +368,17 @@ export class RegionBackendServicesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteRegionBackendServiceRequest, @@ -394,11 +400,8 @@ export class RegionBackendServicesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteRegionBackendServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -418,7 +421,27 @@ export class RegionBackendServicesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetRegionBackendServiceRequest, @@ -628,11 +651,8 @@ export class RegionBackendServicesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertRegionBackendServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -677,12 +697,17 @@ export class RegionBackendServicesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertRegionBackendServiceRequest, @@ -704,11 +729,8 @@ export class RegionBackendServicesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertRegionBackendServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -728,18 +750,35 @@ export class RegionBackendServicesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchRegionBackendServiceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchRegionBackendServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -786,12 +825,17 @@ export class RegionBackendServicesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchRegionBackendServiceRequest, @@ -813,11 +857,8 @@ export class RegionBackendServicesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchRegionBackendServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -837,18 +878,35 @@ export class RegionBackendServicesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } update( request?: protos.google.cloud.compute.v1.IUpdateRegionBackendServiceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IUpdateRegionBackendServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -895,12 +953,17 @@ export class RegionBackendServicesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.update(request); + * const [operation] = await client.update(request); */ update( request?: protos.google.cloud.compute.v1.IUpdateRegionBackendServiceRequest, @@ -922,11 +985,8 @@ export class RegionBackendServicesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IUpdateRegionBackendServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -946,7 +1006,27 @@ export class RegionBackendServicesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.update(request, options, callback); + return this.innerApiCalls + .update(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/region_commitments_client.ts b/src/v1/region_commitments_client.ts index 422f959d..03ead3c2 100644 --- a/src/v1/region_commitments_client.ts +++ b/src/v1/region_commitments_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class RegionCommitmentsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -414,8 +418,8 @@ export class RegionCommitmentsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertRegionCommitmentRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -460,12 +464,17 @@ export class RegionCommitmentsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertRegionCommitmentRequest, @@ -487,8 +496,8 @@ export class RegionCommitmentsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertRegionCommitmentRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -508,7 +517,27 @@ export class RegionCommitmentsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/region_disk_types_client.ts b/src/v1/region_disk_types_client.ts index 03753d40..f98ee095 100644 --- a/src/v1/region_disk_types_client.ts +++ b/src/v1/region_disk_types_client.ts @@ -136,6 +136,9 @@ export class RegionDiskTypesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; diff --git a/src/v1/region_disks_client.ts b/src/v1/region_disks_client.ts index 788414e9..1dcdd2bf 100644 --- a/src/v1/region_disks_client.ts +++ b/src/v1/region_disks_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class RegionDisksClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -322,11 +326,8 @@ export class RegionDisksClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -373,12 +374,17 @@ export class RegionDisksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.addResourcePolicies(request); + * const [operation] = await client.addResourcePolicies(request); */ addResourcePolicies( request?: protos.google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest, @@ -400,11 +406,8 @@ export class RegionDisksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -424,18 +427,35 @@ export class RegionDisksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.addResourcePolicies(request, options, callback); + return this.innerApiCalls + .addResourcePolicies(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } createSnapshot( request?: protos.google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -482,12 +502,17 @@ export class RegionDisksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.createSnapshot(request); + * const [operation] = await client.createSnapshot(request); */ createSnapshot( request?: protos.google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest, @@ -509,11 +534,8 @@ export class RegionDisksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -533,15 +555,35 @@ export class RegionDisksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.createSnapshot(request, options, callback); + return this.innerApiCalls + .createSnapshot(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } delete( request?: protos.google.cloud.compute.v1.IDeleteRegionDiskRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteRegionDiskRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -586,12 +628,17 @@ export class RegionDisksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteRegionDiskRequest, @@ -613,8 +660,8 @@ export class RegionDisksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteRegionDiskRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -634,7 +681,27 @@ export class RegionDisksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetRegionDiskRequest, @@ -827,8 +894,8 @@ export class RegionDisksClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertRegionDiskRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -875,12 +942,17 @@ export class RegionDisksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertRegionDiskRequest, @@ -902,8 +974,8 @@ export class RegionDisksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertRegionDiskRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -923,18 +995,35 @@ export class RegionDisksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } removeResourcePolicies( request?: protos.google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -981,12 +1070,17 @@ export class RegionDisksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.removeResourcePolicies(request); + * const [operation] = await client.removeResourcePolicies(request); */ removeResourcePolicies( request?: protos.google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest, @@ -1008,11 +1102,8 @@ export class RegionDisksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1032,19 +1123,35 @@ export class RegionDisksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.removeResourcePolicies( - request, - options, - callback - ); + return this.innerApiCalls + .removeResourcePolicies(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } resize( request?: protos.google.cloud.compute.v1.IResizeRegionDiskRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IResizeRegionDiskRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1091,12 +1198,17 @@ export class RegionDisksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.resize(request); + * const [operation] = await client.resize(request); */ resize( request?: protos.google.cloud.compute.v1.IResizeRegionDiskRequest, @@ -1118,8 +1230,8 @@ export class RegionDisksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IResizeRegionDiskRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1139,7 +1251,27 @@ export class RegionDisksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.resize(request, options, callback); + return this.innerApiCalls + .resize(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setIamPolicy( request?: protos.google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest, @@ -1243,8 +1375,8 @@ export class RegionDisksClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetLabelsRegionDiskRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1291,12 +1423,17 @@ export class RegionDisksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setLabels(request); + * const [operation] = await client.setLabels(request); */ setLabels( request?: protos.google.cloud.compute.v1.ISetLabelsRegionDiskRequest, @@ -1318,8 +1455,8 @@ export class RegionDisksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetLabelsRegionDiskRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1339,7 +1476,27 @@ export class RegionDisksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setLabels(request, options, callback); + return this.innerApiCalls + .setLabels(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } testIamPermissions( request?: protos.google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest, diff --git a/src/v1/region_health_check_services_client.ts b/src/v1/region_health_check_services_client.ts index 996e5949..40bc9125 100644 --- a/src/v1/region_health_check_services_client.ts +++ b/src/v1/region_health_check_services_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -137,6 +138,9 @@ export class RegionHealthCheckServicesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -317,11 +321,8 @@ export class RegionHealthCheckServicesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -366,12 +367,17 @@ export class RegionHealthCheckServicesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest, @@ -393,11 +399,8 @@ export class RegionHealthCheckServicesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -417,7 +420,27 @@ export class RegionHealthCheckServicesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest, @@ -525,11 +548,8 @@ export class RegionHealthCheckServicesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -574,12 +594,17 @@ export class RegionHealthCheckServicesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest, @@ -601,11 +626,8 @@ export class RegionHealthCheckServicesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -625,18 +647,35 @@ export class RegionHealthCheckServicesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -683,12 +722,17 @@ export class RegionHealthCheckServicesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest, @@ -710,11 +754,8 @@ export class RegionHealthCheckServicesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -734,7 +775,27 @@ export class RegionHealthCheckServicesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/region_health_checks_client.ts b/src/v1/region_health_checks_client.ts index 2ad6193a..db4d85a9 100644 --- a/src/v1/region_health_checks_client.ts +++ b/src/v1/region_health_checks_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class RegionHealthChecksClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -316,11 +320,8 @@ export class RegionHealthChecksClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteRegionHealthCheckRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -365,12 +366,17 @@ export class RegionHealthChecksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteRegionHealthCheckRequest, @@ -392,11 +398,8 @@ export class RegionHealthChecksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteRegionHealthCheckRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -416,7 +419,27 @@ export class RegionHealthChecksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetRegionHealthCheckRequest, @@ -518,11 +541,8 @@ export class RegionHealthChecksClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertRegionHealthCheckRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -567,12 +587,17 @@ export class RegionHealthChecksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertRegionHealthCheckRequest, @@ -594,11 +619,8 @@ export class RegionHealthChecksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertRegionHealthCheckRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -618,15 +640,35 @@ export class RegionHealthChecksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchRegionHealthCheckRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchRegionHealthCheckRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -673,12 +715,17 @@ export class RegionHealthChecksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchRegionHealthCheckRequest, @@ -700,8 +747,8 @@ export class RegionHealthChecksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchRegionHealthCheckRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -721,18 +768,35 @@ export class RegionHealthChecksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } update( request?: protos.google.cloud.compute.v1.IUpdateRegionHealthCheckRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IUpdateRegionHealthCheckRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -779,12 +843,17 @@ export class RegionHealthChecksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.update(request); + * const [operation] = await client.update(request); */ update( request?: protos.google.cloud.compute.v1.IUpdateRegionHealthCheckRequest, @@ -806,11 +875,8 @@ export class RegionHealthChecksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IUpdateRegionHealthCheckRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -830,7 +896,27 @@ export class RegionHealthChecksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.update(request, options, callback); + return this.innerApiCalls + .update(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/region_instance_group_managers_client.ts b/src/v1/region_instance_group_managers_client.ts index cb7dc981..f895eab1 100644 --- a/src/v1/region_instance_group_managers_client.ts +++ b/src/v1/region_instance_group_managers_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -137,6 +138,9 @@ export class RegionInstanceGroupManagersClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -346,11 +350,8 @@ export class RegionInstanceGroupManagersClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -401,12 +402,17 @@ export class RegionInstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.abandonInstances(request); + * const [operation] = await client.abandonInstances(request); */ abandonInstances( request?: protos.google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest, @@ -428,11 +434,8 @@ export class RegionInstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -452,18 +455,35 @@ export class RegionInstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.abandonInstances(request, options, callback); + return this.innerApiCalls + .abandonInstances(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } applyUpdatesToInstances( request?: protos.google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -504,12 +524,17 @@ export class RegionInstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.applyUpdatesToInstances(request); + * const [operation] = await client.applyUpdatesToInstances(request); */ applyUpdatesToInstances( request?: protos.google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest, @@ -531,11 +556,8 @@ export class RegionInstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -555,22 +577,35 @@ export class RegionInstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.applyUpdatesToInstances( - request, - options, - callback - ); + return this.innerApiCalls + .applyUpdatesToInstances(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } createInstances( request?: protos.google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -617,12 +652,17 @@ export class RegionInstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.createInstances(request); + * const [operation] = await client.createInstances(request); */ createInstances( request?: protos.google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest, @@ -644,11 +684,8 @@ export class RegionInstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -668,18 +705,35 @@ export class RegionInstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.createInstances(request, options, callback); + return this.innerApiCalls + .createInstances(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } delete( request?: protos.google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -724,12 +778,17 @@ export class RegionInstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest, @@ -751,11 +810,8 @@ export class RegionInstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -775,18 +831,35 @@ export class RegionInstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } deleteInstances( request?: protos.google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -837,12 +910,17 @@ export class RegionInstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.deleteInstances(request); + * const [operation] = await client.deleteInstances(request); */ deleteInstances( request?: protos.google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest, @@ -864,11 +942,8 @@ export class RegionInstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -888,18 +963,35 @@ export class RegionInstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.deleteInstances(request, options, callback); + return this.innerApiCalls + .deleteInstances(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } deletePerInstanceConfigs( request?: protos.google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -940,12 +1032,17 @@ export class RegionInstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.deletePerInstanceConfigs(request); + * const [operation] = await client.deletePerInstanceConfigs(request); */ deletePerInstanceConfigs( request?: protos.google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest, @@ -967,11 +1064,8 @@ export class RegionInstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -991,11 +1085,27 @@ export class RegionInstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.deletePerInstanceConfigs( - request, - options, - callback - ); + return this.innerApiCalls + .deletePerInstanceConfigs(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest, @@ -1103,11 +1213,8 @@ export class RegionInstanceGroupManagersClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1154,12 +1261,17 @@ export class RegionInstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest, @@ -1181,11 +1293,8 @@ export class RegionInstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1205,18 +1314,35 @@ export class RegionInstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1263,12 +1389,17 @@ export class RegionInstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest, @@ -1290,11 +1421,8 @@ export class RegionInstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1314,18 +1442,35 @@ export class RegionInstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patchPerInstanceConfigs( request?: protos.google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1372,12 +1517,17 @@ export class RegionInstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patchPerInstanceConfigs(request); + * const [operation] = await client.patchPerInstanceConfigs(request); */ patchPerInstanceConfigs( request?: protos.google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest, @@ -1399,11 +1549,8 @@ export class RegionInstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1423,22 +1570,35 @@ export class RegionInstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patchPerInstanceConfigs( - request, - options, - callback - ); + return this.innerApiCalls + .patchPerInstanceConfigs(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } recreateInstances( request?: protos.google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1489,12 +1649,17 @@ export class RegionInstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.recreateInstances(request); + * const [operation] = await client.recreateInstances(request); */ recreateInstances( request?: protos.google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest, @@ -1516,11 +1681,8 @@ export class RegionInstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1540,18 +1702,35 @@ export class RegionInstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.recreateInstances(request, options, callback); + return this.innerApiCalls + .recreateInstances(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } resize( request?: protos.google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1602,12 +1781,17 @@ export class RegionInstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.resize(request); + * const [operation] = await client.resize(request); */ resize( request?: protos.google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest, @@ -1629,11 +1813,8 @@ export class RegionInstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1653,18 +1834,35 @@ export class RegionInstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.resize(request, options, callback); + return this.innerApiCalls + .resize(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setInstanceTemplate( request?: protos.google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1711,12 +1909,17 @@ export class RegionInstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setInstanceTemplate(request); + * const [operation] = await client.setInstanceTemplate(request); */ setInstanceTemplate( request?: protos.google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest, @@ -1738,11 +1941,8 @@ export class RegionInstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1762,18 +1962,35 @@ export class RegionInstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setInstanceTemplate(request, options, callback); + return this.innerApiCalls + .setInstanceTemplate(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setTargetPools( request?: protos.google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1820,12 +2037,17 @@ export class RegionInstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setTargetPools(request); + * const [operation] = await client.setTargetPools(request); */ setTargetPools( request?: protos.google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest, @@ -1847,11 +2069,8 @@ export class RegionInstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1871,18 +2090,35 @@ export class RegionInstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setTargetPools(request, options, callback); + return this.innerApiCalls + .setTargetPools(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } updatePerInstanceConfigs( request?: protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1929,12 +2165,17 @@ export class RegionInstanceGroupManagersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.updatePerInstanceConfigs(request); + * const [operation] = await client.updatePerInstanceConfigs(request); */ updatePerInstanceConfigs( request?: protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, @@ -1956,11 +2197,8 @@ export class RegionInstanceGroupManagersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1980,11 +2218,27 @@ export class RegionInstanceGroupManagersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.updatePerInstanceConfigs( - request, - options, - callback - ); + return this.innerApiCalls + .updatePerInstanceConfigs(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/region_instance_groups_client.ts b/src/v1/region_instance_groups_client.ts index fa40858e..ec727047 100644 --- a/src/v1/region_instance_groups_client.ts +++ b/src/v1/region_instance_groups_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class RegionInstanceGroupsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -414,11 +418,8 @@ export class RegionInstanceGroupsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -465,12 +466,17 @@ export class RegionInstanceGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setNamedPorts(request); + * const [operation] = await client.setNamedPorts(request); */ setNamedPorts( request?: protos.google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest, @@ -492,11 +498,8 @@ export class RegionInstanceGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -516,7 +519,27 @@ export class RegionInstanceGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setNamedPorts(request, options, callback); + return this.innerApiCalls + .setNamedPorts(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/region_instances_client.ts b/src/v1/region_instances_client.ts index 6a7e3818..6c235d29 100644 --- a/src/v1/region_instances_client.ts +++ b/src/v1/region_instances_client.ts @@ -18,7 +18,13 @@ /* global window */ import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, +} from 'google-gax'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -127,6 +133,9 @@ export class RegionInstancesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -289,11 +298,8 @@ export class RegionInstancesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IBulkInsertRegionInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -338,12 +344,17 @@ export class RegionInstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.bulkInsert(request); + * const [operation] = await client.bulkInsert(request); */ bulkInsert( request?: protos.google.cloud.compute.v1.IBulkInsertRegionInstanceRequest, @@ -365,11 +376,8 @@ export class RegionInstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IBulkInsertRegionInstanceRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -389,7 +397,27 @@ export class RegionInstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.bulkInsert(request, options, callback); + return this.innerApiCalls + .bulkInsert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/region_network_endpoint_groups_client.ts b/src/v1/region_network_endpoint_groups_client.ts index 0b1f2570..2624846f 100644 --- a/src/v1/region_network_endpoint_groups_client.ts +++ b/src/v1/region_network_endpoint_groups_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -137,6 +138,9 @@ export class RegionNetworkEndpointGroupsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -316,11 +320,8 @@ export class RegionNetworkEndpointGroupsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -365,12 +366,17 @@ export class RegionNetworkEndpointGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest, @@ -392,11 +398,8 @@ export class RegionNetworkEndpointGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -416,7 +419,27 @@ export class RegionNetworkEndpointGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest, @@ -524,11 +547,8 @@ export class RegionNetworkEndpointGroupsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -573,12 +593,17 @@ export class RegionNetworkEndpointGroupsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest, @@ -600,11 +625,8 @@ export class RegionNetworkEndpointGroupsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -624,7 +646,27 @@ export class RegionNetworkEndpointGroupsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/region_notification_endpoints_client.ts b/src/v1/region_notification_endpoints_client.ts index aff63dd4..3c9a88f8 100644 --- a/src/v1/region_notification_endpoints_client.ts +++ b/src/v1/region_notification_endpoints_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -137,6 +138,9 @@ export class RegionNotificationEndpointsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -316,11 +320,8 @@ export class RegionNotificationEndpointsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -365,12 +366,17 @@ export class RegionNotificationEndpointsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest, @@ -392,11 +398,8 @@ export class RegionNotificationEndpointsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -416,7 +419,27 @@ export class RegionNotificationEndpointsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetRegionNotificationEndpointRequest, @@ -524,11 +547,8 @@ export class RegionNotificationEndpointsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -573,12 +593,17 @@ export class RegionNotificationEndpointsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest, @@ -600,11 +625,8 @@ export class RegionNotificationEndpointsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -624,7 +646,27 @@ export class RegionNotificationEndpointsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/region_operations_client.ts b/src/v1/region_operations_client.ts index e3953a21..569fe5cf 100644 --- a/src/v1/region_operations_client.ts +++ b/src/v1/region_operations_client.ts @@ -136,6 +136,9 @@ export class RegionOperationsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; diff --git a/src/v1/region_ssl_certificates_client.ts b/src/v1/region_ssl_certificates_client.ts index 99a5c307..ef8fcfda 100644 --- a/src/v1/region_ssl_certificates_client.ts +++ b/src/v1/region_ssl_certificates_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -137,6 +138,9 @@ export class RegionSslCertificatesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -315,11 +319,8 @@ export class RegionSslCertificatesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteRegionSslCertificateRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -364,12 +365,17 @@ export class RegionSslCertificatesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteRegionSslCertificateRequest, @@ -391,11 +397,8 @@ export class RegionSslCertificatesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteRegionSslCertificateRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -415,7 +418,27 @@ export class RegionSslCertificatesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetRegionSslCertificateRequest, @@ -523,11 +546,8 @@ export class RegionSslCertificatesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertRegionSslCertificateRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -572,12 +592,17 @@ export class RegionSslCertificatesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertRegionSslCertificateRequest, @@ -599,11 +624,8 @@ export class RegionSslCertificatesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertRegionSslCertificateRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -623,7 +645,27 @@ export class RegionSslCertificatesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/region_target_http_proxies_client.ts b/src/v1/region_target_http_proxies_client.ts index dcee20c5..441a7004 100644 --- a/src/v1/region_target_http_proxies_client.ts +++ b/src/v1/region_target_http_proxies_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -137,6 +138,9 @@ export class RegionTargetHttpProxiesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -316,11 +320,8 @@ export class RegionTargetHttpProxiesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -365,12 +366,17 @@ export class RegionTargetHttpProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest, @@ -392,11 +398,8 @@ export class RegionTargetHttpProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -416,7 +419,27 @@ export class RegionTargetHttpProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest, @@ -524,11 +547,8 @@ export class RegionTargetHttpProxiesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -573,12 +593,17 @@ export class RegionTargetHttpProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest, @@ -600,11 +625,8 @@ export class RegionTargetHttpProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -624,18 +646,35 @@ export class RegionTargetHttpProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setUrlMap( request?: protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -682,12 +721,17 @@ export class RegionTargetHttpProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setUrlMap(request); + * const [operation] = await client.setUrlMap(request); */ setUrlMap( request?: protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest, @@ -709,11 +753,8 @@ export class RegionTargetHttpProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -733,7 +774,27 @@ export class RegionTargetHttpProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setUrlMap(request, options, callback); + return this.innerApiCalls + .setUrlMap(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/region_target_https_proxies_client.ts b/src/v1/region_target_https_proxies_client.ts index b0881fd9..ff6ca774 100644 --- a/src/v1/region_target_https_proxies_client.ts +++ b/src/v1/region_target_https_proxies_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -137,6 +138,9 @@ export class RegionTargetHttpsProxiesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -318,11 +322,8 @@ export class RegionTargetHttpsProxiesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -367,12 +368,17 @@ export class RegionTargetHttpsProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest, @@ -394,11 +400,8 @@ export class RegionTargetHttpsProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -418,7 +421,27 @@ export class RegionTargetHttpsProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest, @@ -526,11 +549,8 @@ export class RegionTargetHttpsProxiesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -575,12 +595,17 @@ export class RegionTargetHttpsProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest, @@ -602,11 +627,8 @@ export class RegionTargetHttpsProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -626,18 +648,35 @@ export class RegionTargetHttpsProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setSslCertificates( request?: protos.google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -684,12 +723,17 @@ export class RegionTargetHttpsProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setSslCertificates(request); + * const [operation] = await client.setSslCertificates(request); */ setSslCertificates( request?: protos.google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest, @@ -711,11 +755,8 @@ export class RegionTargetHttpsProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -735,18 +776,35 @@ export class RegionTargetHttpsProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setSslCertificates(request, options, callback); + return this.innerApiCalls + .setSslCertificates(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setUrlMap( request?: protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -793,12 +851,17 @@ export class RegionTargetHttpsProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setUrlMap(request); + * const [operation] = await client.setUrlMap(request); */ setUrlMap( request?: protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest, @@ -820,11 +883,8 @@ export class RegionTargetHttpsProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -844,7 +904,27 @@ export class RegionTargetHttpsProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setUrlMap(request, options, callback); + return this.innerApiCalls + .setUrlMap(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/region_url_maps_client.ts b/src/v1/region_url_maps_client.ts index 6ec9b799..3e511076 100644 --- a/src/v1/region_url_maps_client.ts +++ b/src/v1/region_url_maps_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class RegionUrlMapsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -317,8 +321,8 @@ export class RegionUrlMapsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteRegionUrlMapRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -359,12 +363,17 @@ export class RegionUrlMapsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteRegionUrlMapRequest, @@ -386,8 +395,8 @@ export class RegionUrlMapsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteRegionUrlMapRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -407,7 +416,27 @@ export class RegionUrlMapsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetRegionUrlMapRequest, @@ -503,8 +532,8 @@ export class RegionUrlMapsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertRegionUrlMapRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -545,12 +574,17 @@ export class RegionUrlMapsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertRegionUrlMapRequest, @@ -572,8 +606,8 @@ export class RegionUrlMapsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertRegionUrlMapRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -593,15 +627,35 @@ export class RegionUrlMapsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchRegionUrlMapRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchRegionUrlMapRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -644,12 +698,17 @@ export class RegionUrlMapsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchRegionUrlMapRequest, @@ -671,8 +730,8 @@ export class RegionUrlMapsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchRegionUrlMapRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -692,15 +751,35 @@ export class RegionUrlMapsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } update( request?: protos.google.cloud.compute.v1.IUpdateRegionUrlMapRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateRegionUrlMapRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -743,12 +822,17 @@ export class RegionUrlMapsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.update(request); + * const [operation] = await client.update(request); */ update( request?: protos.google.cloud.compute.v1.IUpdateRegionUrlMapRequest, @@ -770,8 +854,8 @@ export class RegionUrlMapsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateRegionUrlMapRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -791,7 +875,27 @@ export class RegionUrlMapsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.update(request, options, callback); + return this.innerApiCalls + .update(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } validate( request?: protos.google.cloud.compute.v1.IValidateRegionUrlMapRequest, diff --git a/src/v1/regions_client.ts b/src/v1/regions_client.ts index 8be30656..5d2c8ce0 100644 --- a/src/v1/regions_client.ts +++ b/src/v1/regions_client.ts @@ -136,6 +136,9 @@ export class RegionsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; diff --git a/src/v1/reservations_client.ts b/src/v1/reservations_client.ts index 2564bc86..a7372e3e 100644 --- a/src/v1/reservations_client.ts +++ b/src/v1/reservations_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class ReservationsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -324,8 +328,8 @@ export class ReservationsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteReservationRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -370,12 +374,17 @@ export class ReservationsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteReservationRequest, @@ -397,8 +406,8 @@ export class ReservationsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteReservationRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -418,7 +427,27 @@ export class ReservationsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetReservationRequest, @@ -617,8 +646,8 @@ export class ReservationsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertReservationRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -663,12 +692,17 @@ export class ReservationsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertReservationRequest, @@ -690,8 +724,8 @@ export class ReservationsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertReservationRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -711,15 +745,35 @@ export class ReservationsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } resize( request?: protos.google.cloud.compute.v1.IResizeReservationRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IResizeReservationRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -766,12 +820,17 @@ export class ReservationsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.resize(request); + * const [operation] = await client.resize(request); */ resize( request?: protos.google.cloud.compute.v1.IResizeReservationRequest, @@ -793,8 +852,8 @@ export class ReservationsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IResizeReservationRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -814,7 +873,27 @@ export class ReservationsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.resize(request, options, callback); + return this.innerApiCalls + .resize(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setIamPolicy( request?: protos.google.cloud.compute.v1.ISetIamPolicyReservationRequest, diff --git a/src/v1/resource_policies_client.ts b/src/v1/resource_policies_client.ts index f03f849f..a79e4b95 100644 --- a/src/v1/resource_policies_client.ts +++ b/src/v1/resource_policies_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class ResourcePoliciesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -323,8 +327,8 @@ export class ResourcePoliciesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteResourcePolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -369,12 +373,17 @@ export class ResourcePoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteResourcePolicyRequest, @@ -396,8 +405,8 @@ export class ResourcePoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteResourcePolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -417,7 +426,27 @@ export class ResourcePoliciesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetResourcePolicyRequest, @@ -622,8 +651,8 @@ export class ResourcePoliciesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertResourcePolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -668,12 +697,17 @@ export class ResourcePoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertResourcePolicyRequest, @@ -695,8 +729,8 @@ export class ResourcePoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertResourcePolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -716,7 +750,27 @@ export class ResourcePoliciesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setIamPolicy( request?: protos.google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest, diff --git a/src/v1/routers_client.ts b/src/v1/routers_client.ts index 9f73cafd..84cf11c0 100644 --- a/src/v1/routers_client.ts +++ b/src/v1/routers_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class RoutersClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -330,8 +334,8 @@ export class RoutersClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteRouterRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -372,12 +376,17 @@ export class RoutersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteRouterRequest, @@ -397,8 +406,8 @@ export class RoutersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteRouterRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -418,7 +427,27 @@ export class RoutersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetRouterRequest, @@ -607,8 +636,8 @@ export class RoutersClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertRouterRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -649,12 +678,17 @@ export class RoutersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertRouterRequest, @@ -674,8 +708,8 @@ export class RoutersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertRouterRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -695,15 +729,35 @@ export class RoutersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchRouterRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchRouterRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -746,12 +800,17 @@ export class RoutersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchRouterRequest, @@ -769,8 +828,8 @@ export class RoutersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchRouterRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -790,7 +849,27 @@ export class RoutersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } preview( request?: protos.google.cloud.compute.v1.IPreviewRouterRequest, @@ -888,8 +967,8 @@ export class RoutersClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateRouterRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -932,12 +1011,17 @@ export class RoutersClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.update(request); + * const [operation] = await client.update(request); */ update( request?: protos.google.cloud.compute.v1.IUpdateRouterRequest, @@ -957,8 +1041,8 @@ export class RoutersClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateRouterRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -978,7 +1062,27 @@ export class RoutersClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.update(request, options, callback); + return this.innerApiCalls + .update(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/routes_client.ts b/src/v1/routes_client.ts index 4edc2ca8..cf3b9619 100644 --- a/src/v1/routes_client.ts +++ b/src/v1/routes_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class RoutesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -309,8 +313,8 @@ export class RoutesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteRouteRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -349,12 +353,17 @@ export class RoutesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteRouteRequest, @@ -372,8 +381,8 @@ export class RoutesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteRouteRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -393,7 +402,27 @@ export class RoutesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetRouteRequest, @@ -485,8 +514,8 @@ export class RoutesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertRouteRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -525,12 +554,17 @@ export class RoutesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertRouteRequest, @@ -548,8 +582,8 @@ export class RoutesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertRouteRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -569,7 +603,27 @@ export class RoutesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/security_policies_client.ts b/src/v1/security_policies_client.ts index 93506165..9661ec5b 100644 --- a/src/v1/security_policies_client.ts +++ b/src/v1/security_policies_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class SecurityPoliciesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -320,8 +324,8 @@ export class SecurityPoliciesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IAddRuleSecurityPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -360,12 +364,17 @@ export class SecurityPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.addRule(request); + * const [operation] = await client.addRule(request); */ addRule( request?: protos.google.cloud.compute.v1.IAddRuleSecurityPolicyRequest, @@ -387,8 +396,8 @@ export class SecurityPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IAddRuleSecurityPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -408,15 +417,35 @@ export class SecurityPoliciesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.addRule(request, options, callback); + return this.innerApiCalls + .addRule(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } delete( request?: protos.google.cloud.compute.v1.IDeleteSecurityPolicyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteSecurityPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -459,12 +488,17 @@ export class SecurityPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteSecurityPolicyRequest, @@ -486,8 +520,8 @@ export class SecurityPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteSecurityPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -507,7 +541,27 @@ export class SecurityPoliciesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetSecurityPolicyRequest, @@ -702,8 +756,8 @@ export class SecurityPoliciesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertSecurityPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -746,12 +800,17 @@ export class SecurityPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertSecurityPolicyRequest, @@ -773,8 +832,8 @@ export class SecurityPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertSecurityPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -794,7 +853,27 @@ export class SecurityPoliciesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } listPreconfiguredExpressionSets( request?: protos.google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest, @@ -922,8 +1001,8 @@ export class SecurityPoliciesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchSecurityPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -968,12 +1047,17 @@ export class SecurityPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchSecurityPolicyRequest, @@ -995,8 +1079,8 @@ export class SecurityPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchSecurityPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1016,18 +1100,35 @@ export class SecurityPoliciesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patchRule( request?: protos.google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1068,12 +1169,17 @@ export class SecurityPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patchRule(request); + * const [operation] = await client.patchRule(request); */ patchRule( request?: protos.google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest, @@ -1095,11 +1201,8 @@ export class SecurityPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1119,18 +1222,35 @@ export class SecurityPoliciesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patchRule(request, options, callback); + return this.innerApiCalls + .patchRule(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } removeRule( request?: protos.google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1169,12 +1289,17 @@ export class SecurityPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.removeRule(request); + * const [operation] = await client.removeRule(request); */ removeRule( request?: protos.google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest, @@ -1196,11 +1321,8 @@ export class SecurityPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1220,7 +1342,27 @@ export class SecurityPoliciesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.removeRule(request, options, callback); + return this.innerApiCalls + .removeRule(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/snapshots_client.ts b/src/v1/snapshots_client.ts index 84053749..87d4f049 100644 --- a/src/v1/snapshots_client.ts +++ b/src/v1/snapshots_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class SnapshotsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -317,8 +321,8 @@ export class SnapshotsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteSnapshotRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -359,12 +363,17 @@ export class SnapshotsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteSnapshotRequest, @@ -384,8 +393,8 @@ export class SnapshotsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteSnapshotRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -405,7 +414,27 @@ export class SnapshotsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetSnapshotRequest, @@ -687,8 +716,8 @@ export class SnapshotsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetLabelsSnapshotRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -727,12 +756,17 @@ export class SnapshotsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setLabels(request); + * const [operation] = await client.setLabels(request); */ setLabels( request?: protos.google.cloud.compute.v1.ISetLabelsSnapshotRequest, @@ -754,8 +788,8 @@ export class SnapshotsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetLabelsSnapshotRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -775,7 +809,27 @@ export class SnapshotsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setLabels(request, options, callback); + return this.innerApiCalls + .setLabels(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } testIamPermissions( request?: protos.google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest, diff --git a/src/v1/ssl_certificates_client.ts b/src/v1/ssl_certificates_client.ts index bb040297..67d1e382 100644 --- a/src/v1/ssl_certificates_client.ts +++ b/src/v1/ssl_certificates_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class SslCertificatesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -320,8 +324,8 @@ export class SslCertificatesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteSslCertificateRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -364,12 +368,17 @@ export class SslCertificatesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteSslCertificateRequest, @@ -391,8 +400,8 @@ export class SslCertificatesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteSslCertificateRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -412,7 +421,27 @@ export class SslCertificatesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetSslCertificateRequest, @@ -512,8 +541,8 @@ export class SslCertificatesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertSslCertificateRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -556,12 +585,17 @@ export class SslCertificatesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertSslCertificateRequest, @@ -583,8 +617,8 @@ export class SslCertificatesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertSslCertificateRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -604,7 +638,27 @@ export class SslCertificatesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/ssl_policies_client.ts b/src/v1/ssl_policies_client.ts index 6a91bf1d..70ed6c79 100644 --- a/src/v1/ssl_policies_client.ts +++ b/src/v1/ssl_policies_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class SslPoliciesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -316,8 +320,8 @@ export class SslPoliciesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteSslPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -356,12 +360,17 @@ export class SslPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteSslPolicyRequest, @@ -381,8 +390,8 @@ export class SslPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteSslPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -402,7 +411,27 @@ export class SslPoliciesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetSslPolicyRequest, @@ -496,8 +525,8 @@ export class SslPoliciesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertSslPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -536,12 +565,17 @@ export class SslPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertSslPolicyRequest, @@ -561,8 +595,8 @@ export class SslPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertSslPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -582,7 +616,27 @@ export class SslPoliciesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } listAvailableFeatures( request?: protos.google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest, @@ -706,8 +760,8 @@ export class SslPoliciesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchSslPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -748,12 +802,17 @@ export class SslPoliciesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchSslPolicyRequest, @@ -773,8 +832,8 @@ export class SslPoliciesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchSslPolicyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -794,7 +853,27 @@ export class SslPoliciesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/subnetworks_client.ts b/src/v1/subnetworks_client.ts index 69a5a22d..c9c3e396 100644 --- a/src/v1/subnetworks_client.ts +++ b/src/v1/subnetworks_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class SubnetworksClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -332,8 +336,8 @@ export class SubnetworksClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteSubnetworkRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -378,12 +382,17 @@ export class SubnetworksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteSubnetworkRequest, @@ -405,8 +414,8 @@ export class SubnetworksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteSubnetworkRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -426,18 +435,35 @@ export class SubnetworksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } expandIpCidrRange( request?: protos.google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -484,12 +510,17 @@ export class SubnetworksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.expandIpCidrRange(request); + * const [operation] = await client.expandIpCidrRange(request); */ expandIpCidrRange( request?: protos.google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest, @@ -511,11 +542,8 @@ export class SubnetworksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -535,7 +563,27 @@ export class SubnetworksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.expandIpCidrRange(request, options, callback); + return this.innerApiCalls + .expandIpCidrRange(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetSubnetworkRequest, @@ -728,8 +776,8 @@ export class SubnetworksClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertSubnetworkRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -774,12 +822,17 @@ export class SubnetworksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertSubnetworkRequest, @@ -801,8 +854,8 @@ export class SubnetworksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertSubnetworkRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -822,15 +875,35 @@ export class SubnetworksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchSubnetworkRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchSubnetworkRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -875,12 +948,17 @@ export class SubnetworksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchSubnetworkRequest, @@ -900,8 +978,8 @@ export class SubnetworksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchSubnetworkRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -921,7 +999,27 @@ export class SubnetworksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setIamPolicy( request?: protos.google.cloud.compute.v1.ISetIamPolicySubnetworkRequest, @@ -1025,11 +1123,8 @@ export class SubnetworksClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1076,12 +1171,17 @@ export class SubnetworksClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setPrivateIpGoogleAccess(request); + * const [operation] = await client.setPrivateIpGoogleAccess(request); */ setPrivateIpGoogleAccess( request?: protos.google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest, @@ -1103,11 +1203,8 @@ export class SubnetworksClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1127,11 +1224,27 @@ export class SubnetworksClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setPrivateIpGoogleAccess( - request, - options, - callback - ); + return this.innerApiCalls + .setPrivateIpGoogleAccess(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } testIamPermissions( request?: protos.google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest, diff --git a/src/v1/target_grpc_proxies_client.ts b/src/v1/target_grpc_proxies_client.ts index 9002852e..2b2707ea 100644 --- a/src/v1/target_grpc_proxies_client.ts +++ b/src/v1/target_grpc_proxies_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class TargetGrpcProxiesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -315,8 +319,8 @@ export class TargetGrpcProxiesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -359,12 +363,17 @@ export class TargetGrpcProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest, @@ -386,8 +395,8 @@ export class TargetGrpcProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -407,7 +416,27 @@ export class TargetGrpcProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetTargetGrpcProxyRequest, @@ -507,8 +536,8 @@ export class TargetGrpcProxiesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertTargetGrpcProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -551,12 +580,17 @@ export class TargetGrpcProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertTargetGrpcProxyRequest, @@ -578,8 +612,8 @@ export class TargetGrpcProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertTargetGrpcProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -599,15 +633,35 @@ export class TargetGrpcProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchTargetGrpcProxyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchTargetGrpcProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -652,12 +706,17 @@ export class TargetGrpcProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchTargetGrpcProxyRequest, @@ -679,8 +738,8 @@ export class TargetGrpcProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchTargetGrpcProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -700,7 +759,27 @@ export class TargetGrpcProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/target_http_proxies_client.ts b/src/v1/target_http_proxies_client.ts index 96bde05f..2b90e919 100644 --- a/src/v1/target_http_proxies_client.ts +++ b/src/v1/target_http_proxies_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class TargetHttpProxiesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -322,8 +326,8 @@ export class TargetHttpProxiesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteTargetHttpProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -366,12 +370,17 @@ export class TargetHttpProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteTargetHttpProxyRequest, @@ -393,8 +402,8 @@ export class TargetHttpProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteTargetHttpProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -414,7 +423,27 @@ export class TargetHttpProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetTargetHttpProxyRequest, @@ -514,8 +543,8 @@ export class TargetHttpProxiesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertTargetHttpProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -558,12 +587,17 @@ export class TargetHttpProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertTargetHttpProxyRequest, @@ -585,8 +619,8 @@ export class TargetHttpProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertTargetHttpProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -606,15 +640,35 @@ export class TargetHttpProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchTargetHttpProxyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchTargetHttpProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -659,12 +713,17 @@ export class TargetHttpProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchTargetHttpProxyRequest, @@ -686,8 +745,8 @@ export class TargetHttpProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchTargetHttpProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -707,18 +766,35 @@ export class TargetHttpProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setUrlMap( request?: protos.google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -763,12 +839,17 @@ export class TargetHttpProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setUrlMap(request); + * const [operation] = await client.setUrlMap(request); */ setUrlMap( request?: protos.google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest, @@ -790,11 +871,8 @@ export class TargetHttpProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -814,7 +892,27 @@ export class TargetHttpProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setUrlMap(request, options, callback); + return this.innerApiCalls + .setUrlMap(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/target_https_proxies_client.ts b/src/v1/target_https_proxies_client.ts index ec288ca8..d4f9e0da 100644 --- a/src/v1/target_https_proxies_client.ts +++ b/src/v1/target_https_proxies_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class TargetHttpsProxiesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -325,8 +329,8 @@ export class TargetHttpsProxiesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -369,12 +373,17 @@ export class TargetHttpsProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest, @@ -396,8 +405,8 @@ export class TargetHttpsProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -417,7 +426,27 @@ export class TargetHttpsProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetTargetHttpsProxyRequest, @@ -517,8 +546,8 @@ export class TargetHttpsProxiesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertTargetHttpsProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -561,12 +590,17 @@ export class TargetHttpsProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertTargetHttpsProxyRequest, @@ -588,8 +622,8 @@ export class TargetHttpsProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertTargetHttpsProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -609,15 +643,35 @@ export class TargetHttpsProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchTargetHttpsProxyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchTargetHttpsProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -662,12 +716,17 @@ export class TargetHttpsProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchTargetHttpsProxyRequest, @@ -689,8 +748,8 @@ export class TargetHttpsProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchTargetHttpsProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -710,18 +769,35 @@ export class TargetHttpsProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setQuicOverride( request?: protos.google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -766,12 +842,17 @@ export class TargetHttpsProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setQuicOverride(request); + * const [operation] = await client.setQuicOverride(request); */ setQuicOverride( request?: protos.google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest, @@ -793,11 +874,8 @@ export class TargetHttpsProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -817,18 +895,35 @@ export class TargetHttpsProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setQuicOverride(request, options, callback); + return this.innerApiCalls + .setQuicOverride(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setSslCertificates( request?: protos.google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -873,12 +968,17 @@ export class TargetHttpsProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setSslCertificates(request); + * const [operation] = await client.setSslCertificates(request); */ setSslCertificates( request?: protos.google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest, @@ -900,11 +1000,8 @@ export class TargetHttpsProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -924,18 +1021,35 @@ export class TargetHttpsProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setSslCertificates(request, options, callback); + return this.innerApiCalls + .setSslCertificates(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setSslPolicy( request?: protos.google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -980,12 +1094,17 @@ export class TargetHttpsProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setSslPolicy(request); + * const [operation] = await client.setSslPolicy(request); */ setSslPolicy( request?: protos.google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest, @@ -1007,11 +1126,8 @@ export class TargetHttpsProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1031,18 +1147,35 @@ export class TargetHttpsProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setSslPolicy(request, options, callback); + return this.innerApiCalls + .setSslPolicy(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setUrlMap( request?: protos.google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1087,12 +1220,17 @@ export class TargetHttpsProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setUrlMap(request); + * const [operation] = await client.setUrlMap(request); */ setUrlMap( request?: protos.google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest, @@ -1114,11 +1252,8 @@ export class TargetHttpsProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1138,7 +1273,27 @@ export class TargetHttpsProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setUrlMap(request, options, callback); + return this.innerApiCalls + .setUrlMap(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/target_instances_client.ts b/src/v1/target_instances_client.ts index 2faf0da2..9aa193a7 100644 --- a/src/v1/target_instances_client.ts +++ b/src/v1/target_instances_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class TargetInstancesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -320,8 +324,8 @@ export class TargetInstancesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteTargetInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -366,12 +370,17 @@ export class TargetInstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteTargetInstanceRequest, @@ -393,8 +402,8 @@ export class TargetInstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteTargetInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -414,7 +423,27 @@ export class TargetInstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetTargetInstanceRequest, @@ -516,8 +545,8 @@ export class TargetInstancesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertTargetInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -562,12 +591,17 @@ export class TargetInstancesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertTargetInstanceRequest, @@ -589,8 +623,8 @@ export class TargetInstancesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertTargetInstanceRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -610,7 +644,27 @@ export class TargetInstancesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/target_pools_client.ts b/src/v1/target_pools_client.ts index 6b206330..b3500979 100644 --- a/src/v1/target_pools_client.ts +++ b/src/v1/target_pools_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class TargetPoolsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -326,11 +330,8 @@ export class TargetPoolsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -377,12 +378,17 @@ export class TargetPoolsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.addHealthCheck(request); + * const [operation] = await client.addHealthCheck(request); */ addHealthCheck( request?: protos.google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest, @@ -404,11 +410,8 @@ export class TargetPoolsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -428,15 +431,35 @@ export class TargetPoolsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.addHealthCheck(request, options, callback); + return this.innerApiCalls + .addHealthCheck(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } addInstance( request?: protos.google.cloud.compute.v1.IAddInstanceTargetPoolRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IAddInstanceTargetPoolRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -483,12 +506,17 @@ export class TargetPoolsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.addInstance(request); + * const [operation] = await client.addInstance(request); */ addInstance( request?: protos.google.cloud.compute.v1.IAddInstanceTargetPoolRequest, @@ -510,8 +538,8 @@ export class TargetPoolsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IAddInstanceTargetPoolRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -531,15 +559,35 @@ export class TargetPoolsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.addInstance(request, options, callback); + return this.innerApiCalls + .addInstance(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } delete( request?: protos.google.cloud.compute.v1.IDeleteTargetPoolRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteTargetPoolRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -584,12 +632,17 @@ export class TargetPoolsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteTargetPoolRequest, @@ -611,8 +664,8 @@ export class TargetPoolsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteTargetPoolRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -632,7 +685,27 @@ export class TargetPoolsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetTargetPoolRequest, @@ -825,8 +898,8 @@ export class TargetPoolsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertTargetPoolRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -871,12 +944,17 @@ export class TargetPoolsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertTargetPoolRequest, @@ -898,8 +976,8 @@ export class TargetPoolsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertTargetPoolRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -919,18 +997,35 @@ export class TargetPoolsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } removeHealthCheck( request?: protos.google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -977,12 +1072,17 @@ export class TargetPoolsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.removeHealthCheck(request); + * const [operation] = await client.removeHealthCheck(request); */ removeHealthCheck( request?: protos.google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest, @@ -1004,11 +1104,8 @@ export class TargetPoolsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1028,18 +1125,35 @@ export class TargetPoolsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.removeHealthCheck(request, options, callback); + return this.innerApiCalls + .removeHealthCheck(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } removeInstance( request?: protos.google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1086,12 +1200,17 @@ export class TargetPoolsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.removeInstance(request); + * const [operation] = await client.removeInstance(request); */ removeInstance( request?: protos.google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest, @@ -1113,11 +1232,8 @@ export class TargetPoolsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1137,15 +1253,35 @@ export class TargetPoolsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.removeInstance(request, options, callback); + return this.innerApiCalls + .removeInstance(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setBackup( request?: protos.google.cloud.compute.v1.ISetBackupTargetPoolRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetBackupTargetPoolRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -1194,12 +1330,17 @@ export class TargetPoolsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setBackup(request); + * const [operation] = await client.setBackup(request); */ setBackup( request?: protos.google.cloud.compute.v1.ISetBackupTargetPoolRequest, @@ -1221,8 +1362,8 @@ export class TargetPoolsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetBackupTargetPoolRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1242,7 +1383,27 @@ export class TargetPoolsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setBackup(request, options, callback); + return this.innerApiCalls + .setBackup(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/target_ssl_proxies_client.ts b/src/v1/target_ssl_proxies_client.ts index d0871538..0e4353ac 100644 --- a/src/v1/target_ssl_proxies_client.ts +++ b/src/v1/target_ssl_proxies_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class TargetSslProxiesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -318,8 +322,8 @@ export class TargetSslProxiesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteTargetSslProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -362,12 +366,17 @@ export class TargetSslProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteTargetSslProxyRequest, @@ -389,8 +398,8 @@ export class TargetSslProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteTargetSslProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -410,7 +419,27 @@ export class TargetSslProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetTargetSslProxyRequest, @@ -510,8 +539,8 @@ export class TargetSslProxiesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertTargetSslProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -554,12 +583,17 @@ export class TargetSslProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertTargetSslProxyRequest, @@ -581,8 +615,8 @@ export class TargetSslProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertTargetSslProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -602,18 +636,35 @@ export class TargetSslProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setBackendService( request?: protos.google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -658,12 +709,17 @@ export class TargetSslProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setBackendService(request); + * const [operation] = await client.setBackendService(request); */ setBackendService( request?: protos.google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest, @@ -685,11 +741,8 @@ export class TargetSslProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -709,18 +762,35 @@ export class TargetSslProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setBackendService(request, options, callback); + return this.innerApiCalls + .setBackendService(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setProxyHeader( request?: protos.google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -765,12 +835,17 @@ export class TargetSslProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setProxyHeader(request); + * const [operation] = await client.setProxyHeader(request); */ setProxyHeader( request?: protos.google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest, @@ -792,11 +867,8 @@ export class TargetSslProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -816,18 +888,35 @@ export class TargetSslProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setProxyHeader(request, options, callback); + return this.innerApiCalls + .setProxyHeader(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setSslCertificates( request?: protos.google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -872,12 +961,17 @@ export class TargetSslProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setSslCertificates(request); + * const [operation] = await client.setSslCertificates(request); */ setSslCertificates( request?: protos.google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest, @@ -899,11 +993,8 @@ export class TargetSslProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -923,18 +1014,35 @@ export class TargetSslProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setSslCertificates(request, options, callback); + return this.innerApiCalls + .setSslCertificates(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setSslPolicy( request?: protos.google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -979,12 +1087,17 @@ export class TargetSslProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setSslPolicy(request); + * const [operation] = await client.setSslPolicy(request); */ setSslPolicy( request?: protos.google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest, @@ -1006,11 +1119,8 @@ export class TargetSslProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -1030,7 +1140,27 @@ export class TargetSslProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setSslPolicy(request, options, callback); + return this.innerApiCalls + .setSslPolicy(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/target_tcp_proxies_client.ts b/src/v1/target_tcp_proxies_client.ts index d64db7a4..90ff9cd1 100644 --- a/src/v1/target_tcp_proxies_client.ts +++ b/src/v1/target_tcp_proxies_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class TargetTcpProxiesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -316,8 +320,8 @@ export class TargetTcpProxiesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteTargetTcpProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -360,12 +364,17 @@ export class TargetTcpProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteTargetTcpProxyRequest, @@ -387,8 +396,8 @@ export class TargetTcpProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteTargetTcpProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -408,7 +417,27 @@ export class TargetTcpProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetTargetTcpProxyRequest, @@ -508,8 +537,8 @@ export class TargetTcpProxiesClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertTargetTcpProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -552,12 +581,17 @@ export class TargetTcpProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertTargetTcpProxyRequest, @@ -579,8 +613,8 @@ export class TargetTcpProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertTargetTcpProxyRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -600,18 +634,35 @@ export class TargetTcpProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setBackendService( request?: protos.google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -656,12 +707,17 @@ export class TargetTcpProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setBackendService(request); + * const [operation] = await client.setBackendService(request); */ setBackendService( request?: protos.google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest, @@ -683,11 +739,8 @@ export class TargetTcpProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -707,18 +760,35 @@ export class TargetTcpProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setBackendService(request, options, callback); + return this.innerApiCalls + .setBackendService(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setProxyHeader( request?: protos.google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -763,12 +833,17 @@ export class TargetTcpProxiesClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setProxyHeader(request); + * const [operation] = await client.setProxyHeader(request); */ setProxyHeader( request?: protos.google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest, @@ -790,11 +865,8 @@ export class TargetTcpProxiesClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - ( - | protos.google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest - | undefined - ), + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -814,7 +886,27 @@ export class TargetTcpProxiesClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setProxyHeader(request, options, callback); + return this.innerApiCalls + .setProxyHeader(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } list( diff --git a/src/v1/target_vpn_gateways_client.ts b/src/v1/target_vpn_gateways_client.ts index 503ad620..8983657d 100644 --- a/src/v1/target_vpn_gateways_client.ts +++ b/src/v1/target_vpn_gateways_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class TargetVpnGatewaysClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -320,8 +324,8 @@ export class TargetVpnGatewaysClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -366,12 +370,17 @@ export class TargetVpnGatewaysClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest, @@ -393,8 +402,8 @@ export class TargetVpnGatewaysClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -414,7 +423,27 @@ export class TargetVpnGatewaysClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetTargetVpnGatewayRequest, @@ -516,8 +545,8 @@ export class TargetVpnGatewaysClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertTargetVpnGatewayRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -562,12 +591,17 @@ export class TargetVpnGatewaysClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertTargetVpnGatewayRequest, @@ -589,8 +623,8 @@ export class TargetVpnGatewaysClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertTargetVpnGatewayRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -610,7 +644,27 @@ export class TargetVpnGatewaysClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/url_maps_client.ts b/src/v1/url_maps_client.ts index c845c859..0661f333 100644 --- a/src/v1/url_maps_client.ts +++ b/src/v1/url_maps_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class UrlMapsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -324,8 +328,8 @@ export class UrlMapsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteUrlMapRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -364,12 +368,17 @@ export class UrlMapsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteUrlMapRequest, @@ -389,8 +398,8 @@ export class UrlMapsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteUrlMapRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -410,7 +419,27 @@ export class UrlMapsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetUrlMapRequest, @@ -502,8 +531,8 @@ export class UrlMapsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertUrlMapRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -542,12 +571,17 @@ export class UrlMapsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertUrlMapRequest, @@ -567,8 +601,8 @@ export class UrlMapsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertUrlMapRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -588,15 +622,35 @@ export class UrlMapsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } invalidateCache( request?: protos.google.cloud.compute.v1.IInvalidateCacheUrlMapRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInvalidateCacheUrlMapRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -624,7 +678,7 @@ export class UrlMapsClient { /** * Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. * - * For more information, see [Invalidating cached content](https://cloud.google.com/cdn/docs/invalidating-cached-content). + * For more information, see [Invalidating cached content](/cdn/docs/invalidating-cached-content). * * @param {Object} request * The request object that will be sent. @@ -643,12 +697,17 @@ export class UrlMapsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.invalidateCache(request); + * const [operation] = await client.invalidateCache(request); */ invalidateCache( request?: protos.google.cloud.compute.v1.IInvalidateCacheUrlMapRequest, @@ -670,8 +729,8 @@ export class UrlMapsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInvalidateCacheUrlMapRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -691,15 +750,35 @@ export class UrlMapsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.invalidateCache(request, options, callback); + return this.innerApiCalls + .invalidateCache(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } patch( request?: protos.google.cloud.compute.v1.IPatchUrlMapRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchUrlMapRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -740,12 +819,17 @@ export class UrlMapsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.patch(request); + * const [operation] = await client.patch(request); */ patch( request?: protos.google.cloud.compute.v1.IPatchUrlMapRequest, @@ -763,8 +847,8 @@ export class UrlMapsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IPatchUrlMapRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -784,15 +868,35 @@ export class UrlMapsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.patch(request, options, callback); + return this.innerApiCalls + .patch(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } update( request?: protos.google.cloud.compute.v1.IUpdateUrlMapRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateUrlMapRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -833,12 +937,17 @@ export class UrlMapsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.update(request); + * const [operation] = await client.update(request); */ update( request?: protos.google.cloud.compute.v1.IUpdateUrlMapRequest, @@ -858,8 +967,8 @@ export class UrlMapsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IUpdateUrlMapRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -879,7 +988,27 @@ export class UrlMapsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.update(request, options, callback); + return this.innerApiCalls + .update(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } validate( request?: protos.google.cloud.compute.v1.IValidateUrlMapRequest, diff --git a/src/v1/vpn_gateways_client.ts b/src/v1/vpn_gateways_client.ts index e02a9914..111c7c9e 100644 --- a/src/v1/vpn_gateways_client.ts +++ b/src/v1/vpn_gateways_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class VpnGatewaysClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -323,8 +327,8 @@ export class VpnGatewaysClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteVpnGatewayRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -369,12 +373,17 @@ export class VpnGatewaysClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteVpnGatewayRequest, @@ -396,8 +405,8 @@ export class VpnGatewaysClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteVpnGatewayRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -417,7 +426,27 @@ export class VpnGatewaysClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetVpnGatewayRequest, @@ -608,8 +637,8 @@ export class VpnGatewaysClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertVpnGatewayRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -654,12 +683,17 @@ export class VpnGatewaysClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertVpnGatewayRequest, @@ -681,8 +715,8 @@ export class VpnGatewaysClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertVpnGatewayRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -702,15 +736,35 @@ export class VpnGatewaysClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } setLabels( request?: protos.google.cloud.compute.v1.ISetLabelsVpnGatewayRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetLabelsVpnGatewayRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -757,12 +811,17 @@ export class VpnGatewaysClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.setLabels(request); + * const [operation] = await client.setLabels(request); */ setLabels( request?: protos.google.cloud.compute.v1.ISetLabelsVpnGatewayRequest, @@ -784,8 +843,8 @@ export class VpnGatewaysClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.ISetLabelsVpnGatewayRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -805,7 +864,27 @@ export class VpnGatewaysClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.setLabels(request, options, callback); + return this.innerApiCalls + .setLabels(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } testIamPermissions( request?: protos.google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest, diff --git a/src/v1/vpn_tunnels_client.ts b/src/v1/vpn_tunnels_client.ts index 4dc8732e..31bdbf86 100644 --- a/src/v1/vpn_tunnels_client.ts +++ b/src/v1/vpn_tunnels_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -136,6 +137,9 @@ export class VpnTunnelsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -320,8 +324,8 @@ export class VpnTunnelsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteVpnTunnelRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -362,12 +366,17 @@ export class VpnTunnelsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.delete(request); + * const [operation] = await client.delete(request); */ delete( request?: protos.google.cloud.compute.v1.IDeleteVpnTunnelRequest, @@ -387,8 +396,8 @@ export class VpnTunnelsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IDeleteVpnTunnelRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -408,7 +417,27 @@ export class VpnTunnelsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.delete(request, options, callback); + return this.innerApiCalls + .delete(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } get( request?: protos.google.cloud.compute.v1.IGetVpnTunnelRequest, @@ -504,8 +533,8 @@ export class VpnTunnelsClient { options?: CallOptions ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertVpnTunnelRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] >; @@ -546,12 +575,17 @@ export class VpnTunnelsClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * The first element of the array is an object representing + * a long running operation. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * This method is considered to be in beta. This means while + * stable it is still a work-in-progress and under active development, + * and might get backwards-incompatible changes at any time. + * `.promise()` is not supported yet. * @example - * const [response] = await client.insert(request); + * const [operation] = await client.insert(request); */ insert( request?: protos.google.cloud.compute.v1.IInsertVpnTunnelRequest, @@ -571,8 +605,8 @@ export class VpnTunnelsClient { > ): Promise< [ - protos.google.cloud.compute.v1.IOperation, - protos.google.cloud.compute.v1.IInsertVpnTunnelRequest | undefined, + LROperation, + protos.google.cloud.compute.v1.IOperation | undefined, {} | undefined ] > | void { @@ -592,7 +626,27 @@ export class VpnTunnelsClient { project: request.project || '', }); this.initialize(); - return this.innerApiCalls.insert(request, options, callback); + return this.innerApiCalls + .insert(request, options, callback) + .then( + ([response, operation, rawResponse]: [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IOperation + ]) => { + return [ + { + latestResponse: response, + done: false, + name: response.id, + metadata: null, + result: {}, + }, + operation, + rawResponse, + ]; + } + ); } /** diff --git a/src/v1/zone_operations_client.ts b/src/v1/zone_operations_client.ts index 8c06baae..3e808b2f 100644 --- a/src/v1/zone_operations_client.ts +++ b/src/v1/zone_operations_client.ts @@ -136,6 +136,9 @@ export class ZoneOperationsClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; diff --git a/src/v1/zones_client.ts b/src/v1/zones_client.ts index 47fa5a41..e8c09416 100644 --- a/src/v1/zones_client.ts +++ b/src/v1/zones_client.ts @@ -136,6 +136,9 @@ export class ZonesClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; diff --git a/system-test/compute.js b/system-test/compute.js index 9ea26768..05c18f8b 100644 --- a/system-test/compute.js +++ b/system-test/compute.js @@ -318,7 +318,7 @@ describe('Compute', () => { await waitGlobalOperation(insertOp); const instanceGroupManager = { baseInstanceName: 'tsgapic', - instanceTemplate: insertOp.targetLink, + instanceTemplate: insertOp.latestResponse.targetLink, name: instanceGroupName, targetSize: 0, }; diff --git a/test/gapic_addresses_v1.ts b/test/gapic_addresses_v1.ts index ef1e6ac0..e36bba0a 100644 --- a/test/gapic_addresses_v1.ts +++ b/test/gapic_addresses_v1.ts @@ -230,7 +230,7 @@ describe('v1.AddressesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -445,7 +445,7 @@ describe('v1.AddressesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) diff --git a/test/gapic_autoscalers_v1.ts b/test/gapic_autoscalers_v1.ts index 3d665507..f1a9e361 100644 --- a/test/gapic_autoscalers_v1.ts +++ b/test/gapic_autoscalers_v1.ts @@ -230,7 +230,7 @@ describe('v1.AutoscalersClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -445,7 +445,7 @@ describe('v1.AutoscalersClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -553,7 +553,7 @@ describe('v1.AutoscalersClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -660,7 +660,7 @@ describe('v1.AutoscalersClient', () => { ); client.innerApiCalls.update = stubSimpleCall(expectedResponse); const [response] = await client.update(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.update as SinonStub) .getCall(0) diff --git a/test/gapic_backend_buckets_v1.ts b/test/gapic_backend_buckets_v1.ts index d4fa8984..ade35e4b 100644 --- a/test/gapic_backend_buckets_v1.ts +++ b/test/gapic_backend_buckets_v1.ts @@ -232,7 +232,7 @@ describe('v1.BackendBucketsClient', () => { ); client.innerApiCalls.addSignedUrlKey = stubSimpleCall(expectedResponse); const [response] = await client.addSignedUrlKey(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.addSignedUrlKey as SinonStub) .getCall(0) @@ -343,7 +343,7 @@ describe('v1.BackendBucketsClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -452,7 +452,7 @@ describe('v1.BackendBucketsClient', () => { client.innerApiCalls.deleteSignedUrlKey = stubSimpleCall(expectedResponse); const [response] = await client.deleteSignedUrlKey(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.deleteSignedUrlKey as SinonStub) .getCall(0) @@ -670,7 +670,7 @@ describe('v1.BackendBucketsClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -778,7 +778,7 @@ describe('v1.BackendBucketsClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -885,7 +885,7 @@ describe('v1.BackendBucketsClient', () => { ); client.innerApiCalls.update = stubSimpleCall(expectedResponse); const [response] = await client.update(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.update as SinonStub) .getCall(0) diff --git a/test/gapic_backend_services_v1.ts b/test/gapic_backend_services_v1.ts index 7cb741f4..06c97014 100644 --- a/test/gapic_backend_services_v1.ts +++ b/test/gapic_backend_services_v1.ts @@ -232,7 +232,7 @@ describe('v1.BackendServicesClient', () => { ); client.innerApiCalls.addSignedUrlKey = stubSimpleCall(expectedResponse); const [response] = await client.addSignedUrlKey(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.addSignedUrlKey as SinonStub) .getCall(0) @@ -343,7 +343,7 @@ describe('v1.BackendServicesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -452,7 +452,7 @@ describe('v1.BackendServicesClient', () => { client.innerApiCalls.deleteSignedUrlKey = stubSimpleCall(expectedResponse); const [response] = await client.deleteSignedUrlKey(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.deleteSignedUrlKey as SinonStub) .getCall(0) @@ -778,7 +778,7 @@ describe('v1.BackendServicesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -886,7 +886,7 @@ describe('v1.BackendServicesClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -993,7 +993,7 @@ describe('v1.BackendServicesClient', () => { ); client.innerApiCalls.setSecurityPolicy = stubSimpleCall(expectedResponse); const [response] = await client.setSecurityPolicy(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setSecurityPolicy as SinonStub) .getCall(0) @@ -1104,7 +1104,7 @@ describe('v1.BackendServicesClient', () => { ); client.innerApiCalls.update = stubSimpleCall(expectedResponse); const [response] = await client.update(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.update as SinonStub) .getCall(0) diff --git a/test/gapic_disks_v1.ts b/test/gapic_disks_v1.ts index d3dcc41e..d559b536 100644 --- a/test/gapic_disks_v1.ts +++ b/test/gapic_disks_v1.ts @@ -231,7 +231,7 @@ describe('v1.DisksClient', () => { client.innerApiCalls.addResourcePolicies = stubSimpleCall(expectedResponse); const [response] = await client.addResourcePolicies(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.addResourcePolicies as SinonStub) .getCall(0) @@ -342,7 +342,7 @@ describe('v1.DisksClient', () => { ); client.innerApiCalls.createSnapshot = stubSimpleCall(expectedResponse); const [response] = await client.createSnapshot(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.createSnapshot as SinonStub) .getCall(0) @@ -453,7 +453,7 @@ describe('v1.DisksClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -779,7 +779,7 @@ describe('v1.DisksClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -888,7 +888,7 @@ describe('v1.DisksClient', () => { client.innerApiCalls.removeResourcePolicies = stubSimpleCall(expectedResponse); const [response] = await client.removeResourcePolicies(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.removeResourcePolicies as SinonStub) .getCall(0) @@ -1002,7 +1002,7 @@ describe('v1.DisksClient', () => { ); client.innerApiCalls.resize = stubSimpleCall(expectedResponse); const [response] = await client.resize(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.resize as SinonStub) .getCall(0) @@ -1221,7 +1221,7 @@ describe('v1.DisksClient', () => { ); client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); const [response] = await client.setLabels(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setLabels as SinonStub) .getCall(0) diff --git a/test/gapic_external_vpn_gateways_v1.ts b/test/gapic_external_vpn_gateways_v1.ts index dc2260c0..1e41c8eb 100644 --- a/test/gapic_external_vpn_gateways_v1.ts +++ b/test/gapic_external_vpn_gateways_v1.ts @@ -234,7 +234,7 @@ describe('v1.ExternalVpnGatewaysClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -461,7 +461,7 @@ describe('v1.ExternalVpnGatewaysClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -575,7 +575,7 @@ describe('v1.ExternalVpnGatewaysClient', () => { ); client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); const [response] = await client.setLabels(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setLabels as SinonStub) .getCall(0) diff --git a/test/gapic_firewall_policies_v1.ts b/test/gapic_firewall_policies_v1.ts index ecb9dd45..f113ba3c 100644 --- a/test/gapic_firewall_policies_v1.ts +++ b/test/gapic_firewall_policies_v1.ts @@ -232,7 +232,7 @@ describe('v1.FirewallPoliciesClient', () => { ); client.innerApiCalls.addAssociation = stubSimpleCall(expectedResponse); const [response] = await client.addAssociation(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.addAssociation as SinonStub) .getCall(0) @@ -343,7 +343,7 @@ describe('v1.FirewallPoliciesClient', () => { ); client.innerApiCalls.addRule = stubSimpleCall(expectedResponse); const [response] = await client.addRule(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.addRule as SinonStub) .getCall(0) @@ -451,7 +451,7 @@ describe('v1.FirewallPoliciesClient', () => { ); client.innerApiCalls.cloneRules = stubSimpleCall(expectedResponse); const [response] = await client.cloneRules(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.cloneRules as SinonStub) .getCall(0) @@ -562,7 +562,7 @@ describe('v1.FirewallPoliciesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -1099,7 +1099,7 @@ describe('v1.FirewallPoliciesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -1278,7 +1278,7 @@ describe('v1.FirewallPoliciesClient', () => { ); client.innerApiCalls.move = stubSimpleCall(expectedResponse); const [response] = await client.move(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.move as SinonStub) .getCall(0) @@ -1385,7 +1385,7 @@ describe('v1.FirewallPoliciesClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -1492,7 +1492,7 @@ describe('v1.FirewallPoliciesClient', () => { ); client.innerApiCalls.patchRule = stubSimpleCall(expectedResponse); const [response] = await client.patchRule(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patchRule as SinonStub) .getCall(0) @@ -1600,7 +1600,7 @@ describe('v1.FirewallPoliciesClient', () => { ); client.innerApiCalls.removeAssociation = stubSimpleCall(expectedResponse); const [response] = await client.removeAssociation(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.removeAssociation as SinonStub) .getCall(0) @@ -1711,7 +1711,7 @@ describe('v1.FirewallPoliciesClient', () => { ); client.innerApiCalls.removeRule = stubSimpleCall(expectedResponse); const [response] = await client.removeRule(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.removeRule as SinonStub) .getCall(0) diff --git a/test/gapic_firewalls_v1.ts b/test/gapic_firewalls_v1.ts index 3caab92d..08fd9ed4 100644 --- a/test/gapic_firewalls_v1.ts +++ b/test/gapic_firewalls_v1.ts @@ -230,7 +230,7 @@ describe('v1.FirewallsClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -445,7 +445,7 @@ describe('v1.FirewallsClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -553,7 +553,7 @@ describe('v1.FirewallsClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -660,7 +660,7 @@ describe('v1.FirewallsClient', () => { ); client.innerApiCalls.update = stubSimpleCall(expectedResponse); const [response] = await client.update(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.update as SinonStub) .getCall(0) diff --git a/test/gapic_forwarding_rules_v1.ts b/test/gapic_forwarding_rules_v1.ts index 51c266e0..1c50eefa 100644 --- a/test/gapic_forwarding_rules_v1.ts +++ b/test/gapic_forwarding_rules_v1.ts @@ -232,7 +232,7 @@ describe('v1.ForwardingRulesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -447,7 +447,7 @@ describe('v1.ForwardingRulesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -555,7 +555,7 @@ describe('v1.ForwardingRulesClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -662,7 +662,7 @@ describe('v1.ForwardingRulesClient', () => { ); client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); const [response] = await client.setLabels(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setLabels as SinonStub) .getCall(0) @@ -770,7 +770,7 @@ describe('v1.ForwardingRulesClient', () => { ); client.innerApiCalls.setTarget = stubSimpleCall(expectedResponse); const [response] = await client.setTarget(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setTarget as SinonStub) .getCall(0) diff --git a/test/gapic_global_addresses_v1.ts b/test/gapic_global_addresses_v1.ts index 3a787916..a5509854 100644 --- a/test/gapic_global_addresses_v1.ts +++ b/test/gapic_global_addresses_v1.ts @@ -232,7 +232,7 @@ describe('v1.GlobalAddressesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -447,7 +447,7 @@ describe('v1.GlobalAddressesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) diff --git a/test/gapic_global_forwarding_rules_v1.ts b/test/gapic_global_forwarding_rules_v1.ts index 919262ec..84d937d4 100644 --- a/test/gapic_global_forwarding_rules_v1.ts +++ b/test/gapic_global_forwarding_rules_v1.ts @@ -240,7 +240,7 @@ describe('v1.GlobalForwardingRulesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -461,7 +461,7 @@ describe('v1.GlobalForwardingRulesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -572,7 +572,7 @@ describe('v1.GlobalForwardingRulesClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -682,7 +682,7 @@ describe('v1.GlobalForwardingRulesClient', () => { ); client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); const [response] = await client.setLabels(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setLabels as SinonStub) .getCall(0) @@ -793,7 +793,7 @@ describe('v1.GlobalForwardingRulesClient', () => { ); client.innerApiCalls.setTarget = stubSimpleCall(expectedResponse); const [response] = await client.setTarget(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setTarget as SinonStub) .getCall(0) diff --git a/test/gapic_global_network_endpoint_groups_v1.ts b/test/gapic_global_network_endpoint_groups_v1.ts index 8dfdac98..b3333c1b 100644 --- a/test/gapic_global_network_endpoint_groups_v1.ts +++ b/test/gapic_global_network_endpoint_groups_v1.ts @@ -256,7 +256,7 @@ describe('v1.GlobalNetworkEndpointGroupsClient', () => { client.innerApiCalls.attachNetworkEndpoints = stubSimpleCall(expectedResponse); const [response] = await client.attachNetworkEndpoints(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.attachNetworkEndpoints as SinonStub) .getCall(0) @@ -379,7 +379,7 @@ describe('v1.GlobalNetworkEndpointGroupsClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -497,7 +497,7 @@ describe('v1.GlobalNetworkEndpointGroupsClient', () => { client.innerApiCalls.detachNetworkEndpoints = stubSimpleCall(expectedResponse); const [response] = await client.detachNetworkEndpoints(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.detachNetworkEndpoints as SinonStub) .getCall(0) @@ -736,7 +736,7 @@ describe('v1.GlobalNetworkEndpointGroupsClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) diff --git a/test/gapic_global_public_delegated_prefixes_v1.ts b/test/gapic_global_public_delegated_prefixes_v1.ts index 074b2d90..2cdef4f1 100644 --- a/test/gapic_global_public_delegated_prefixes_v1.ts +++ b/test/gapic_global_public_delegated_prefixes_v1.ts @@ -255,7 +255,7 @@ describe('v1.GlobalPublicDelegatedPrefixesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -488,7 +488,7 @@ describe('v1.GlobalPublicDelegatedPrefixesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -605,7 +605,7 @@ describe('v1.GlobalPublicDelegatedPrefixesClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) diff --git a/test/gapic_health_checks_v1.ts b/test/gapic_health_checks_v1.ts index 945ed2e9..f26959fa 100644 --- a/test/gapic_health_checks_v1.ts +++ b/test/gapic_health_checks_v1.ts @@ -230,7 +230,7 @@ describe('v1.HealthChecksClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -445,7 +445,7 @@ describe('v1.HealthChecksClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -553,7 +553,7 @@ describe('v1.HealthChecksClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -660,7 +660,7 @@ describe('v1.HealthChecksClient', () => { ); client.innerApiCalls.update = stubSimpleCall(expectedResponse); const [response] = await client.update(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.update as SinonStub) .getCall(0) diff --git a/test/gapic_images_v1.ts b/test/gapic_images_v1.ts index d756da83..ce2e798a 100644 --- a/test/gapic_images_v1.ts +++ b/test/gapic_images_v1.ts @@ -230,7 +230,7 @@ describe('v1.ImagesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -338,7 +338,7 @@ describe('v1.ImagesClient', () => { ); client.innerApiCalls.deprecate = stubSimpleCall(expectedResponse); const [response] = await client.deprecate(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.deprecate as SinonStub) .getCall(0) @@ -775,7 +775,7 @@ describe('v1.ImagesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -883,7 +883,7 @@ describe('v1.ImagesClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -1101,7 +1101,7 @@ describe('v1.ImagesClient', () => { ); client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); const [response] = await client.setLabels(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setLabels as SinonStub) .getCall(0) diff --git a/test/gapic_instance_group_managers_v1.ts b/test/gapic_instance_group_managers_v1.ts index 271d4ad1..661b27d6 100644 --- a/test/gapic_instance_group_managers_v1.ts +++ b/test/gapic_instance_group_managers_v1.ts @@ -240,7 +240,7 @@ describe('v1.InstanceGroupManagersClient', () => { ); client.innerApiCalls.abandonInstances = stubSimpleCall(expectedResponse); const [response] = await client.abandonInstances(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.abandonInstances as SinonStub) .getCall(0) @@ -355,7 +355,7 @@ describe('v1.InstanceGroupManagersClient', () => { client.innerApiCalls.applyUpdatesToInstances = stubSimpleCall(expectedResponse); const [response] = await client.applyUpdatesToInstances(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.applyUpdatesToInstances as SinonStub) .getCall(0) @@ -472,7 +472,7 @@ describe('v1.InstanceGroupManagersClient', () => { ); client.innerApiCalls.createInstances = stubSimpleCall(expectedResponse); const [response] = await client.createInstances(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.createInstances as SinonStub) .getCall(0) @@ -586,7 +586,7 @@ describe('v1.InstanceGroupManagersClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -697,7 +697,7 @@ describe('v1.InstanceGroupManagersClient', () => { ); client.innerApiCalls.deleteInstances = stubSimpleCall(expectedResponse); const [response] = await client.deleteInstances(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.deleteInstances as SinonStub) .getCall(0) @@ -812,7 +812,7 @@ describe('v1.InstanceGroupManagersClient', () => { client.innerApiCalls.deletePerInstanceConfigs = stubSimpleCall(expectedResponse); const [response] = await client.deletePerInstanceConfigs(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.deletePerInstanceConfigs as SinonStub) .getCall(0) @@ -1039,7 +1039,7 @@ describe('v1.InstanceGroupManagersClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -1150,7 +1150,7 @@ describe('v1.InstanceGroupManagersClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -1261,7 +1261,7 @@ describe('v1.InstanceGroupManagersClient', () => { client.innerApiCalls.patchPerInstanceConfigs = stubSimpleCall(expectedResponse); const [response] = await client.patchPerInstanceConfigs(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patchPerInstanceConfigs as SinonStub) .getCall(0) @@ -1378,7 +1378,7 @@ describe('v1.InstanceGroupManagersClient', () => { ); client.innerApiCalls.recreateInstances = stubSimpleCall(expectedResponse); const [response] = await client.recreateInstances(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.recreateInstances as SinonStub) .getCall(0) @@ -1492,7 +1492,7 @@ describe('v1.InstanceGroupManagersClient', () => { ); client.innerApiCalls.resize = stubSimpleCall(expectedResponse); const [response] = await client.resize(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.resize as SinonStub) .getCall(0) @@ -1604,7 +1604,7 @@ describe('v1.InstanceGroupManagersClient', () => { client.innerApiCalls.setInstanceTemplate = stubSimpleCall(expectedResponse); const [response] = await client.setInstanceTemplate(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setInstanceTemplate as SinonStub) .getCall(0) @@ -1718,7 +1718,7 @@ describe('v1.InstanceGroupManagersClient', () => { ); client.innerApiCalls.setTargetPools = stubSimpleCall(expectedResponse); const [response] = await client.setTargetPools(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setTargetPools as SinonStub) .getCall(0) @@ -1833,7 +1833,7 @@ describe('v1.InstanceGroupManagersClient', () => { client.innerApiCalls.updatePerInstanceConfigs = stubSimpleCall(expectedResponse); const [response] = await client.updatePerInstanceConfigs(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.updatePerInstanceConfigs as SinonStub) .getCall(0) diff --git a/test/gapic_instance_groups_v1.ts b/test/gapic_instance_groups_v1.ts index 2d43f8ac..adebea77 100644 --- a/test/gapic_instance_groups_v1.ts +++ b/test/gapic_instance_groups_v1.ts @@ -232,7 +232,7 @@ describe('v1.InstanceGroupsClient', () => { ); client.innerApiCalls.addInstances = stubSimpleCall(expectedResponse); const [response] = await client.addInstances(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.addInstances as SinonStub) .getCall(0) @@ -343,7 +343,7 @@ describe('v1.InstanceGroupsClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -558,7 +558,7 @@ describe('v1.InstanceGroupsClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -666,7 +666,7 @@ describe('v1.InstanceGroupsClient', () => { ); client.innerApiCalls.removeInstances = stubSimpleCall(expectedResponse); const [response] = await client.removeInstances(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.removeInstances as SinonStub) .getCall(0) @@ -777,7 +777,7 @@ describe('v1.InstanceGroupsClient', () => { ); client.innerApiCalls.setNamedPorts = stubSimpleCall(expectedResponse); const [response] = await client.setNamedPorts(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setNamedPorts as SinonStub) .getCall(0) diff --git a/test/gapic_instance_templates_v1.ts b/test/gapic_instance_templates_v1.ts index 3bbd368b..6536fbb8 100644 --- a/test/gapic_instance_templates_v1.ts +++ b/test/gapic_instance_templates_v1.ts @@ -232,7 +232,7 @@ describe('v1.InstanceTemplatesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -558,7 +558,7 @@ describe('v1.InstanceTemplatesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) diff --git a/test/gapic_instances_v1.ts b/test/gapic_instances_v1.ts index 59617e38..0ab1f2c4 100644 --- a/test/gapic_instances_v1.ts +++ b/test/gapic_instances_v1.ts @@ -230,7 +230,7 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.addAccessConfig = stubSimpleCall(expectedResponse); const [response] = await client.addAccessConfig(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.addAccessConfig as SinonStub) .getCall(0) @@ -342,7 +342,7 @@ describe('v1.InstancesClient', () => { client.innerApiCalls.addResourcePolicies = stubSimpleCall(expectedResponse); const [response] = await client.addResourcePolicies(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.addResourcePolicies as SinonStub) .getCall(0) @@ -453,7 +453,7 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.attachDisk = stubSimpleCall(expectedResponse); const [response] = await client.attachDisk(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.attachDisk as SinonStub) .getCall(0) @@ -564,7 +564,7 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.bulkInsert = stubSimpleCall(expectedResponse); const [response] = await client.bulkInsert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.bulkInsert as SinonStub) .getCall(0) @@ -675,7 +675,7 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -784,7 +784,7 @@ describe('v1.InstancesClient', () => { client.innerApiCalls.deleteAccessConfig = stubSimpleCall(expectedResponse); const [response] = await client.deleteAccessConfig(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.deleteAccessConfig as SinonStub) .getCall(0) @@ -895,7 +895,7 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.detachDisk = stubSimpleCall(expectedResponse); const [response] = await client.detachDisk(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.detachDisk as SinonStub) .getCall(0) @@ -1789,7 +1789,7 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -1898,7 +1898,7 @@ describe('v1.InstancesClient', () => { client.innerApiCalls.removeResourcePolicies = stubSimpleCall(expectedResponse); const [response] = await client.removeResourcePolicies(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.removeResourcePolicies as SinonStub) .getCall(0) @@ -2012,7 +2012,7 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.reset = stubSimpleCall(expectedResponse); const [response] = await client.reset(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.reset as SinonStub) .getCall(0) @@ -2120,7 +2120,7 @@ describe('v1.InstancesClient', () => { client.innerApiCalls.setDeletionProtection = stubSimpleCall(expectedResponse); const [response] = await client.setDeletionProtection(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setDeletionProtection as SinonStub) .getCall(0) @@ -2234,7 +2234,7 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.setDiskAutoDelete = stubSimpleCall(expectedResponse); const [response] = await client.setDiskAutoDelete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setDiskAutoDelete as SinonStub) .getCall(0) @@ -2456,7 +2456,7 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); const [response] = await client.setLabels(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setLabels as SinonStub) .getCall(0) @@ -2565,7 +2565,7 @@ describe('v1.InstancesClient', () => { client.innerApiCalls.setMachineResources = stubSimpleCall(expectedResponse); const [response] = await client.setMachineResources(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setMachineResources as SinonStub) .getCall(0) @@ -2676,7 +2676,7 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.setMachineType = stubSimpleCall(expectedResponse); const [response] = await client.setMachineType(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setMachineType as SinonStub) .getCall(0) @@ -2787,7 +2787,7 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.setMetadata = stubSimpleCall(expectedResponse); const [response] = await client.setMetadata(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setMetadata as SinonStub) .getCall(0) @@ -2898,7 +2898,7 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.setMinCpuPlatform = stubSimpleCall(expectedResponse); const [response] = await client.setMinCpuPlatform(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setMinCpuPlatform as SinonStub) .getCall(0) @@ -3009,7 +3009,7 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.setScheduling = stubSimpleCall(expectedResponse); const [response] = await client.setScheduling(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setScheduling as SinonStub) .getCall(0) @@ -3120,7 +3120,7 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.setServiceAccount = stubSimpleCall(expectedResponse); const [response] = await client.setServiceAccount(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setServiceAccount as SinonStub) .getCall(0) @@ -3234,7 +3234,7 @@ describe('v1.InstancesClient', () => { const [response] = await client.setShieldedInstanceIntegrityPolicy( request ); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setShieldedInstanceIntegrityPolicy as SinonStub) .getCall(0) @@ -3348,7 +3348,7 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.setTags = stubSimpleCall(expectedResponse); const [response] = await client.setTags(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setTags as SinonStub) .getCall(0) @@ -3457,7 +3457,7 @@ describe('v1.InstancesClient', () => { client.innerApiCalls.simulateMaintenanceEvent = stubSimpleCall(expectedResponse); const [response] = await client.simulateMaintenanceEvent(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.simulateMaintenanceEvent as SinonStub) .getCall(0) @@ -3571,7 +3571,7 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.start = stubSimpleCall(expectedResponse); const [response] = await client.start(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.start as SinonStub) .getCall(0) @@ -3679,7 +3679,7 @@ describe('v1.InstancesClient', () => { client.innerApiCalls.startWithEncryptionKey = stubSimpleCall(expectedResponse); const [response] = await client.startWithEncryptionKey(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.startWithEncryptionKey as SinonStub) .getCall(0) @@ -3793,7 +3793,7 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.stop = stubSimpleCall(expectedResponse); const [response] = await client.stop(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.stop as SinonStub) .getCall(0) @@ -4012,7 +4012,7 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.update = stubSimpleCall(expectedResponse); const [response] = await client.update(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.update as SinonStub) .getCall(0) @@ -4121,7 +4121,7 @@ describe('v1.InstancesClient', () => { client.innerApiCalls.updateAccessConfig = stubSimpleCall(expectedResponse); const [response] = await client.updateAccessConfig(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.updateAccessConfig as SinonStub) .getCall(0) @@ -4233,7 +4233,7 @@ describe('v1.InstancesClient', () => { client.innerApiCalls.updateDisplayDevice = stubSimpleCall(expectedResponse); const [response] = await client.updateDisplayDevice(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.updateDisplayDevice as SinonStub) .getCall(0) @@ -4345,7 +4345,7 @@ describe('v1.InstancesClient', () => { client.innerApiCalls.updateNetworkInterface = stubSimpleCall(expectedResponse); const [response] = await client.updateNetworkInterface(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.updateNetworkInterface as SinonStub) .getCall(0) @@ -4460,7 +4460,7 @@ describe('v1.InstancesClient', () => { client.innerApiCalls.updateShieldedInstanceConfig = stubSimpleCall(expectedResponse); const [response] = await client.updateShieldedInstanceConfig(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.updateShieldedInstanceConfig as SinonStub) .getCall(0) diff --git a/test/gapic_interconnect_attachments_v1.ts b/test/gapic_interconnect_attachments_v1.ts index 7a094c2d..0fc1eb77 100644 --- a/test/gapic_interconnect_attachments_v1.ts +++ b/test/gapic_interconnect_attachments_v1.ts @@ -242,7 +242,7 @@ describe('v1.InterconnectAttachmentsClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -463,7 +463,7 @@ describe('v1.InterconnectAttachmentsClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -574,7 +574,7 @@ describe('v1.InterconnectAttachmentsClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) diff --git a/test/gapic_interconnects_v1.ts b/test/gapic_interconnects_v1.ts index 52cc7284..8b057e7b 100644 --- a/test/gapic_interconnects_v1.ts +++ b/test/gapic_interconnects_v1.ts @@ -230,7 +230,7 @@ describe('v1.InterconnectsClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -556,7 +556,7 @@ describe('v1.InterconnectsClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -664,7 +664,7 @@ describe('v1.InterconnectsClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) diff --git a/test/gapic_licenses_v1.ts b/test/gapic_licenses_v1.ts index 75ea3285..599624ea 100644 --- a/test/gapic_licenses_v1.ts +++ b/test/gapic_licenses_v1.ts @@ -230,7 +230,7 @@ describe('v1.LicensesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -556,7 +556,7 @@ describe('v1.LicensesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) diff --git a/test/gapic_network_endpoint_groups_v1.ts b/test/gapic_network_endpoint_groups_v1.ts index e4151f42..f2a4cd61 100644 --- a/test/gapic_network_endpoint_groups_v1.ts +++ b/test/gapic_network_endpoint_groups_v1.ts @@ -241,7 +241,7 @@ describe('v1.NetworkEndpointGroupsClient', () => { client.innerApiCalls.attachNetworkEndpoints = stubSimpleCall(expectedResponse); const [response] = await client.attachNetworkEndpoints(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.attachNetworkEndpoints as SinonStub) .getCall(0) @@ -358,7 +358,7 @@ describe('v1.NetworkEndpointGroupsClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -470,7 +470,7 @@ describe('v1.NetworkEndpointGroupsClient', () => { client.innerApiCalls.detachNetworkEndpoints = stubSimpleCall(expectedResponse); const [response] = await client.detachNetworkEndpoints(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.detachNetworkEndpoints as SinonStub) .getCall(0) @@ -697,7 +697,7 @@ describe('v1.NetworkEndpointGroupsClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) diff --git a/test/gapic_networks_v1.ts b/test/gapic_networks_v1.ts index 268d47d6..ab13dadb 100644 --- a/test/gapic_networks_v1.ts +++ b/test/gapic_networks_v1.ts @@ -230,7 +230,7 @@ describe('v1.NetworksClient', () => { ); client.innerApiCalls.addPeering = stubSimpleCall(expectedResponse); const [response] = await client.addPeering(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.addPeering as SinonStub) .getCall(0) @@ -341,7 +341,7 @@ describe('v1.NetworksClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -671,7 +671,7 @@ describe('v1.NetworksClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -779,7 +779,7 @@ describe('v1.NetworksClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -886,7 +886,7 @@ describe('v1.NetworksClient', () => { ); client.innerApiCalls.removePeering = stubSimpleCall(expectedResponse); const [response] = await client.removePeering(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.removePeering as SinonStub) .getCall(0) @@ -998,7 +998,7 @@ describe('v1.NetworksClient', () => { client.innerApiCalls.switchToCustomMode = stubSimpleCall(expectedResponse); const [response] = await client.switchToCustomMode(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.switchToCustomMode as SinonStub) .getCall(0) @@ -1109,7 +1109,7 @@ describe('v1.NetworksClient', () => { ); client.innerApiCalls.updatePeering = stubSimpleCall(expectedResponse); const [response] = await client.updatePeering(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.updatePeering as SinonStub) .getCall(0) diff --git a/test/gapic_node_groups_v1.ts b/test/gapic_node_groups_v1.ts index e68749e5..19b4ceda 100644 --- a/test/gapic_node_groups_v1.ts +++ b/test/gapic_node_groups_v1.ts @@ -230,7 +230,7 @@ describe('v1.NodeGroupsClient', () => { ); client.innerApiCalls.addNodes = stubSimpleCall(expectedResponse); const [response] = await client.addNodes(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.addNodes as SinonStub) .getCall(0) @@ -338,7 +338,7 @@ describe('v1.NodeGroupsClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -446,7 +446,7 @@ describe('v1.NodeGroupsClient', () => { ); client.innerApiCalls.deleteNodes = stubSimpleCall(expectedResponse); const [response] = await client.deleteNodes(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.deleteNodes as SinonStub) .getCall(0) @@ -775,7 +775,7 @@ describe('v1.NodeGroupsClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -883,7 +883,7 @@ describe('v1.NodeGroupsClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -1101,7 +1101,7 @@ describe('v1.NodeGroupsClient', () => { ); client.innerApiCalls.setNodeTemplate = stubSimpleCall(expectedResponse); const [response] = await client.setNodeTemplate(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setNodeTemplate as SinonStub) .getCall(0) diff --git a/test/gapic_node_templates_v1.ts b/test/gapic_node_templates_v1.ts index 75809885..a060f5e1 100644 --- a/test/gapic_node_templates_v1.ts +++ b/test/gapic_node_templates_v1.ts @@ -230,7 +230,7 @@ describe('v1.NodeTemplatesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -556,7 +556,7 @@ describe('v1.NodeTemplatesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) diff --git a/test/gapic_packet_mirrorings_v1.ts b/test/gapic_packet_mirrorings_v1.ts index ebee70a3..44236194 100644 --- a/test/gapic_packet_mirrorings_v1.ts +++ b/test/gapic_packet_mirrorings_v1.ts @@ -232,7 +232,7 @@ describe('v1.PacketMirroringsClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -447,7 +447,7 @@ describe('v1.PacketMirroringsClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -555,7 +555,7 @@ describe('v1.PacketMirroringsClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) diff --git a/test/gapic_projects_v1.ts b/test/gapic_projects_v1.ts index c13c6a71..4b8a5efd 100644 --- a/test/gapic_projects_v1.ts +++ b/test/gapic_projects_v1.ts @@ -230,7 +230,7 @@ describe('v1.ProjectsClient', () => { ); client.innerApiCalls.disableXpnHost = stubSimpleCall(expectedResponse); const [response] = await client.disableXpnHost(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.disableXpnHost as SinonStub) .getCall(0) @@ -342,7 +342,7 @@ describe('v1.ProjectsClient', () => { client.innerApiCalls.disableXpnResource = stubSimpleCall(expectedResponse); const [response] = await client.disableXpnResource(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.disableXpnResource as SinonStub) .getCall(0) @@ -453,7 +453,7 @@ describe('v1.ProjectsClient', () => { ); client.innerApiCalls.enableXpnHost = stubSimpleCall(expectedResponse); const [response] = await client.enableXpnHost(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.enableXpnHost as SinonStub) .getCall(0) @@ -564,7 +564,7 @@ describe('v1.ProjectsClient', () => { ); client.innerApiCalls.enableXpnResource = stubSimpleCall(expectedResponse); const [response] = await client.enableXpnResource(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.enableXpnResource as SinonStub) .getCall(0) @@ -893,7 +893,7 @@ describe('v1.ProjectsClient', () => { ); client.innerApiCalls.moveDisk = stubSimpleCall(expectedResponse); const [response] = await client.moveDisk(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.moveDisk as SinonStub) .getCall(0) @@ -1001,7 +1001,7 @@ describe('v1.ProjectsClient', () => { ); client.innerApiCalls.moveInstance = stubSimpleCall(expectedResponse); const [response] = await client.moveInstance(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.moveInstance as SinonStub) .getCall(0) @@ -1113,7 +1113,7 @@ describe('v1.ProjectsClient', () => { client.innerApiCalls.setCommonInstanceMetadata = stubSimpleCall(expectedResponse); const [response] = await client.setCommonInstanceMetadata(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setCommonInstanceMetadata as SinonStub) .getCall(0) @@ -1228,7 +1228,7 @@ describe('v1.ProjectsClient', () => { client.innerApiCalls.setDefaultNetworkTier = stubSimpleCall(expectedResponse); const [response] = await client.setDefaultNetworkTier(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setDefaultNetworkTier as SinonStub) .getCall(0) @@ -1343,7 +1343,7 @@ describe('v1.ProjectsClient', () => { client.innerApiCalls.setUsageExportBucket = stubSimpleCall(expectedResponse); const [response] = await client.setUsageExportBucket(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setUsageExportBucket as SinonStub) .getCall(0) diff --git a/test/gapic_public_advertised_prefixes_v1.ts b/test/gapic_public_advertised_prefixes_v1.ts index a9e37e52..fdeb37bc 100644 --- a/test/gapic_public_advertised_prefixes_v1.ts +++ b/test/gapic_public_advertised_prefixes_v1.ts @@ -242,7 +242,7 @@ describe('v1.PublicAdvertisedPrefixesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -463,7 +463,7 @@ describe('v1.PublicAdvertisedPrefixesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -574,7 +574,7 @@ describe('v1.PublicAdvertisedPrefixesClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) diff --git a/test/gapic_public_delegated_prefixes_v1.ts b/test/gapic_public_delegated_prefixes_v1.ts index 3b9aa15c..62006d21 100644 --- a/test/gapic_public_delegated_prefixes_v1.ts +++ b/test/gapic_public_delegated_prefixes_v1.ts @@ -242,7 +242,7 @@ describe('v1.PublicDelegatedPrefixesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -463,7 +463,7 @@ describe('v1.PublicDelegatedPrefixesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -574,7 +574,7 @@ describe('v1.PublicDelegatedPrefixesClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) diff --git a/test/gapic_region_autoscalers_v1.ts b/test/gapic_region_autoscalers_v1.ts index 4f58c717..79405f4a 100644 --- a/test/gapic_region_autoscalers_v1.ts +++ b/test/gapic_region_autoscalers_v1.ts @@ -232,7 +232,7 @@ describe('v1.RegionAutoscalersClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -447,7 +447,7 @@ describe('v1.RegionAutoscalersClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -555,7 +555,7 @@ describe('v1.RegionAutoscalersClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -662,7 +662,7 @@ describe('v1.RegionAutoscalersClient', () => { ); client.innerApiCalls.update = stubSimpleCall(expectedResponse); const [response] = await client.update(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.update as SinonStub) .getCall(0) diff --git a/test/gapic_region_backend_services_v1.ts b/test/gapic_region_backend_services_v1.ts index eb3dbe93..95b71349 100644 --- a/test/gapic_region_backend_services_v1.ts +++ b/test/gapic_region_backend_services_v1.ts @@ -240,7 +240,7 @@ describe('v1.RegionBackendServicesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -572,7 +572,7 @@ describe('v1.RegionBackendServicesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -683,7 +683,7 @@ describe('v1.RegionBackendServicesClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -793,7 +793,7 @@ describe('v1.RegionBackendServicesClient', () => { ); client.innerApiCalls.update = stubSimpleCall(expectedResponse); const [response] = await client.update(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.update as SinonStub) .getCall(0) diff --git a/test/gapic_region_commitments_v1.ts b/test/gapic_region_commitments_v1.ts index 715a551e..0fd9199a 100644 --- a/test/gapic_region_commitments_v1.ts +++ b/test/gapic_region_commitments_v1.ts @@ -339,7 +339,7 @@ describe('v1.RegionCommitmentsClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) diff --git a/test/gapic_region_disks_v1.ts b/test/gapic_region_disks_v1.ts index 41a5f7ee..639b5843 100644 --- a/test/gapic_region_disks_v1.ts +++ b/test/gapic_region_disks_v1.ts @@ -231,7 +231,7 @@ describe('v1.RegionDisksClient', () => { client.innerApiCalls.addResourcePolicies = stubSimpleCall(expectedResponse); const [response] = await client.addResourcePolicies(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.addResourcePolicies as SinonStub) .getCall(0) @@ -342,7 +342,7 @@ describe('v1.RegionDisksClient', () => { ); client.innerApiCalls.createSnapshot = stubSimpleCall(expectedResponse); const [response] = await client.createSnapshot(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.createSnapshot as SinonStub) .getCall(0) @@ -453,7 +453,7 @@ describe('v1.RegionDisksClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -779,7 +779,7 @@ describe('v1.RegionDisksClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -888,7 +888,7 @@ describe('v1.RegionDisksClient', () => { client.innerApiCalls.removeResourcePolicies = stubSimpleCall(expectedResponse); const [response] = await client.removeResourcePolicies(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.removeResourcePolicies as SinonStub) .getCall(0) @@ -1002,7 +1002,7 @@ describe('v1.RegionDisksClient', () => { ); client.innerApiCalls.resize = stubSimpleCall(expectedResponse); const [response] = await client.resize(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.resize as SinonStub) .getCall(0) @@ -1221,7 +1221,7 @@ describe('v1.RegionDisksClient', () => { ); client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); const [response] = await client.setLabels(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setLabels as SinonStub) .getCall(0) diff --git a/test/gapic_region_health_check_services_v1.ts b/test/gapic_region_health_check_services_v1.ts index 7939c40b..5b4efa39 100644 --- a/test/gapic_region_health_check_services_v1.ts +++ b/test/gapic_region_health_check_services_v1.ts @@ -242,7 +242,7 @@ describe('v1.RegionHealthCheckServicesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -463,7 +463,7 @@ describe('v1.RegionHealthCheckServicesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -574,7 +574,7 @@ describe('v1.RegionHealthCheckServicesClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) diff --git a/test/gapic_region_health_checks_v1.ts b/test/gapic_region_health_checks_v1.ts index fbbe2500..085776dc 100644 --- a/test/gapic_region_health_checks_v1.ts +++ b/test/gapic_region_health_checks_v1.ts @@ -232,7 +232,7 @@ describe('v1.RegionHealthChecksClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -447,7 +447,7 @@ describe('v1.RegionHealthChecksClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -555,7 +555,7 @@ describe('v1.RegionHealthChecksClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -662,7 +662,7 @@ describe('v1.RegionHealthChecksClient', () => { ); client.innerApiCalls.update = stubSimpleCall(expectedResponse); const [response] = await client.update(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.update as SinonStub) .getCall(0) diff --git a/test/gapic_region_instance_group_managers_v1.ts b/test/gapic_region_instance_group_managers_v1.ts index 11853e41..41cfea5a 100644 --- a/test/gapic_region_instance_group_managers_v1.ts +++ b/test/gapic_region_instance_group_managers_v1.ts @@ -255,7 +255,7 @@ describe('v1.RegionInstanceGroupManagersClient', () => { ); client.innerApiCalls.abandonInstances = stubSimpleCall(expectedResponse); const [response] = await client.abandonInstances(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.abandonInstances as SinonStub) .getCall(0) @@ -376,7 +376,7 @@ describe('v1.RegionInstanceGroupManagersClient', () => { client.innerApiCalls.applyUpdatesToInstances = stubSimpleCall(expectedResponse); const [response] = await client.applyUpdatesToInstances(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.applyUpdatesToInstances as SinonStub) .getCall(0) @@ -499,7 +499,7 @@ describe('v1.RegionInstanceGroupManagersClient', () => { ); client.innerApiCalls.createInstances = stubSimpleCall(expectedResponse); const [response] = await client.createInstances(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.createInstances as SinonStub) .getCall(0) @@ -619,7 +619,7 @@ describe('v1.RegionInstanceGroupManagersClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -736,7 +736,7 @@ describe('v1.RegionInstanceGroupManagersClient', () => { ); client.innerApiCalls.deleteInstances = stubSimpleCall(expectedResponse); const [response] = await client.deleteInstances(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.deleteInstances as SinonStub) .getCall(0) @@ -857,7 +857,7 @@ describe('v1.RegionInstanceGroupManagersClient', () => { client.innerApiCalls.deletePerInstanceConfigs = stubSimpleCall(expectedResponse); const [response] = await client.deletePerInstanceConfigs(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.deletePerInstanceConfigs as SinonStub) .getCall(0) @@ -1096,7 +1096,7 @@ describe('v1.RegionInstanceGroupManagersClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -1213,7 +1213,7 @@ describe('v1.RegionInstanceGroupManagersClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -1330,7 +1330,7 @@ describe('v1.RegionInstanceGroupManagersClient', () => { client.innerApiCalls.patchPerInstanceConfigs = stubSimpleCall(expectedResponse); const [response] = await client.patchPerInstanceConfigs(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patchPerInstanceConfigs as SinonStub) .getCall(0) @@ -1453,7 +1453,7 @@ describe('v1.RegionInstanceGroupManagersClient', () => { ); client.innerApiCalls.recreateInstances = stubSimpleCall(expectedResponse); const [response] = await client.recreateInstances(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.recreateInstances as SinonStub) .getCall(0) @@ -1573,7 +1573,7 @@ describe('v1.RegionInstanceGroupManagersClient', () => { ); client.innerApiCalls.resize = stubSimpleCall(expectedResponse); const [response] = await client.resize(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.resize as SinonStub) .getCall(0) @@ -1691,7 +1691,7 @@ describe('v1.RegionInstanceGroupManagersClient', () => { client.innerApiCalls.setInstanceTemplate = stubSimpleCall(expectedResponse); const [response] = await client.setInstanceTemplate(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setInstanceTemplate as SinonStub) .getCall(0) @@ -1811,7 +1811,7 @@ describe('v1.RegionInstanceGroupManagersClient', () => { ); client.innerApiCalls.setTargetPools = stubSimpleCall(expectedResponse); const [response] = await client.setTargetPools(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setTargetPools as SinonStub) .getCall(0) @@ -1932,7 +1932,7 @@ describe('v1.RegionInstanceGroupManagersClient', () => { client.innerApiCalls.updatePerInstanceConfigs = stubSimpleCall(expectedResponse); const [response] = await client.updatePerInstanceConfigs(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.updatePerInstanceConfigs as SinonStub) .getCall(0) diff --git a/test/gapic_region_instance_groups_v1.ts b/test/gapic_region_instance_groups_v1.ts index f5606362..880cfdb2 100644 --- a/test/gapic_region_instance_groups_v1.ts +++ b/test/gapic_region_instance_groups_v1.ts @@ -354,7 +354,7 @@ describe('v1.RegionInstanceGroupsClient', () => { ); client.innerApiCalls.setNamedPorts = stubSimpleCall(expectedResponse); const [response] = await client.setNamedPorts(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setNamedPorts as SinonStub) .getCall(0) diff --git a/test/gapic_region_instances_v1.ts b/test/gapic_region_instances_v1.ts index 868a9a4d..25051441 100644 --- a/test/gapic_region_instances_v1.ts +++ b/test/gapic_region_instances_v1.ts @@ -169,7 +169,7 @@ describe('v1.RegionInstancesClient', () => { ); client.innerApiCalls.bulkInsert = stubSimpleCall(expectedResponse); const [response] = await client.bulkInsert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.bulkInsert as SinonStub) .getCall(0) diff --git a/test/gapic_region_network_endpoint_groups_v1.ts b/test/gapic_region_network_endpoint_groups_v1.ts index e58639e3..631c457d 100644 --- a/test/gapic_region_network_endpoint_groups_v1.ts +++ b/test/gapic_region_network_endpoint_groups_v1.ts @@ -255,7 +255,7 @@ describe('v1.RegionNetworkEndpointGroupsClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -488,7 +488,7 @@ describe('v1.RegionNetworkEndpointGroupsClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) diff --git a/test/gapic_region_notification_endpoints_v1.ts b/test/gapic_region_notification_endpoints_v1.ts index 9d712dd8..320552a8 100644 --- a/test/gapic_region_notification_endpoints_v1.ts +++ b/test/gapic_region_notification_endpoints_v1.ts @@ -255,7 +255,7 @@ describe('v1.RegionNotificationEndpointsClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -488,7 +488,7 @@ describe('v1.RegionNotificationEndpointsClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) diff --git a/test/gapic_region_ssl_certificates_v1.ts b/test/gapic_region_ssl_certificates_v1.ts index a97f4ba6..3f7a36be 100644 --- a/test/gapic_region_ssl_certificates_v1.ts +++ b/test/gapic_region_ssl_certificates_v1.ts @@ -240,7 +240,7 @@ describe('v1.RegionSslCertificatesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -461,7 +461,7 @@ describe('v1.RegionSslCertificatesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) diff --git a/test/gapic_region_target_http_proxies_v1.ts b/test/gapic_region_target_http_proxies_v1.ts index 6d6dff44..2aceedf1 100644 --- a/test/gapic_region_target_http_proxies_v1.ts +++ b/test/gapic_region_target_http_proxies_v1.ts @@ -242,7 +242,7 @@ describe('v1.RegionTargetHttpProxiesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -463,7 +463,7 @@ describe('v1.RegionTargetHttpProxiesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -574,7 +574,7 @@ describe('v1.RegionTargetHttpProxiesClient', () => { ); client.innerApiCalls.setUrlMap = stubSimpleCall(expectedResponse); const [response] = await client.setUrlMap(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setUrlMap as SinonStub) .getCall(0) diff --git a/test/gapic_region_target_https_proxies_v1.ts b/test/gapic_region_target_https_proxies_v1.ts index 5e7ba28f..d82ba3d8 100644 --- a/test/gapic_region_target_https_proxies_v1.ts +++ b/test/gapic_region_target_https_proxies_v1.ts @@ -242,7 +242,7 @@ describe('v1.RegionTargetHttpsProxiesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -463,7 +463,7 @@ describe('v1.RegionTargetHttpsProxiesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -575,7 +575,7 @@ describe('v1.RegionTargetHttpsProxiesClient', () => { client.innerApiCalls.setSslCertificates = stubSimpleCall(expectedResponse); const [response] = await client.setSslCertificates(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setSslCertificates as SinonStub) .getCall(0) @@ -689,7 +689,7 @@ describe('v1.RegionTargetHttpsProxiesClient', () => { ); client.innerApiCalls.setUrlMap = stubSimpleCall(expectedResponse); const [response] = await client.setUrlMap(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setUrlMap as SinonStub) .getCall(0) diff --git a/test/gapic_region_url_maps_v1.ts b/test/gapic_region_url_maps_v1.ts index 27f21ed7..b71b1f4e 100644 --- a/test/gapic_region_url_maps_v1.ts +++ b/test/gapic_region_url_maps_v1.ts @@ -230,7 +230,7 @@ describe('v1.RegionUrlMapsClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -445,7 +445,7 @@ describe('v1.RegionUrlMapsClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -553,7 +553,7 @@ describe('v1.RegionUrlMapsClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -660,7 +660,7 @@ describe('v1.RegionUrlMapsClient', () => { ); client.innerApiCalls.update = stubSimpleCall(expectedResponse); const [response] = await client.update(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.update as SinonStub) .getCall(0) diff --git a/test/gapic_reservations_v1.ts b/test/gapic_reservations_v1.ts index 95539718..aaa6afcb 100644 --- a/test/gapic_reservations_v1.ts +++ b/test/gapic_reservations_v1.ts @@ -230,7 +230,7 @@ describe('v1.ReservationsClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -556,7 +556,7 @@ describe('v1.ReservationsClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -664,7 +664,7 @@ describe('v1.ReservationsClient', () => { ); client.innerApiCalls.resize = stubSimpleCall(expectedResponse); const [response] = await client.resize(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.resize as SinonStub) .getCall(0) diff --git a/test/gapic_resource_policies_v1.ts b/test/gapic_resource_policies_v1.ts index 8c8e9a33..b54ecbbb 100644 --- a/test/gapic_resource_policies_v1.ts +++ b/test/gapic_resource_policies_v1.ts @@ -232,7 +232,7 @@ describe('v1.ResourcePoliciesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -558,7 +558,7 @@ describe('v1.ResourcePoliciesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) diff --git a/test/gapic_routers_v1.ts b/test/gapic_routers_v1.ts index 84f204a1..21cc81ee 100644 --- a/test/gapic_routers_v1.ts +++ b/test/gapic_routers_v1.ts @@ -230,7 +230,7 @@ describe('v1.RoutersClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -556,7 +556,7 @@ describe('v1.RoutersClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -664,7 +664,7 @@ describe('v1.RoutersClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -879,7 +879,7 @@ describe('v1.RoutersClient', () => { ); client.innerApiCalls.update = stubSimpleCall(expectedResponse); const [response] = await client.update(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.update as SinonStub) .getCall(0) diff --git a/test/gapic_routes_v1.ts b/test/gapic_routes_v1.ts index cbc6a581..0cbd4cef 100644 --- a/test/gapic_routes_v1.ts +++ b/test/gapic_routes_v1.ts @@ -230,7 +230,7 @@ describe('v1.RoutesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -445,7 +445,7 @@ describe('v1.RoutesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) diff --git a/test/gapic_security_policies_v1.ts b/test/gapic_security_policies_v1.ts index 87f6dddf..ed99d7bd 100644 --- a/test/gapic_security_policies_v1.ts +++ b/test/gapic_security_policies_v1.ts @@ -232,7 +232,7 @@ describe('v1.SecurityPoliciesClient', () => { ); client.innerApiCalls.addRule = stubSimpleCall(expectedResponse); const [response] = await client.addRule(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.addRule as SinonStub) .getCall(0) @@ -340,7 +340,7 @@ describe('v1.SecurityPoliciesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -663,7 +663,7 @@ describe('v1.SecurityPoliciesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -886,7 +886,7 @@ describe('v1.SecurityPoliciesClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -993,7 +993,7 @@ describe('v1.SecurityPoliciesClient', () => { ); client.innerApiCalls.patchRule = stubSimpleCall(expectedResponse); const [response] = await client.patchRule(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patchRule as SinonStub) .getCall(0) @@ -1101,7 +1101,7 @@ describe('v1.SecurityPoliciesClient', () => { ); client.innerApiCalls.removeRule = stubSimpleCall(expectedResponse); const [response] = await client.removeRule(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.removeRule as SinonStub) .getCall(0) diff --git a/test/gapic_snapshots_v1.ts b/test/gapic_snapshots_v1.ts index 852ada39..1ca7efda 100644 --- a/test/gapic_snapshots_v1.ts +++ b/test/gapic_snapshots_v1.ts @@ -230,7 +230,7 @@ describe('v1.SnapshotsClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -667,7 +667,7 @@ describe('v1.SnapshotsClient', () => { ); client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); const [response] = await client.setLabels(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setLabels as SinonStub) .getCall(0) diff --git a/test/gapic_ssl_certificates_v1.ts b/test/gapic_ssl_certificates_v1.ts index 7b75dc5a..341ff5c1 100644 --- a/test/gapic_ssl_certificates_v1.ts +++ b/test/gapic_ssl_certificates_v1.ts @@ -232,7 +232,7 @@ describe('v1.SslCertificatesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -447,7 +447,7 @@ describe('v1.SslCertificatesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) diff --git a/test/gapic_ssl_policies_v1.ts b/test/gapic_ssl_policies_v1.ts index 83faf515..27757cda 100644 --- a/test/gapic_ssl_policies_v1.ts +++ b/test/gapic_ssl_policies_v1.ts @@ -230,7 +230,7 @@ describe('v1.SslPoliciesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -445,7 +445,7 @@ describe('v1.SslPoliciesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -668,7 +668,7 @@ describe('v1.SslPoliciesClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) diff --git a/test/gapic_subnetworks_v1.ts b/test/gapic_subnetworks_v1.ts index 9766e88a..147d7ba8 100644 --- a/test/gapic_subnetworks_v1.ts +++ b/test/gapic_subnetworks_v1.ts @@ -230,7 +230,7 @@ describe('v1.SubnetworksClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -338,7 +338,7 @@ describe('v1.SubnetworksClient', () => { ); client.innerApiCalls.expandIpCidrRange = stubSimpleCall(expectedResponse); const [response] = await client.expandIpCidrRange(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.expandIpCidrRange as SinonStub) .getCall(0) @@ -667,7 +667,7 @@ describe('v1.SubnetworksClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -775,7 +775,7 @@ describe('v1.SubnetworksClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -994,7 +994,7 @@ describe('v1.SubnetworksClient', () => { client.innerApiCalls.setPrivateIpGoogleAccess = stubSimpleCall(expectedResponse); const [response] = await client.setPrivateIpGoogleAccess(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setPrivateIpGoogleAccess as SinonStub) .getCall(0) diff --git a/test/gapic_target_grpc_proxies_v1.ts b/test/gapic_target_grpc_proxies_v1.ts index 81dd5893..6c454e49 100644 --- a/test/gapic_target_grpc_proxies_v1.ts +++ b/test/gapic_target_grpc_proxies_v1.ts @@ -232,7 +232,7 @@ describe('v1.TargetGrpcProxiesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -447,7 +447,7 @@ describe('v1.TargetGrpcProxiesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -555,7 +555,7 @@ describe('v1.TargetGrpcProxiesClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) diff --git a/test/gapic_target_http_proxies_v1.ts b/test/gapic_target_http_proxies_v1.ts index cd5ed418..6445a0b3 100644 --- a/test/gapic_target_http_proxies_v1.ts +++ b/test/gapic_target_http_proxies_v1.ts @@ -232,7 +232,7 @@ describe('v1.TargetHttpProxiesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -447,7 +447,7 @@ describe('v1.TargetHttpProxiesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -555,7 +555,7 @@ describe('v1.TargetHttpProxiesClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -662,7 +662,7 @@ describe('v1.TargetHttpProxiesClient', () => { ); client.innerApiCalls.setUrlMap = stubSimpleCall(expectedResponse); const [response] = await client.setUrlMap(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setUrlMap as SinonStub) .getCall(0) diff --git a/test/gapic_target_https_proxies_v1.ts b/test/gapic_target_https_proxies_v1.ts index ff7c25f8..dd035e7f 100644 --- a/test/gapic_target_https_proxies_v1.ts +++ b/test/gapic_target_https_proxies_v1.ts @@ -232,7 +232,7 @@ describe('v1.TargetHttpsProxiesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -447,7 +447,7 @@ describe('v1.TargetHttpsProxiesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -555,7 +555,7 @@ describe('v1.TargetHttpsProxiesClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -662,7 +662,7 @@ describe('v1.TargetHttpsProxiesClient', () => { ); client.innerApiCalls.setQuicOverride = stubSimpleCall(expectedResponse); const [response] = await client.setQuicOverride(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setQuicOverride as SinonStub) .getCall(0) @@ -774,7 +774,7 @@ describe('v1.TargetHttpsProxiesClient', () => { client.innerApiCalls.setSslCertificates = stubSimpleCall(expectedResponse); const [response] = await client.setSslCertificates(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setSslCertificates as SinonStub) .getCall(0) @@ -885,7 +885,7 @@ describe('v1.TargetHttpsProxiesClient', () => { ); client.innerApiCalls.setSslPolicy = stubSimpleCall(expectedResponse); const [response] = await client.setSslPolicy(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setSslPolicy as SinonStub) .getCall(0) @@ -996,7 +996,7 @@ describe('v1.TargetHttpsProxiesClient', () => { ); client.innerApiCalls.setUrlMap = stubSimpleCall(expectedResponse); const [response] = await client.setUrlMap(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setUrlMap as SinonStub) .getCall(0) diff --git a/test/gapic_target_instances_v1.ts b/test/gapic_target_instances_v1.ts index ca689c4e..8658e8db 100644 --- a/test/gapic_target_instances_v1.ts +++ b/test/gapic_target_instances_v1.ts @@ -232,7 +232,7 @@ describe('v1.TargetInstancesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -447,7 +447,7 @@ describe('v1.TargetInstancesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) diff --git a/test/gapic_target_pools_v1.ts b/test/gapic_target_pools_v1.ts index 0a4cd552..d56fed69 100644 --- a/test/gapic_target_pools_v1.ts +++ b/test/gapic_target_pools_v1.ts @@ -230,7 +230,7 @@ describe('v1.TargetPoolsClient', () => { ); client.innerApiCalls.addHealthCheck = stubSimpleCall(expectedResponse); const [response] = await client.addHealthCheck(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.addHealthCheck as SinonStub) .getCall(0) @@ -341,7 +341,7 @@ describe('v1.TargetPoolsClient', () => { ); client.innerApiCalls.addInstance = stubSimpleCall(expectedResponse); const [response] = await client.addInstance(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.addInstance as SinonStub) .getCall(0) @@ -452,7 +452,7 @@ describe('v1.TargetPoolsClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -775,7 +775,7 @@ describe('v1.TargetPoolsClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -883,7 +883,7 @@ describe('v1.TargetPoolsClient', () => { ); client.innerApiCalls.removeHealthCheck = stubSimpleCall(expectedResponse); const [response] = await client.removeHealthCheck(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.removeHealthCheck as SinonStub) .getCall(0) @@ -994,7 +994,7 @@ describe('v1.TargetPoolsClient', () => { ); client.innerApiCalls.removeInstance = stubSimpleCall(expectedResponse); const [response] = await client.removeInstance(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.removeInstance as SinonStub) .getCall(0) @@ -1105,7 +1105,7 @@ describe('v1.TargetPoolsClient', () => { ); client.innerApiCalls.setBackup = stubSimpleCall(expectedResponse); const [response] = await client.setBackup(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setBackup as SinonStub) .getCall(0) diff --git a/test/gapic_target_ssl_proxies_v1.ts b/test/gapic_target_ssl_proxies_v1.ts index 50c40a0b..da29e817 100644 --- a/test/gapic_target_ssl_proxies_v1.ts +++ b/test/gapic_target_ssl_proxies_v1.ts @@ -232,7 +232,7 @@ describe('v1.TargetSslProxiesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -447,7 +447,7 @@ describe('v1.TargetSslProxiesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -555,7 +555,7 @@ describe('v1.TargetSslProxiesClient', () => { ); client.innerApiCalls.setBackendService = stubSimpleCall(expectedResponse); const [response] = await client.setBackendService(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setBackendService as SinonStub) .getCall(0) @@ -666,7 +666,7 @@ describe('v1.TargetSslProxiesClient', () => { ); client.innerApiCalls.setProxyHeader = stubSimpleCall(expectedResponse); const [response] = await client.setProxyHeader(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setProxyHeader as SinonStub) .getCall(0) @@ -778,7 +778,7 @@ describe('v1.TargetSslProxiesClient', () => { client.innerApiCalls.setSslCertificates = stubSimpleCall(expectedResponse); const [response] = await client.setSslCertificates(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setSslCertificates as SinonStub) .getCall(0) @@ -889,7 +889,7 @@ describe('v1.TargetSslProxiesClient', () => { ); client.innerApiCalls.setSslPolicy = stubSimpleCall(expectedResponse); const [response] = await client.setSslPolicy(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setSslPolicy as SinonStub) .getCall(0) diff --git a/test/gapic_target_tcp_proxies_v1.ts b/test/gapic_target_tcp_proxies_v1.ts index c5bf97c4..5d7c68ff 100644 --- a/test/gapic_target_tcp_proxies_v1.ts +++ b/test/gapic_target_tcp_proxies_v1.ts @@ -232,7 +232,7 @@ describe('v1.TargetTcpProxiesClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -447,7 +447,7 @@ describe('v1.TargetTcpProxiesClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -555,7 +555,7 @@ describe('v1.TargetTcpProxiesClient', () => { ); client.innerApiCalls.setBackendService = stubSimpleCall(expectedResponse); const [response] = await client.setBackendService(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setBackendService as SinonStub) .getCall(0) @@ -666,7 +666,7 @@ describe('v1.TargetTcpProxiesClient', () => { ); client.innerApiCalls.setProxyHeader = stubSimpleCall(expectedResponse); const [response] = await client.setProxyHeader(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setProxyHeader as SinonStub) .getCall(0) diff --git a/test/gapic_target_vpn_gateways_v1.ts b/test/gapic_target_vpn_gateways_v1.ts index f6d77c4d..b2007b17 100644 --- a/test/gapic_target_vpn_gateways_v1.ts +++ b/test/gapic_target_vpn_gateways_v1.ts @@ -232,7 +232,7 @@ describe('v1.TargetVpnGatewaysClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -447,7 +447,7 @@ describe('v1.TargetVpnGatewaysClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) diff --git a/test/gapic_url_maps_v1.ts b/test/gapic_url_maps_v1.ts index 7bc121e9..f52a2f3e 100644 --- a/test/gapic_url_maps_v1.ts +++ b/test/gapic_url_maps_v1.ts @@ -230,7 +230,7 @@ describe('v1.UrlMapsClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -445,7 +445,7 @@ describe('v1.UrlMapsClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -553,7 +553,7 @@ describe('v1.UrlMapsClient', () => { ); client.innerApiCalls.invalidateCache = stubSimpleCall(expectedResponse); const [response] = await client.invalidateCache(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.invalidateCache as SinonStub) .getCall(0) @@ -664,7 +664,7 @@ describe('v1.UrlMapsClient', () => { ); client.innerApiCalls.patch = stubSimpleCall(expectedResponse); const [response] = await client.patch(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.patch as SinonStub) .getCall(0) @@ -771,7 +771,7 @@ describe('v1.UrlMapsClient', () => { ); client.innerApiCalls.update = stubSimpleCall(expectedResponse); const [response] = await client.update(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.update as SinonStub) .getCall(0) diff --git a/test/gapic_vpn_gateways_v1.ts b/test/gapic_vpn_gateways_v1.ts index 6783d522..6ed48e42 100644 --- a/test/gapic_vpn_gateways_v1.ts +++ b/test/gapic_vpn_gateways_v1.ts @@ -230,7 +230,7 @@ describe('v1.VpnGatewaysClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -553,7 +553,7 @@ describe('v1.VpnGatewaysClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0) @@ -661,7 +661,7 @@ describe('v1.VpnGatewaysClient', () => { ); client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); const [response] = await client.setLabels(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.setLabels as SinonStub) .getCall(0) diff --git a/test/gapic_vpn_tunnels_v1.ts b/test/gapic_vpn_tunnels_v1.ts index 910e4157..bae527cd 100644 --- a/test/gapic_vpn_tunnels_v1.ts +++ b/test/gapic_vpn_tunnels_v1.ts @@ -230,7 +230,7 @@ describe('v1.VpnTunnelsClient', () => { ); client.innerApiCalls.delete = stubSimpleCall(expectedResponse); const [response] = await client.delete(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.delete as SinonStub) .getCall(0) @@ -445,7 +445,7 @@ describe('v1.VpnTunnelsClient', () => { ); client.innerApiCalls.insert = stubSimpleCall(expectedResponse); const [response] = await client.insert(request); - assert.deepStrictEqual(response, expectedResponse); + assert.deepStrictEqual(response.latestResponse, expectedResponse); assert( (client.innerApiCalls.insert as SinonStub) .getCall(0)