diff --git a/packages/google-cloud-baremetalsolution/.jsdoc.js b/packages/google-cloud-baremetalsolution/.jsdoc.js index c8c5afda220..b5ef31181ab 100644 --- a/packages/google-cloud-baremetalsolution/.jsdoc.js +++ b/packages/google-cloud-baremetalsolution/.jsdoc.js @@ -43,7 +43,7 @@ module.exports = { copyright: 'Copyright 2022 Google LLC', includeDate: false, sourceFiles: false, - systemName: '@google-cloud/baremetalsolution', + systemName: '@google-cloud/bare-metal-solution', theme: 'lumen', default: { outputSourceFiles: false diff --git a/packages/google-cloud-baremetalsolution/.repo-metadata.json b/packages/google-cloud-baremetalsolution/.repo-metadata.json index 0a0be49102c..f69a37821c0 100644 --- a/packages/google-cloud-baremetalsolution/.repo-metadata.json +++ b/packages/google-cloud-baremetalsolution/.repo-metadata.json @@ -2,7 +2,7 @@ "name": "baremetalsolution", "name_pretty": "Bare Metal Solution API", "product_documentation": "https://cloud.google.com/bare-metal", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/bare-metal/latest", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/bare-metal-solution/latest", "issue_tracker": "https://github.com/googleapis/nodejs-bare-metal-solution/issues", "release_level": "preview", "language": "nodejs", @@ -13,4 +13,4 @@ "requires_billing": true, "api_shortname": "baremetalsolution", "library_type": "GAPIC_AUTO" - } \ No newline at end of file + } diff --git a/packages/google-cloud-baremetalsolution/README.md b/packages/google-cloud-baremetalsolution/README.md index c1a4e343c0d..fa35f002b70 100644 --- a/packages/google-cloud-baremetalsolution/README.md +++ b/packages/google-cloud-baremetalsolution/README.md @@ -116,7 +116,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-bare-metal-solution/blob/main/LICENSE) -[client-docs]: https://cloud.google.com/nodejs/docs/reference/bare-metal/latest +[client-docs]: https://cloud.google.com/nodejs/docs/reference/bare-metal-solution/latest [product-docs]: https://cloud.google.com/bare-metal [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project diff --git a/packages/google-cloud-baremetalsolution/linkinator.config.json b/packages/google-cloud-baremetalsolution/linkinator.config.json index 5840d142b2a..befd23c8633 100644 --- a/packages/google-cloud-baremetalsolution/linkinator.config.json +++ b/packages/google-cloud-baremetalsolution/linkinator.config.json @@ -1 +1,16 @@ -{"recurse":true,"skip":["https://codecov.io/gh/googleapis/","www.googleapis.com","img.shields.io", "https://github.com/googleapis/nodejs-bare-metal-solution/blob/master/CHANGELOG.md", "https://cloud.google.com/nodejs/docs/reference/bare-metal/latest", "https://github.com/googleapis/nodejs-bare-metal-solution/blob/addInitialSamplesAndTests/CHANGELOG.md"],"silent":true,"concurrency":5,"retry":true,"retryErrors":true,"retryErrorsCount":5,"retryErrorsJitter":3000} \ No newline at end of file +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.detach_lun.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.detach_lun.js index 761286ea224..00f7d3e50e6 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.detach_lun.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.detach_lun.js @@ -23,6 +23,9 @@ function main(instance, lun) { // [START baremetalsolution_v2_generated_BareMetalSolution_DetachLun_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -35,7 +38,7 @@ function main(instance, lun) { // const lun = 'abc123' // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_instance.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_instance.js index 84b532f8cba..d5168f33e5a 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_instance.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START baremetalsolution_v2_generated_BareMetalSolution_GetInstance_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -31,7 +34,7 @@ function main(name) { // const name = 'abc123' // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_lun.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_lun.js index 495a729dbd9..4d6797e22ef 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_lun.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_lun.js @@ -23,6 +23,9 @@ function main(name) { // [START baremetalsolution_v2_generated_BareMetalSolution_GetLun_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -31,7 +34,7 @@ function main(name) { // const name = 'abc123' // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_network.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_network.js index 4c0967dd519..7fa58483e9c 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_network.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_network.js @@ -23,6 +23,9 @@ function main(name) { // [START baremetalsolution_v2_generated_BareMetalSolution_GetNetwork_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -31,7 +34,7 @@ function main(name) { // const name = 'abc123' // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_nfs_share.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_nfs_share.js index 5c476e24994..e351948e1da 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_nfs_share.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_nfs_share.js @@ -23,6 +23,9 @@ function main(name) { // [START baremetalsolution_v2_generated_BareMetalSolution_GetNfsShare_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -31,7 +34,7 @@ function main(name) { // const name = 'abc123' // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_volume.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_volume.js index 3153aa1a708..6cb1fd8b6d2 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_volume.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_volume.js @@ -23,6 +23,9 @@ function main(name) { // [START baremetalsolution_v2_generated_BareMetalSolution_GetVolume_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -31,7 +34,7 @@ function main(name) { // const name = 'abc123' // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_instances.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_instances.js index bcb28b6c021..adb0d82efbb 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_instances.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_instances.js @@ -23,6 +23,9 @@ function main(parent) { // [START baremetalsolution_v2_generated_BareMetalSolution_ListInstances_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -44,7 +47,7 @@ function main(parent) { // const filter = 'abc123' // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_luns.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_luns.js index 377533c0151..7ebcefab717 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_luns.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_luns.js @@ -23,6 +23,9 @@ function main(parent) { // [START baremetalsolution_v2_generated_BareMetalSolution_ListLuns_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -40,7 +43,7 @@ function main(parent) { // const pageToken = 'abc123' // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_network_usage.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_network_usage.js index 5d395551725..8c80d63ea1c 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_network_usage.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_network_usage.js @@ -23,6 +23,9 @@ function main(location) { // [START baremetalsolution_v2_generated_BareMetalSolution_ListNetworkUsage_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -31,7 +34,7 @@ function main(location) { // const location = 'abc123' // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_networks.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_networks.js index d85b2dd3c47..8deb359b34d 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_networks.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_networks.js @@ -23,6 +23,9 @@ function main(parent) { // [START baremetalsolution_v2_generated_BareMetalSolution_ListNetworks_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -44,7 +47,7 @@ function main(parent) { // const filter = 'abc123' // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_nfs_shares.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_nfs_shares.js index 0022e02edd3..a0d3385e0ca 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_nfs_shares.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_nfs_shares.js @@ -23,6 +23,9 @@ function main(parent) { // [START baremetalsolution_v2_generated_BareMetalSolution_ListNfsShares_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -44,7 +47,7 @@ function main(parent) { // const filter = 'abc123' // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_volumes.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_volumes.js index 1f9c97e9e3c..899796000fd 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_volumes.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_volumes.js @@ -23,6 +23,9 @@ function main(parent) { // [START baremetalsolution_v2_generated_BareMetalSolution_ListVolumes_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -44,7 +47,7 @@ function main(parent) { // const filter = 'abc123' // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.reset_instance.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.reset_instance.js index 3865ed1ea0d..7696cfb341e 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.reset_instance.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.reset_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START baremetalsolution_v2_generated_BareMetalSolution_ResetInstance_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -31,7 +34,7 @@ function main(name) { // const name = 'abc123' // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.resize_volume.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.resize_volume.js index 40bea9f954f..e1251e13806 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.resize_volume.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.resize_volume.js @@ -23,6 +23,9 @@ function main(volume) { // [START baremetalsolution_v2_generated_BareMetalSolution_ResizeVolume_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -35,7 +38,7 @@ function main(volume) { // const sizeGib = 1234 // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.start_instance.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.start_instance.js index 2b26d491cf2..513faba5144 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.start_instance.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.start_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START baremetalsolution_v2_generated_BareMetalSolution_StartInstance_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -31,7 +34,7 @@ function main(name) { // const name = 'abc123' // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.stop_instance.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.stop_instance.js index 2aa492d805a..c19145c2794 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.stop_instance.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.stop_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START baremetalsolution_v2_generated_BareMetalSolution_StopInstance_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -31,7 +34,7 @@ function main(name) { // const name = 'abc123' // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_instance.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_instance.js index 0bbec416ee0..6322ccf5ff3 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_instance.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_instance.js @@ -23,6 +23,9 @@ function main(instance) { // [START baremetalsolution_v2_generated_BareMetalSolution_UpdateInstance_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -41,7 +44,7 @@ function main(instance) { // const updateMask = {} // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_network.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_network.js index bb60e75b3e3..b432f00ce62 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_network.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_network.js @@ -23,6 +23,9 @@ function main(network) { // [START baremetalsolution_v2_generated_BareMetalSolution_UpdateNetwork_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -39,7 +42,7 @@ function main(network) { // const updateMask = {} // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_nfs_share.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_nfs_share.js index 8cf3909db5a..52809cc6bd4 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_nfs_share.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_nfs_share.js @@ -23,6 +23,9 @@ function main(nfsShare) { // [START baremetalsolution_v2_generated_BareMetalSolution_UpdateNfsShare_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -39,7 +42,7 @@ function main(nfsShare) { // const updateMask = {} // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_volume.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_volume.js index 71b764c98ef..a4f700cec77 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_volume.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_volume.js @@ -23,6 +23,9 @@ function main(volume) { // [START baremetalsolution_v2_generated_BareMetalSolution_UpdateVolume_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** @@ -43,7 +46,7 @@ function main(volume) { // const updateMask = {} // Imports the Baremetalsolution library - const {BareMetalSolutionClient} = require('@google-cloud/baremetalsolution').v2; + const {BareMetalSolutionClient} = require('@google-cloud/bare-metal-solution').v2; // Instantiates a client const baremetalsolutionClient = new BareMetalSolutionClient(); diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/snippet_metadata.google.cloud.baremetalsolution.v2.json b/packages/google-cloud-baremetalsolution/samples/generated/v2/snippet_metadata.google.cloud.baremetalsolution.v2.json index 718c9b8c2b3..f3840df04f2 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/snippet_metadata.google.cloud.baremetalsolution.v2.json +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/snippet_metadata.google.cloud.baremetalsolution.v2.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 65, + "end": 68, "type": "FULL" } ], @@ -74,7 +74,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -114,7 +114,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -158,7 +158,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -198,7 +198,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -238,7 +238,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -278,7 +278,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -322,7 +322,7 @@ "segments": [ { "start": 25, - "end": 65, + "end": 68, "type": "FULL" } ], @@ -374,7 +374,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -414,7 +414,7 @@ "segments": [ { "start": 25, - "end": 63, + "end": 66, "type": "FULL" } ], @@ -458,7 +458,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -502,7 +502,7 @@ "segments": [ { "start": 25, - "end": 65, + "end": 68, "type": "FULL" } ], @@ -554,7 +554,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -594,7 +594,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -634,7 +634,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], @@ -678,7 +678,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -718,7 +718,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -766,7 +766,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -806,7 +806,7 @@ "segments": [ { "start": 25, - "end": 65, + "end": 68, "type": "FULL" } ], @@ -858,7 +858,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], diff --git a/packages/google-cloud-baremetalsolution/src/v2/bare_metal_solution_client.ts b/packages/google-cloud-baremetalsolution/src/v2/bare_metal_solution_client.ts index 89870f913a6..a377be0574d 100644 --- a/packages/google-cloud-baremetalsolution/src/v2/bare_metal_solution_client.ts +++ b/packages/google-cloud-baremetalsolution/src/v2/bare_metal_solution_client.ts @@ -17,12 +17,13 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -31,9 +32,7 @@ import { LocationsClient, LocationProtos, } from 'google-gax'; - import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -42,7 +41,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './bare_metal_solution_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -85,7 +83,7 @@ export class BareMetalSolutionClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -108,13 +106,22 @@ export class BareMetalSolutionClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new BareMetalSolutionClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof BareMetalSolutionClient; const servicePath = @@ -134,8 +141,13 @@ export class BareMetalSolutionClient { opts['scopes'] = staticMembers.scopes; } + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); @@ -156,9 +168,12 @@ export class BareMetalSolutionClient { if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; } - this.iamClient = new IamClient(this._gaxGrpc, opts); + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - this.locationsClient = new LocationsClient(this._gaxGrpc, opts); + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; @@ -234,16 +249,28 @@ export class BareMetalSolutionClient { }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v2/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v2/{name=projects/*}/locations', + }, + ]; + } this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const updateInstanceResponse = protoFilesRoot.lookup( '.google.cloud.baremetalsolution.v2.Instance' @@ -362,7 +389,7 @@ export class BareMetalSolutionClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -442,7 +469,8 @@ export class BareMetalSolutionClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -589,7 +617,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -680,7 +708,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -778,7 +806,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ location: request.location || '', }); this.initialize(); @@ -869,7 +897,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -960,7 +988,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1051,7 +1079,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1164,7 +1192,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'instance.name': request.instance!.name || '', }); this.initialize(); @@ -1190,14 +1218,15 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.updateInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.baremetalsolution.v2.Instance, @@ -1302,7 +1331,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1328,14 +1357,15 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.resetInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.baremetalsolution.v2.ResetInstanceResponse, @@ -1439,7 +1469,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1465,14 +1495,15 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.startInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.baremetalsolution.v2.StartInstanceResponse, @@ -1576,7 +1607,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1602,14 +1633,15 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.stopInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.baremetalsolution.v2.StopInstanceResponse, @@ -1715,7 +1747,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ instance: request.instance || '', }); this.initialize(); @@ -1741,14 +1773,15 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.detachLun, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.baremetalsolution.v2.Instance, @@ -1863,7 +1896,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'volume.name': request.volume!.name || '', }); this.initialize(); @@ -1889,14 +1922,15 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.updateVolume, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.baremetalsolution.v2.Volume, @@ -2002,7 +2036,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ volume: request.volume || '', }); this.initialize(); @@ -2028,14 +2062,15 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.resizeVolume, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.baremetalsolution.v2.Volume, @@ -2146,7 +2181,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'network.name': request.network!.name || '', }); this.initialize(); @@ -2172,14 +2207,15 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.updateNetwork, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.baremetalsolution.v2.Network, @@ -2290,7 +2326,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'nfs_share.name': request.nfsShare!.name || '', }); this.initialize(); @@ -2316,14 +2352,15 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.updateNfsShare, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.baremetalsolution.v2.NfsShare, @@ -2425,7 +2462,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -2466,14 +2503,14 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listInstances.createStream( - this.innerApiCalls.listInstances as gax.GaxCall, + this.innerApiCalls.listInstances as GaxCall, request, callSettings ); @@ -2516,7 +2553,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listInstances']; @@ -2524,7 +2561,7 @@ export class BareMetalSolutionClient { this.initialize(); return this.descriptors.page.listInstances.asyncIterate( this.innerApiCalls['listInstances'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2623,7 +2660,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -2664,14 +2701,14 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listVolumes']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listVolumes.createStream( - this.innerApiCalls.listVolumes as gax.GaxCall, + this.innerApiCalls.listVolumes as GaxCall, request, callSettings ); @@ -2714,7 +2751,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listVolumes']; @@ -2722,7 +2759,7 @@ export class BareMetalSolutionClient { this.initialize(); return this.descriptors.page.listVolumes.asyncIterate( this.innerApiCalls['listVolumes'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2821,7 +2858,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -2862,14 +2899,14 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listNetworks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listNetworks.createStream( - this.innerApiCalls.listNetworks as gax.GaxCall, + this.innerApiCalls.listNetworks as GaxCall, request, callSettings ); @@ -2912,7 +2949,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listNetworks']; @@ -2920,7 +2957,7 @@ export class BareMetalSolutionClient { this.initialize(); return this.descriptors.page.listNetworks.asyncIterate( this.innerApiCalls['listNetworks'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3017,7 +3054,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3056,14 +3093,14 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listLuns']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listLuns.createStream( - this.innerApiCalls.listLuns as gax.GaxCall, + this.innerApiCalls.listLuns as GaxCall, request, callSettings ); @@ -3104,7 +3141,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listLuns']; @@ -3112,7 +3149,7 @@ export class BareMetalSolutionClient { this.initialize(); return this.descriptors.page.listLuns.asyncIterate( this.innerApiCalls['listLuns'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3211,7 +3248,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3252,14 +3289,14 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listNfsShares']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listNfsShares.createStream( - this.innerApiCalls.listNfsShares as gax.GaxCall, + this.innerApiCalls.listNfsShares as GaxCall, request, callSettings ); @@ -3302,7 +3339,7 @@ export class BareMetalSolutionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listNfsShares']; @@ -3310,7 +3347,7 @@ export class BareMetalSolutionClient { this.initialize(); return this.descriptors.page.listNfsShares.asyncIterate( this.innerApiCalls['listNfsShares'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-baremetalsolution/src/v2/gapic_metadata.json b/packages/google-cloud-baremetalsolution/src/v2/gapic_metadata.json index 9ef5aa0ea74..3d8eb09837c 100644 --- a/packages/google-cloud-baremetalsolution/src/v2/gapic_metadata.json +++ b/packages/google-cloud-baremetalsolution/src/v2/gapic_metadata.json @@ -3,7 +3,7 @@ "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", "language": "typescript", "protoPackage": "google.cloud.baremetalsolution.v2", - "libraryPackage": "@google-cloud/baremetalsolution", + "libraryPackage": "@google-cloud/bare-metal-solution", "services": { "BareMetalSolution": { "clients": { diff --git a/packages/google-cloud-baremetalsolution/test/gapic_bare_metal_solution_v2.ts b/packages/google-cloud-baremetalsolution/test/gapic_bare_metal_solution_v2.ts index 583ea22e3e3..bce945f6851 100644 --- a/packages/google-cloud-baremetalsolution/test/gapic_bare_metal_solution_v2.ts +++ b/packages/google-cloud-baremetalsolution/test/gapic_bare_metal_solution_v2.ts @@ -151,101 +151,103 @@ function stubAsyncIterationCall( } describe('v2.BareMetalSolutionClient', () => { - it('has servicePath', () => { - const servicePath = - baremetalsolutionModule.v2.BareMetalSolutionClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - baremetalsolutionModule.v2.BareMetalSolutionClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = baremetalsolutionModule.v2.BareMetalSolutionClient.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + baremetalsolutionModule.v2.BareMetalSolutionClient.servicePath; + assert(servicePath); + }); - it('should create a client with no option', () => { - const client = new baremetalsolutionModule.v2.BareMetalSolutionClient(); - assert(client); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + baremetalsolutionModule.v2.BareMetalSolutionClient.apiEndpoint; + assert(apiEndpoint); + }); - it('should create a client with gRPC fallback', () => { - const client = new baremetalsolutionModule.v2.BareMetalSolutionClient({ - fallback: true, + it('has port', () => { + const port = baremetalsolutionModule.v2.BareMetalSolutionClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new baremetalsolutionModule.v2.BareMetalSolutionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new baremetalsolutionModule.v2.BareMetalSolutionClient(); + assert(client); }); - assert.strictEqual(client.bareMetalSolutionStub, undefined); - await client.initialize(); - assert(client.bareMetalSolutionStub); - }); - it('has close method for the initialized client', done => { - const client = new baremetalsolutionModule.v2.BareMetalSolutionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with gRPC fallback', () => { + const client = new baremetalsolutionModule.v2.BareMetalSolutionClient({ + fallback: true, + }); + assert(client); }); - client.initialize(); - assert(client.bareMetalSolutionStub); - client.close().then(() => { - done(); + + it('has initialize method and supports deferred initialization', async () => { + const client = new baremetalsolutionModule.v2.BareMetalSolutionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bareMetalSolutionStub, undefined); + await client.initialize(); + assert(client.bareMetalSolutionStub); }); - }); - it('has close method for the non-initialized client', done => { - const client = new baremetalsolutionModule.v2.BareMetalSolutionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = new baremetalsolutionModule.v2.BareMetalSolutionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.bareMetalSolutionStub); + client.close().then(() => { + done(); + }); }); - assert.strictEqual(client.bareMetalSolutionStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the non-initialized client', done => { + const client = new baremetalsolutionModule.v2.BareMetalSolutionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bareMetalSolutionStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new baremetalsolutionModule.v2.BareMetalSolutionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new baremetalsolutionModule.v2.BareMetalSolutionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new baremetalsolutionModule.v2.BareMetalSolutionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new baremetalsolutionModule.v2.BareMetalSolutionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('getInstance', () => {