From 3c6b8680d57696a352aac4693e07d4b30a42d125 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 18 Feb 2022 02:06:47 +0000 Subject: [PATCH] docs(samples): include metadata file, add exclusions for samples to handwritten libraries (#50) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 429395631 Source-Link: https://github.com/googleapis/googleapis/commit/84594b35af0c38efcd6967e8179d801702ad96ff Source-Link: https://github.com/googleapis/googleapis-gen/commit/ed74f970fd82914874e6b27b04763cfa66bafe9b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ3NGY5NzBmZDgyOTE0ODc0ZTZiMjdiMDQ3NjNjZmE2NmJhZmU5YiJ9 --- .../cloud_filestore_manager.create_backup.js | 9 +- ...cloud_filestore_manager.create_instance.js | 9 +- .../cloud_filestore_manager.delete_backup.js | 9 +- ...cloud_filestore_manager.delete_instance.js | 9 +- .../v1/cloud_filestore_manager.get_backup.js | 9 +- .../cloud_filestore_manager.get_instance.js | 9 +- .../cloud_filestore_manager.list_backups.js | 9 +- .../cloud_filestore_manager.list_instances.js | 9 +- ...loud_filestore_manager.restore_instance.js | 9 +- .../cloud_filestore_manager.update_backup.js | 9 +- ...cloud_filestore_manager.update_instance.js | 9 +- ...et_metadata.google.cloud.filestore.v1.json | 519 +++++++++++++++++ .../cloud_filestore_manager.create_backup.js | 9 +- ...cloud_filestore_manager.create_instance.js | 9 +- .../cloud_filestore_manager.delete_backup.js | 9 +- ...cloud_filestore_manager.delete_instance.js | 9 +- .../cloud_filestore_manager.get_backup.js | 9 +- .../cloud_filestore_manager.get_instance.js | 9 +- .../cloud_filestore_manager.list_backups.js | 9 +- .../cloud_filestore_manager.list_instances.js | 9 +- ...loud_filestore_manager.restore_instance.js | 9 +- .../cloud_filestore_manager.update_backup.js | 9 +- ...cloud_filestore_manager.update_instance.js | 9 +- ...tadata.google.cloud.filestore.v1beta1.json | 523 ++++++++++++++++++ .../src/v1/cloud_filestore_manager_client.ts | 5 +- .../v1beta1/cloud_filestore_manager_client.ts | 5 +- .../test/gapic_cloud_filestore_manager_v1.ts | 54 +- .../gapic_cloud_filestore_manager_v1beta1.ts | 54 +- 28 files changed, 1304 insertions(+), 54 deletions(-) create mode 100644 packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js index ae868a0ddac..522528ea9a2 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js index c0c19b55f26..f1ee31af676 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js index 53bfadb59c1..e7a3f857a5d 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js index 944b49c6c91..160d13046bd 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js index ca8fb341b42..dbf655241ca 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js index 656a623d43d..64c7a269f81 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js index a97f6667a23..37fe21306b2 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js index 57f14cec46a..800afa0218c 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js index 732095f6d83..2be0689e19d 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js index 3291c8da7c1..153cf08ed8b 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js index 32a86c37ee7..80af3634128 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json b/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json new file mode 100644 index 00000000000..8ff56c35917 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json @@ -0,0 +1,519 @@ +{ + "clientLibrary": { + "name": "nodejs-filestore", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.filestore.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "file_v1_generated_CloudFilestoreManager_ListInstances_async", + "title": "CloudFilestoreManager listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists all instances in a project for either a specified location or for all locations.", + "canonical": true, + "file": "cloud_filestore_manager.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1.ListInstancesResponse", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.ListInstances", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_GetInstance_async", + "title": "CloudFilestoreManager getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets the details of a specific instance.", + "canonical": true, + "file": "cloud_filestore_manager.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1.Instance", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.GetInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_CreateInstance_async", + "title": "CloudFilestoreManager createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates an instance. When creating from a backup, the capacity of the new instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).", + "canonical": true, + "file": "cloud_filestore_manager.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.filestore.v1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.CreateInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_UpdateInstance_async", + "title": "CloudFilestoreManager updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a specific instance.", + "canonical": true, + "file": "cloud_filestore_manager.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "instance", + "type": ".google.cloud.filestore.v1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.UpdateInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_RestoreInstance_async", + "title": "CloudFilestoreManager restoreInstance Sample", + "origin": "API_DEFINITION", + "description": " Restores an existing instance's file share from a backup. The capacity of the instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).", + "canonical": true, + "file": "cloud_filestore_manager.restore_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.RestoreInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "file_share", + "type": "TYPE_STRING" + }, + { + "name": "source_backup", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "RestoreInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.RestoreInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_DeleteInstance_async", + "title": "CloudFilestoreManager deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes an instance.", + "canonical": true, + "file": "cloud_filestore_manager.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.DeleteInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_ListBackups_async", + "title": "CloudFilestoreManager listBackups Sample", + "origin": "API_DEFINITION", + "description": " Lists all backups in a project for either a specified location or for all locations.", + "canonical": true, + "file": "cloud_filestore_manager.list_backups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackups", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.ListBackups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1.ListBackupsResponse", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "ListBackups", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.ListBackups", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_GetBackup_async", + "title": "CloudFilestoreManager getBackup Sample", + "origin": "API_DEFINITION", + "description": " Gets the details of a specific backup.", + "canonical": true, + "file": "cloud_filestore_manager.get_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.GetBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1.Backup", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "GetBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.GetBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_CreateBackup_async", + "title": "CloudFilestoreManager createBackup Sample", + "origin": "API_DEFINITION", + "description": " Creates a backup.", + "canonical": true, + "file": "cloud_filestore_manager.create_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.CreateBackup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup", + "type": ".google.cloud.filestore.v1.Backup" + }, + { + "name": "backup_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "CreateBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.CreateBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_DeleteBackup_async", + "title": "CloudFilestoreManager deleteBackup Sample", + "origin": "API_DEFINITION", + "description": " Deletes a backup.", + "canonical": true, + "file": "cloud_filestore_manager.delete_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.DeleteBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.DeleteBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_UpdateBackup_async", + "title": "CloudFilestoreManager updateBackup Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a specific backup.", + "canonical": true, + "file": "cloud_filestore_manager.update_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.UpdateBackup", + "async": true, + "parameters": [ + { + "name": "backup", + "type": ".google.cloud.filestore.v1.Backup" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.UpdateBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + } + ] +} diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js index 8e10c92aa4c..8a1d810399f 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js index 82a6a00965a..efd8d806f5b 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js index e73ba99fdb9..29babc4b0d9 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js index 3691a68c0fa..115388bfcbf 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js index 1167a9517b5..6a1ba8dcb04 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js index ab33ae4aec5..5b1b616b021 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js index 94801f20c32..20b4215eab0 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js index c2d16fda48f..550c331c3ce 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js index 0ad48f86df4..feac01861bb 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js index 00cdcbcb056..d1c471ad7fc 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js index 6304985e1ab..176ad3d1cd0 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json b/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json new file mode 100644 index 00000000000..319df898695 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json @@ -0,0 +1,523 @@ +{ + "clientLibrary": { + "name": "nodejs-filestore", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.filestore.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_ListInstances_async", + "title": "CloudFilestoreManager listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists all instances in a project for either a specified location or for all locations.", + "canonical": true, + "file": "cloud_filestore_manager.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1beta1.ListInstancesResponse", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListInstances", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_GetInstance_async", + "title": "CloudFilestoreManager getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets the details of a specific instance.", + "canonical": true, + "file": "cloud_filestore_manager.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1beta1.Instance", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_CreateInstance_async", + "title": "CloudFilestoreManager createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates an instance. When creating from a backup, the capacity of the new instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).", + "canonical": true, + "file": "cloud_filestore_manager.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.filestore.v1beta1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_UpdateInstance_async", + "title": "CloudFilestoreManager updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a specific instance.", + "canonical": true, + "file": "cloud_filestore_manager.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "instance", + "type": ".google.cloud.filestore.v1beta1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_RestoreInstance_async", + "title": "CloudFilestoreManager restoreInstance Sample", + "origin": "API_DEFINITION", + "description": " Restores an existing instance's file share from a backup. The capacity of the instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).", + "canonical": true, + "file": "cloud_filestore_manager.restore_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.RestoreInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "file_share", + "type": "TYPE_STRING" + }, + { + "name": "source_snapshot", + "type": "TYPE_STRING" + }, + { + "name": "source_backup", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "RestoreInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.RestoreInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_DeleteInstance_async", + "title": "CloudFilestoreManager deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes an instance.", + "canonical": true, + "file": "cloud_filestore_manager.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_ListBackups_async", + "title": "CloudFilestoreManager listBackups Sample", + "origin": "API_DEFINITION", + "description": " Lists all backups in a project for either a specified location or for all locations.", + "canonical": true, + "file": "cloud_filestore_manager.list_backups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackups", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListBackups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1beta1.ListBackupsResponse", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "ListBackups", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListBackups", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_GetBackup_async", + "title": "CloudFilestoreManager getBackup Sample", + "origin": "API_DEFINITION", + "description": " Gets the details of a specific backup.", + "canonical": true, + "file": "cloud_filestore_manager.get_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1beta1.Backup", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "GetBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_CreateBackup_async", + "title": "CloudFilestoreManager createBackup Sample", + "origin": "API_DEFINITION", + "description": " Creates a backup.", + "canonical": true, + "file": "cloud_filestore_manager.create_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateBackup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup", + "type": ".google.cloud.filestore.v1beta1.Backup" + }, + { + "name": "backup_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "CreateBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_DeleteBackup_async", + "title": "CloudFilestoreManager deleteBackup Sample", + "origin": "API_DEFINITION", + "description": " Deletes a backup.", + "canonical": true, + "file": "cloud_filestore_manager.delete_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_UpdateBackup_async", + "title": "CloudFilestoreManager updateBackup Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a specific backup.", + "canonical": true, + "file": "cloud_filestore_manager.update_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateBackup", + "async": true, + "parameters": [ + { + "name": "backup", + "type": ".google.cloud.filestore.v1beta1.Backup" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + } + ] +} diff --git a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts index 17e4d9e6860..63cf537d1f6 100644 --- a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts @@ -2203,9 +2203,8 @@ export class CloudFilestoreManagerClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.cloudFilestoreManagerStub!.then(stub => { + if (this.cloudFilestoreManagerStub && !this._terminated) { + return this.cloudFilestoreManagerStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts index 7490a56dd13..40da3dbaa7a 100644 --- a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts @@ -2301,9 +2301,8 @@ export class CloudFilestoreManagerClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.cloudFilestoreManagerStub!.then(stub => { + if (this.cloudFilestoreManagerStub && !this._terminated) { + return this.cloudFilestoreManagerStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts index 6e25f2891eb..578093cd2b1 100644 --- a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts +++ b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts @@ -189,13 +189,29 @@ describe('v1.CloudFilestoreManagerClient', () => { assert(client.cloudFilestoreManagerStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.cloudFilestoreManagerStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudFilestoreManagerStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -346,6 +362,23 @@ describe('v1.CloudFilestoreManagerClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getInstance with closed client', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getInstance(request), expectedError); + }); }); describe('getBackup', () => { @@ -457,6 +490,23 @@ describe('v1.CloudFilestoreManagerClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getBackup with closed client', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.GetBackupRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBackup(request), expectedError); + }); }); describe('createInstance', () => { diff --git a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts index 03bdd39b454..f24814baef4 100644 --- a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts +++ b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts @@ -191,13 +191,29 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { assert(client.cloudFilestoreManagerStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.cloudFilestoreManagerStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudFilestoreManagerStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -348,6 +364,23 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getInstance with closed client', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getInstance(request), expectedError); + }); }); describe('getBackup', () => { @@ -459,6 +492,23 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getBackup with closed client', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.GetBackupRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBackup(request), expectedError); + }); }); describe('createInstance', () => {