From 9846dceb1bd9cb2abf98274eacfaa5a72f771e27 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:04:51 +0000 Subject: [PATCH] docs(samples): include metadata file, add exclusions for samples to handwritten libraries (#116) - [ ] 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 --- .../generated/v1/hub_service.create_hub.js | 9 +- .../generated/v1/hub_service.create_spoke.js | 9 +- .../generated/v1/hub_service.delete_hub.js | 9 +- .../generated/v1/hub_service.delete_spoke.js | 9 +- .../generated/v1/hub_service.get_hub.js | 9 +- .../generated/v1/hub_service.get_spoke.js | 9 +- .../generated/v1/hub_service.list_hubs.js | 9 +- .../generated/v1/hub_service.list_spokes.js | 9 +- .../generated/v1/hub_service.update_hub.js | 9 +- .../generated/v1/hub_service.update_spoke.js | 9 +- ...a.google.cloud.networkconnectivity.v1.json | 495 ++++++++++++++++++ .../v1alpha1/hub_service.create_hub.js | 9 +- .../v1alpha1/hub_service.create_spoke.js | 9 +- .../v1alpha1/hub_service.delete_hub.js | 9 +- .../v1alpha1/hub_service.delete_spoke.js | 9 +- .../generated/v1alpha1/hub_service.get_hub.js | 9 +- .../v1alpha1/hub_service.get_spoke.js | 9 +- .../v1alpha1/hub_service.list_hubs.js | 9 +- .../v1alpha1/hub_service.list_spokes.js | 9 +- .../v1alpha1/hub_service.update_hub.js | 9 +- .../v1alpha1/hub_service.update_spoke.js | 9 +- ...le.cloud.networkconnectivity.v1alpha1.json | 495 ++++++++++++++++++ .../src/v1/hub_service_client.ts | 5 +- .../src/v1alpha1/hub_service_client.ts | 5 +- .../test/gapic_hub_service_v1.ts | 51 +- .../test/gapic_hub_service_v1alpha1.ts | 51 +- 26 files changed, 1232 insertions(+), 50 deletions(-) create mode 100644 packages/google-cloud-networkconnectivity/samples/generated/v1/snippet_metadata.google.cloud.networkconnectivity.v1.json create mode 100644 packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/snippet_metadata.google.cloud.networkconnectivity.v1alpha1.json diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.create_hub.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.create_hub.js index bbad937bdc1..f440f267410 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.create_hub.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.create_hub.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-networkconnectivity/samples/generated/v1/hub_service.create_spoke.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.create_spoke.js index a3a45f79aa6..bca54f0234f 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.create_spoke.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.create_spoke.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-networkconnectivity/samples/generated/v1/hub_service.delete_hub.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.delete_hub.js index 7c616cb9e53..19f719d839c 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.delete_hub.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.delete_hub.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-networkconnectivity/samples/generated/v1/hub_service.delete_spoke.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.delete_spoke.js index 098b0537488..890770428b3 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.delete_spoke.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.delete_spoke.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-networkconnectivity/samples/generated/v1/hub_service.get_hub.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_hub.js index 7969069de5b..151b0677813 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_hub.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_hub.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-networkconnectivity/samples/generated/v1/hub_service.get_spoke.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_spoke.js index b4726cc24e5..ac9951b0442 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_spoke.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_spoke.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-networkconnectivity/samples/generated/v1/hub_service.list_hubs.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_hubs.js index 7468a1f288b..24e96921038 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_hubs.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_hubs.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-networkconnectivity/samples/generated/v1/hub_service.list_spokes.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_spokes.js index fa8a0f4714d..8d6426ff24c 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_spokes.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_spokes.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-networkconnectivity/samples/generated/v1/hub_service.update_hub.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.update_hub.js index 7574c75a88e..d6bc74e4250 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.update_hub.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.update_hub.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-networkconnectivity/samples/generated/v1/hub_service.update_spoke.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.update_spoke.js index 904fa6d4c67..4f4157627e9 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.update_spoke.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.update_spoke.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-networkconnectivity/samples/generated/v1/snippet_metadata.google.cloud.networkconnectivity.v1.json b/packages/google-cloud-networkconnectivity/samples/generated/v1/snippet_metadata.google.cloud.networkconnectivity.v1.json new file mode 100644 index 00000000000..e70014de08b --- /dev/null +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/snippet_metadata.google.cloud.networkconnectivity.v1.json @@ -0,0 +1,495 @@ +{ + "clientLibrary": { + "name": "nodejs-networkconnectivity", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.networkconnectivity.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "networkconnectivity_v1_generated_HubService_ListHubs_async", + "title": "HubService listHubs Sample", + "origin": "API_DEFINITION", + "description": " Lists hubs in a given project.", + "canonical": true, + "file": "hub_service.list_hubs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListHubs", + "fullName": "google.cloud.networkconnectivity.v1.HubService.ListHubs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkconnectivity.v1.ListHubsResponse", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "ListHubs", + "fullName": "google.cloud.networkconnectivity.v1.HubService.ListHubs", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1_generated_HubService_GetHub_async", + "title": "HubService getHub Sample", + "origin": "API_DEFINITION", + "description": " Gets details about the specified hub.", + "canonical": true, + "file": "hub_service.get_hub.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetHub", + "fullName": "google.cloud.networkconnectivity.v1.HubService.GetHub", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkconnectivity.v1.Hub", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "GetHub", + "fullName": "google.cloud.networkconnectivity.v1.HubService.GetHub", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1_generated_HubService_CreateHub_async", + "title": "HubService createHub Sample", + "origin": "API_DEFINITION", + "description": " Creates a new hub in the specified project.", + "canonical": true, + "file": "hub_service.create_hub.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateHub", + "fullName": "google.cloud.networkconnectivity.v1.HubService.CreateHub", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "hub_id", + "type": "TYPE_STRING" + }, + { + "name": "hub", + "type": ".google.cloud.networkconnectivity.v1.Hub" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "CreateHub", + "fullName": "google.cloud.networkconnectivity.v1.HubService.CreateHub", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1_generated_HubService_UpdateHub_async", + "title": "HubService updateHub Sample", + "origin": "API_DEFINITION", + "description": " Updates the description and/or labels of the specified hub.", + "canonical": true, + "file": "hub_service.update_hub.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateHub", + "fullName": "google.cloud.networkconnectivity.v1.HubService.UpdateHub", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "hub", + "type": ".google.cloud.networkconnectivity.v1.Hub" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "UpdateHub", + "fullName": "google.cloud.networkconnectivity.v1.HubService.UpdateHub", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1_generated_HubService_DeleteHub_async", + "title": "HubService deleteHub Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified hub.", + "canonical": true, + "file": "hub_service.delete_hub.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteHub", + "fullName": "google.cloud.networkconnectivity.v1.HubService.DeleteHub", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "DeleteHub", + "fullName": "google.cloud.networkconnectivity.v1.HubService.DeleteHub", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1_generated_HubService_ListSpokes_async", + "title": "HubService listSpokes Sample", + "origin": "API_DEFINITION", + "description": " Lists the spokes in the specified project and location.", + "canonical": true, + "file": "hub_service.list_spokes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSpokes", + "fullName": "google.cloud.networkconnectivity.v1.HubService.ListSpokes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkconnectivity.v1.ListSpokesResponse", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "ListSpokes", + "fullName": "google.cloud.networkconnectivity.v1.HubService.ListSpokes", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1_generated_HubService_GetSpoke_async", + "title": "HubService getSpoke Sample", + "origin": "API_DEFINITION", + "description": " Gets details about the specified spoke.", + "canonical": true, + "file": "hub_service.get_spoke.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSpoke", + "fullName": "google.cloud.networkconnectivity.v1.HubService.GetSpoke", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkconnectivity.v1.Spoke", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "GetSpoke", + "fullName": "google.cloud.networkconnectivity.v1.HubService.GetSpoke", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1_generated_HubService_CreateSpoke_async", + "title": "HubService createSpoke Sample", + "origin": "API_DEFINITION", + "description": " Creates a spoke in the specified project and location.", + "canonical": true, + "file": "hub_service.create_spoke.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSpoke", + "fullName": "google.cloud.networkconnectivity.v1.HubService.CreateSpoke", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "spoke_id", + "type": "TYPE_STRING" + }, + { + "name": "spoke", + "type": ".google.cloud.networkconnectivity.v1.Spoke" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "CreateSpoke", + "fullName": "google.cloud.networkconnectivity.v1.HubService.CreateSpoke", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1_generated_HubService_UpdateSpoke_async", + "title": "HubService updateSpoke Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of the specified spoke.", + "canonical": true, + "file": "hub_service.update_spoke.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSpoke", + "fullName": "google.cloud.networkconnectivity.v1.HubService.UpdateSpoke", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "spoke", + "type": ".google.cloud.networkconnectivity.v1.Spoke" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "UpdateSpoke", + "fullName": "google.cloud.networkconnectivity.v1.HubService.UpdateSpoke", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1_generated_HubService_DeleteSpoke_async", + "title": "HubService deleteSpoke Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified spoke.", + "canonical": true, + "file": "hub_service.delete_spoke.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSpoke", + "fullName": "google.cloud.networkconnectivity.v1.HubService.DeleteSpoke", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "DeleteSpoke", + "fullName": "google.cloud.networkconnectivity.v1.HubService.DeleteSpoke", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + } + ] +} diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.create_hub.js b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.create_hub.js index 6da99be4815..7851233fb26 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.create_hub.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.create_hub.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-networkconnectivity/samples/generated/v1alpha1/hub_service.create_spoke.js b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.create_spoke.js index 054e3914086..259a0332e67 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.create_spoke.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.create_spoke.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-networkconnectivity/samples/generated/v1alpha1/hub_service.delete_hub.js b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.delete_hub.js index f1984e00bde..934adfe5fa3 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.delete_hub.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.delete_hub.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-networkconnectivity/samples/generated/v1alpha1/hub_service.delete_spoke.js b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.delete_spoke.js index 925f6ad6c3d..8e08b130bc9 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.delete_spoke.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.delete_spoke.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-networkconnectivity/samples/generated/v1alpha1/hub_service.get_hub.js b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.get_hub.js index 1ce6b80667f..c5f1181841f 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.get_hub.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.get_hub.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-networkconnectivity/samples/generated/v1alpha1/hub_service.get_spoke.js b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.get_spoke.js index 514b5c5a6da..47ce4c75751 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.get_spoke.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.get_spoke.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-networkconnectivity/samples/generated/v1alpha1/hub_service.list_hubs.js b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.list_hubs.js index 892304fd6be..f997316bc33 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.list_hubs.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.list_hubs.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-networkconnectivity/samples/generated/v1alpha1/hub_service.list_spokes.js b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.list_spokes.js index 2c6074d83f9..64eabec0705 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.list_spokes.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.list_spokes.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-networkconnectivity/samples/generated/v1alpha1/hub_service.update_hub.js b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.update_hub.js index 1a10cd196c7..e69b800557c 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.update_hub.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.update_hub.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-networkconnectivity/samples/generated/v1alpha1/hub_service.update_spoke.js b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.update_spoke.js index 20ed1a58388..69c5bbb34d6 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.update_spoke.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/hub_service.update_spoke.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-networkconnectivity/samples/generated/v1alpha1/snippet_metadata.google.cloud.networkconnectivity.v1alpha1.json b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/snippet_metadata.google.cloud.networkconnectivity.v1alpha1.json new file mode 100644 index 00000000000..c32374240b0 --- /dev/null +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/snippet_metadata.google.cloud.networkconnectivity.v1alpha1.json @@ -0,0 +1,495 @@ +{ + "clientLibrary": { + "name": "nodejs-networkconnectivity", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.networkconnectivity.v1alpha1", + "version": "v1alpha1" + } + ] + }, + "snippets": [ + { + "regionTag": "networkconnectivity_v1alpha1_generated_HubService_ListHubs_async", + "title": "HubService listHubs Sample", + "origin": "API_DEFINITION", + "description": " Lists Hubs in a given project and location.", + "canonical": true, + "file": "hub_service.list_hubs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListHubs", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.ListHubs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkconnectivity.v1alpha1.ListHubsResponse", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubServiceClient" + }, + "method": { + "shortName": "ListHubs", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.ListHubs", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1alpha1_generated_HubService_GetHub_async", + "title": "HubService getHub Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Hub.", + "canonical": true, + "file": "hub_service.get_hub.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetHub", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.GetHub", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkconnectivity.v1alpha1.Hub", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubServiceClient" + }, + "method": { + "shortName": "GetHub", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.GetHub", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1alpha1_generated_HubService_CreateHub_async", + "title": "HubService createHub Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Hub in a given project and location.", + "canonical": true, + "file": "hub_service.create_hub.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateHub", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.CreateHub", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "hub_id", + "type": "TYPE_STRING" + }, + { + "name": "hub", + "type": ".google.cloud.networkconnectivity.v1alpha1.Hub" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubServiceClient" + }, + "method": { + "shortName": "CreateHub", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.CreateHub", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1alpha1_generated_HubService_UpdateHub_async", + "title": "HubService updateHub Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Hub.", + "canonical": true, + "file": "hub_service.update_hub.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateHub", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.UpdateHub", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "hub", + "type": ".google.cloud.networkconnectivity.v1alpha1.Hub" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubServiceClient" + }, + "method": { + "shortName": "UpdateHub", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.UpdateHub", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1alpha1_generated_HubService_DeleteHub_async", + "title": "HubService deleteHub Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Hub.", + "canonical": true, + "file": "hub_service.delete_hub.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteHub", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.DeleteHub", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubServiceClient" + }, + "method": { + "shortName": "DeleteHub", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.DeleteHub", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1alpha1_generated_HubService_ListSpokes_async", + "title": "HubService listSpokes Sample", + "origin": "API_DEFINITION", + "description": " Lists Spokes in a given project and location.", + "canonical": true, + "file": "hub_service.list_spokes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSpokes", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.ListSpokes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubServiceClient" + }, + "method": { + "shortName": "ListSpokes", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.ListSpokes", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1alpha1_generated_HubService_GetSpoke_async", + "title": "HubService getSpoke Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Spoke.", + "canonical": true, + "file": "hub_service.get_spoke.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSpoke", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.GetSpoke", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkconnectivity.v1alpha1.Spoke", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubServiceClient" + }, + "method": { + "shortName": "GetSpoke", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.GetSpoke", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1alpha1_generated_HubService_CreateSpoke_async", + "title": "HubService createSpoke Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Spoke in a given project and location.", + "canonical": true, + "file": "hub_service.create_spoke.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSpoke", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.CreateSpoke", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "spoke_id", + "type": "TYPE_STRING" + }, + { + "name": "spoke", + "type": ".google.cloud.networkconnectivity.v1alpha1.Spoke" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubServiceClient" + }, + "method": { + "shortName": "CreateSpoke", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.CreateSpoke", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1alpha1_generated_HubService_UpdateSpoke_async", + "title": "HubService updateSpoke Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Spoke.", + "canonical": true, + "file": "hub_service.update_spoke.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSpoke", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.UpdateSpoke", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "spoke", + "type": ".google.cloud.networkconnectivity.v1alpha1.Spoke" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubServiceClient" + }, + "method": { + "shortName": "UpdateSpoke", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.UpdateSpoke", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1alpha1_generated_HubService_DeleteSpoke_async", + "title": "HubService deleteSpoke Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Spoke.", + "canonical": true, + "file": "hub_service.delete_spoke.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSpoke", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.DeleteSpoke", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubServiceClient" + }, + "method": { + "shortName": "DeleteSpoke", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService.DeleteSpoke", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1alpha1.HubService" + } + } + } + } + ] +} diff --git a/packages/google-cloud-networkconnectivity/src/v1/hub_service_client.ts b/packages/google-cloud-networkconnectivity/src/v1/hub_service_client.ts index 2412743d37a..d775b11d410 100644 --- a/packages/google-cloud-networkconnectivity/src/v1/hub_service_client.ts +++ b/packages/google-cloud-networkconnectivity/src/v1/hub_service_client.ts @@ -2285,9 +2285,8 @@ export class HubServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.hubServiceStub!.then(stub => { + if (this.hubServiceStub && !this._terminated) { + return this.hubServiceStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-networkconnectivity/src/v1alpha1/hub_service_client.ts b/packages/google-cloud-networkconnectivity/src/v1alpha1/hub_service_client.ts index 759e1614008..2e6689e0ea9 100644 --- a/packages/google-cloud-networkconnectivity/src/v1alpha1/hub_service_client.ts +++ b/packages/google-cloud-networkconnectivity/src/v1alpha1/hub_service_client.ts @@ -2253,9 +2253,8 @@ export class HubServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.hubServiceStub!.then(stub => { + if (this.hubServiceStub && !this._terminated) { + return this.hubServiceStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-networkconnectivity/test/gapic_hub_service_v1.ts b/packages/google-cloud-networkconnectivity/test/gapic_hub_service_v1.ts index efc507ef317..e65d1dad912 100644 --- a/packages/google-cloud-networkconnectivity/test/gapic_hub_service_v1.ts +++ b/packages/google-cloud-networkconnectivity/test/gapic_hub_service_v1.ts @@ -183,12 +183,27 @@ describe('v1.HubServiceClient', () => { assert(client.hubServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.hubServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.hubServiceStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -331,6 +346,22 @@ describe('v1.HubServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getHub with closed client', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.GetHubRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getHub(request), expectedError); + }); }); describe('getSpoke', () => { @@ -439,6 +470,22 @@ describe('v1.HubServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getSpoke with closed client', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.GetSpokeRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSpoke(request), expectedError); + }); }); describe('createHub', () => { diff --git a/packages/google-cloud-networkconnectivity/test/gapic_hub_service_v1alpha1.ts b/packages/google-cloud-networkconnectivity/test/gapic_hub_service_v1alpha1.ts index efbf6e7726a..ed5dcb9d7fa 100644 --- a/packages/google-cloud-networkconnectivity/test/gapic_hub_service_v1alpha1.ts +++ b/packages/google-cloud-networkconnectivity/test/gapic_hub_service_v1alpha1.ts @@ -183,12 +183,27 @@ describe('v1alpha1.HubServiceClient', () => { assert(client.hubServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new hubserviceModule.v1alpha1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.hubServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new hubserviceModule.v1alpha1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.hubServiceStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -331,6 +346,22 @@ describe('v1alpha1.HubServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getHub with closed client', async () => { + const client = new hubserviceModule.v1alpha1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1alpha1.GetHubRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getHub(request), expectedError); + }); }); describe('getSpoke', () => { @@ -439,6 +470,22 @@ describe('v1alpha1.HubServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getSpoke with closed client', async () => { + const client = new hubserviceModule.v1alpha1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1alpha1.GetSpokeRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSpoke(request), expectedError); + }); }); describe('createHub', () => {