diff --git a/packages/google-container/samples/generated/v1/cluster_manager.cancel_operation.js b/packages/google-container/samples/generated/v1/cluster_manager.cancel_operation.js index f1a35c6b2d2..f4d133f07cf 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.cancel_operation.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.cancel_operation.js @@ -23,6 +23,9 @@ function main() { // [START container_v1_generated_ClusterManager_CancelOperation_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.complete_i_p_rotation.js b/packages/google-container/samples/generated/v1/cluster_manager.complete_i_p_rotation.js index 6af3f963a75..a5dd0501419 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.complete_i_p_rotation.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.complete_i_p_rotation.js @@ -23,6 +23,9 @@ function main() { // [START container_v1_generated_ClusterManager_CompleteIPRotation_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js b/packages/google-container/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js index c5a8e6048ed..d819a53952f 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js @@ -23,6 +23,9 @@ function main() { // [START container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.create_cluster.js b/packages/google-container/samples/generated/v1/cluster_manager.create_cluster.js index 204dcbbd744..4497e142a43 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.create_cluster.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.create_cluster.js @@ -23,6 +23,9 @@ function main(cluster) { // [START container_v1_generated_ClusterManager_CreateCluster_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.create_node_pool.js b/packages/google-container/samples/generated/v1/cluster_manager.create_node_pool.js index af60d05f377..caced3fee96 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.create_node_pool.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.create_node_pool.js @@ -23,6 +23,9 @@ function main(nodePool) { // [START container_v1_generated_ClusterManager_CreateNodePool_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.delete_cluster.js b/packages/google-container/samples/generated/v1/cluster_manager.delete_cluster.js index ba757276861..241e48a1afe 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.delete_cluster.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.delete_cluster.js @@ -23,6 +23,9 @@ function main() { // [START container_v1_generated_ClusterManager_DeleteCluster_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.delete_node_pool.js b/packages/google-container/samples/generated/v1/cluster_manager.delete_node_pool.js index ba697521c98..392cf2681d2 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.delete_node_pool.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.delete_node_pool.js @@ -23,6 +23,9 @@ function main() { // [START container_v1_generated_ClusterManager_DeleteNodePool_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.get_cluster.js b/packages/google-container/samples/generated/v1/cluster_manager.get_cluster.js index 89428f5e416..4d1bd19739f 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.get_cluster.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.get_cluster.js @@ -23,6 +23,9 @@ function main() { // [START container_v1_generated_ClusterManager_GetCluster_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js b/packages/google-container/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js index 0190e749d73..04144db2eba 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.get_j_s_o_n_web_keys.js @@ -23,6 +23,9 @@ function main() { // [START container_v1_generated_ClusterManager_GetJSONWebKeys_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.get_node_pool.js b/packages/google-container/samples/generated/v1/cluster_manager.get_node_pool.js index bcb0e231b20..8fbddbdc618 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.get_node_pool.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.get_node_pool.js @@ -23,6 +23,9 @@ function main() { // [START container_v1_generated_ClusterManager_GetNodePool_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.get_operation.js b/packages/google-container/samples/generated/v1/cluster_manager.get_operation.js index 5ef09a4a0c4..9c4b425aa37 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.get_operation.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.get_operation.js @@ -23,6 +23,9 @@ function main() { // [START container_v1_generated_ClusterManager_GetOperation_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.get_server_config.js b/packages/google-container/samples/generated/v1/cluster_manager.get_server_config.js index c21edceea12..1bf591ffe18 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.get_server_config.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.get_server_config.js @@ -23,6 +23,9 @@ function main() { // [START container_v1_generated_ClusterManager_GetServerConfig_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.list_clusters.js b/packages/google-container/samples/generated/v1/cluster_manager.list_clusters.js index d974e281bf5..aa6a4b116ee 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.list_clusters.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.list_clusters.js @@ -23,6 +23,9 @@ function main() { // [START container_v1_generated_ClusterManager_ListClusters_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.list_node_pools.js b/packages/google-container/samples/generated/v1/cluster_manager.list_node_pools.js index 14c853e65a8..3a234ce6769 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.list_node_pools.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.list_node_pools.js @@ -23,6 +23,9 @@ function main() { // [START container_v1_generated_ClusterManager_ListNodePools_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.list_operations.js b/packages/google-container/samples/generated/v1/cluster_manager.list_operations.js index 45191b1e293..911234d50a4 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.list_operations.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.list_operations.js @@ -23,6 +23,9 @@ function main() { // [START container_v1_generated_ClusterManager_ListOperations_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.list_usable_subnetworks.js b/packages/google-container/samples/generated/v1/cluster_manager.list_usable_subnetworks.js index 4ea47b2a8a7..d3d61966c05 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.list_usable_subnetworks.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.list_usable_subnetworks.js @@ -23,6 +23,9 @@ function main() { // [START container_v1_generated_ClusterManager_ListUsableSubnetworks_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js b/packages/google-container/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js index c866801e9e5..b237399dc2e 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.rollback_node_pool_upgrade.js @@ -23,6 +23,9 @@ function main() { // [START container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.set_addons_config.js b/packages/google-container/samples/generated/v1/cluster_manager.set_addons_config.js index dc570df0852..9ec41f77a84 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.set_addons_config.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.set_addons_config.js @@ -23,6 +23,9 @@ function main(addonsConfig) { // [START container_v1_generated_ClusterManager_SetAddonsConfig_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.set_labels.js b/packages/google-container/samples/generated/v1/cluster_manager.set_labels.js index b8a07a421ae..a8fc2deb528 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.set_labels.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.set_labels.js @@ -23,6 +23,9 @@ function main(resourceLabels, labelFingerprint) { // [START container_v1_generated_ClusterManager_SetLabels_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.set_legacy_abac.js b/packages/google-container/samples/generated/v1/cluster_manager.set_legacy_abac.js index 87bd53d3598..cebcea697fc 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.set_legacy_abac.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.set_legacy_abac.js @@ -23,6 +23,9 @@ function main(enabled) { // [START container_v1_generated_ClusterManager_SetLegacyAbac_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.set_locations.js b/packages/google-container/samples/generated/v1/cluster_manager.set_locations.js index d926bb734e5..6ecdfdd1b84 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.set_locations.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.set_locations.js @@ -23,6 +23,9 @@ function main(locations) { // [START container_v1_generated_ClusterManager_SetLocations_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.set_logging_service.js b/packages/google-container/samples/generated/v1/cluster_manager.set_logging_service.js index 2b120172b4a..79f232f8320 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.set_logging_service.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.set_logging_service.js @@ -23,6 +23,9 @@ function main(loggingService) { // [START container_v1_generated_ClusterManager_SetLoggingService_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.set_maintenance_policy.js b/packages/google-container/samples/generated/v1/cluster_manager.set_maintenance_policy.js index bfdf6b47c1e..d4a92ebcc63 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.set_maintenance_policy.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.set_maintenance_policy.js @@ -23,6 +23,9 @@ function main(projectId, zone, clusterId, maintenancePolicy) { // [START container_v1_generated_ClusterManager_SetMaintenancePolicy_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.set_master_auth.js b/packages/google-container/samples/generated/v1/cluster_manager.set_master_auth.js index 1fcac1fd012..be77fbda824 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.set_master_auth.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.set_master_auth.js @@ -23,6 +23,9 @@ function main(action, update) { // [START container_v1_generated_ClusterManager_SetMasterAuth_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.set_monitoring_service.js b/packages/google-container/samples/generated/v1/cluster_manager.set_monitoring_service.js index 783537d7788..ac0ed27e68a 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.set_monitoring_service.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.set_monitoring_service.js @@ -23,6 +23,9 @@ function main(monitoringService) { // [START container_v1_generated_ClusterManager_SetMonitoringService_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.set_network_policy.js b/packages/google-container/samples/generated/v1/cluster_manager.set_network_policy.js index 94e1e76cbd4..946e98c275e 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.set_network_policy.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.set_network_policy.js @@ -23,6 +23,9 @@ function main(networkPolicy) { // [START container_v1_generated_ClusterManager_SetNetworkPolicy_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js b/packages/google-container/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js index d5dbb41ac0d..a9b190926f5 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.set_node_pool_autoscaling.js @@ -23,6 +23,9 @@ function main(autoscaling) { // [START container_v1_generated_ClusterManager_SetNodePoolAutoscaling_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.set_node_pool_management.js b/packages/google-container/samples/generated/v1/cluster_manager.set_node_pool_management.js index b16dd65f1fd..ef03f3d6f49 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.set_node_pool_management.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.set_node_pool_management.js @@ -23,6 +23,9 @@ function main(management) { // [START container_v1_generated_ClusterManager_SetNodePoolManagement_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.set_node_pool_size.js b/packages/google-container/samples/generated/v1/cluster_manager.set_node_pool_size.js index c89962d79ac..8eea9f1e167 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.set_node_pool_size.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.set_node_pool_size.js @@ -23,6 +23,9 @@ function main(nodeCount) { // [START container_v1_generated_ClusterManager_SetNodePoolSize_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.start_i_p_rotation.js b/packages/google-container/samples/generated/v1/cluster_manager.start_i_p_rotation.js index 0a28f39f077..308c9fddb26 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.start_i_p_rotation.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.start_i_p_rotation.js @@ -23,6 +23,9 @@ function main() { // [START container_v1_generated_ClusterManager_StartIPRotation_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.update_cluster.js b/packages/google-container/samples/generated/v1/cluster_manager.update_cluster.js index a34c25bb90f..2e4a445dc0d 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.update_cluster.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.update_cluster.js @@ -23,6 +23,9 @@ function main(update) { // [START container_v1_generated_ClusterManager_UpdateCluster_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.update_master.js b/packages/google-container/samples/generated/v1/cluster_manager.update_master.js index b69ffcac22b..e3c26fb1e76 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.update_master.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.update_master.js @@ -23,6 +23,9 @@ function main(masterVersion) { // [START container_v1_generated_ClusterManager_UpdateMaster_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/cluster_manager.update_node_pool.js b/packages/google-container/samples/generated/v1/cluster_manager.update_node_pool.js index d86300583f9..3ae32ee4494 100644 --- a/packages/google-container/samples/generated/v1/cluster_manager.update_node_pool.js +++ b/packages/google-container/samples/generated/v1/cluster_manager.update_node_pool.js @@ -23,6 +23,9 @@ function main(nodeVersion, imageType) { // [START container_v1_generated_ClusterManager_UpdateNodePool_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json b/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json index 3a6607d3f09..daf3234692f 100644 --- a/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json +++ b/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -70,7 +70,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -122,7 +122,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -174,7 +174,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -230,7 +230,7 @@ "segments": [ { "start": 25, - "end": 128, + "end": 131, "type": "FULL" } ], @@ -342,7 +342,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -402,7 +402,7 @@ "segments": [ { "start": 25, - "end": 63, + "end": 66, "type": "FULL" } ], @@ -458,7 +458,7 @@ "segments": [ { "start": 25, - "end": 63, + "end": 66, "type": "FULL" } ], @@ -514,7 +514,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -570,7 +570,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 63, "type": "FULL" } ], @@ -626,7 +626,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -682,7 +682,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 63, "type": "FULL" } ], @@ -742,7 +742,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -794,7 +794,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -842,7 +842,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -894,7 +894,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -946,7 +946,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -994,7 +994,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -1034,7 +1034,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -1086,7 +1086,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -1142,7 +1142,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -1198,7 +1198,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -1254,7 +1254,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -1294,7 +1294,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -1354,7 +1354,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -1414,7 +1414,7 @@ "segments": [ { "start": 25, - "end": 65, + "end": 68, "type": "FULL" } ], @@ -1474,7 +1474,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -1530,7 +1530,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 57, "type": "FULL" } ], @@ -1586,7 +1586,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -1638,7 +1638,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -1698,7 +1698,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -1754,7 +1754,7 @@ "segments": [ { "start": 25, - "end": 75, + "end": 78, "type": "FULL" } ], @@ -1810,7 +1810,7 @@ "segments": [ { "start": 25, - "end": 71, + "end": 74, "type": "FULL" } ], diff --git a/packages/google-container/src/v1/cluster_manager_client.ts b/packages/google-container/src/v1/cluster_manager_client.ts index 034df697141..51a957b8d2e 100644 --- a/packages/google-container/src/v1/cluster_manager_client.ts +++ b/packages/google-container/src/v1/cluster_manager_client.ts @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -26,9 +26,7 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -37,7 +35,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './cluster_manager_client_config.json'; - const version = require('../../../package.json').version; /** @@ -96,8 +93,18 @@ export class ClusterManagerClient { * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ClusterManagerClient({fallback: 'rest'}, gax); + * ``` */ - constructor(opts?: ClientOptions) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof ClusterManagerClient; const servicePath = @@ -117,8 +124,13 @@ export class ClusterManagerClient { opts['scopes'] = staticMembers.scopes; } + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); @@ -183,7 +195,7 @@ export class ClusterManagerClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -272,7 +284,8 @@ export class ClusterManagerClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -423,7 +436,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', project_id: request.projectId || '', zone: request.zone || '', @@ -521,7 +534,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -633,7 +646,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', project_id: request.projectId || '', zone: request.zone || '', @@ -733,7 +746,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -885,7 +898,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -999,7 +1012,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -1117,7 +1130,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -1236,7 +1249,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -1338,7 +1351,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -1449,7 +1462,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -1564,7 +1577,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -1669,7 +1682,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -1776,7 +1789,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -1873,7 +1886,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', project_id: request.projectId || '', zone: request.zone || '', @@ -1971,7 +1984,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -2070,7 +2083,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -2166,7 +2179,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -2255,7 +2268,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -2351,7 +2364,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', project_id: request.projectId || '', zone: request.zone || '', @@ -2454,7 +2467,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -2557,7 +2570,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', project_id: request.projectId || '', zone: request.zone || '', @@ -2660,7 +2673,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -2758,7 +2771,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -2874,7 +2887,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -2992,7 +3005,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -3101,7 +3114,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -3202,7 +3215,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -3303,7 +3316,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -3404,7 +3417,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -3511,7 +3524,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -3615,7 +3628,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -3723,7 +3736,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', project_id: request.projectId || '', zone: request.zone || '', @@ -3835,7 +3848,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -3883,14 +3896,14 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listUsableSubnetworks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listUsableSubnetworks.createStream( - this.innerApiCalls.listUsableSubnetworks as gax.GaxCall, + this.innerApiCalls.listUsableSubnetworks as GaxCall, request, callSettings ); @@ -3940,7 +3953,7 @@ export class ClusterManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listUsableSubnetworks']; @@ -3948,7 +3961,7 @@ export class ClusterManagerClient { this.initialize(); return this.descriptors.page.listUsableSubnetworks.asyncIterate( this.innerApiCalls['listUsableSubnetworks'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-container/test/gapic_cluster_manager_v1.ts b/packages/google-container/test/gapic_cluster_manager_v1.ts index 225d6564021..8768b6f9c93 100644 --- a/packages/google-container/test/gapic_cluster_manager_v1.ts +++ b/packages/google-container/test/gapic_cluster_manager_v1.ts @@ -113,101 +113,103 @@ function stubAsyncIterationCall( } describe('v1.ClusterManagerClient', () => { - it('has servicePath', () => { - const servicePath = - clustermanagerModule.v1.ClusterManagerClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - clustermanagerModule.v1.ClusterManagerClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = clustermanagerModule.v1.ClusterManagerClient.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + clustermanagerModule.v1.ClusterManagerClient.servicePath; + assert(servicePath); + }); - it('should create a client with no option', () => { - const client = new clustermanagerModule.v1.ClusterManagerClient(); - assert(client); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + clustermanagerModule.v1.ClusterManagerClient.apiEndpoint; + assert(apiEndpoint); + }); - it('should create a client with gRPC fallback', () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - fallback: true, + it('has port', () => { + const port = clustermanagerModule.v1.ClusterManagerClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new clustermanagerModule.v1.ClusterManagerClient(); + assert(client); }); - assert.strictEqual(client.clusterManagerStub, undefined); - await client.initialize(); - assert(client.clusterManagerStub); - }); - it('has close method for the initialized client', done => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with gRPC fallback', () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + fallback: true, + }); + assert(client); }); - client.initialize(); - assert(client.clusterManagerStub); - client.close().then(() => { - done(); + + it('has initialize method and supports deferred initialization', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.clusterManagerStub, undefined); + await client.initialize(); + assert(client.clusterManagerStub); }); - }); - it('has close method for the non-initialized client', done => { - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.clusterManagerStub); + client.close().then(() => { + done(); + }); }); - assert.strictEqual(client.clusterManagerStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the non-initialized client', done => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.clusterManagerStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new clustermanagerModule.v1.ClusterManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('listClusters', () => {