diff --git a/samples/generated/v2/config_service_v2.copy_log_entries.js b/samples/generated/v2/config_service_v2.copy_log_entries.js index b942f56e..80fb4788 100644 --- a/samples/generated/v2/config_service_v2.copy_log_entries.js +++ b/samples/generated/v2/config_service_v2.copy_log_entries.js @@ -21,6 +21,9 @@ function main(name, destination) { // [START logging_v2_generated_ConfigServiceV2_CopyLogEntries_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/samples/generated/v2/config_service_v2.create_bucket.js b/samples/generated/v2/config_service_v2.create_bucket.js index 329b6140..83ef09ed 100644 --- a/samples/generated/v2/config_service_v2.create_bucket.js +++ b/samples/generated/v2/config_service_v2.create_bucket.js @@ -21,6 +21,9 @@ function main(parent, bucketId, bucket) { // [START logging_v2_generated_ConfigServiceV2_CreateBucket_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/samples/generated/v2/config_service_v2.create_exclusion.js b/samples/generated/v2/config_service_v2.create_exclusion.js index 45d26b63..a78f3cd1 100644 --- a/samples/generated/v2/config_service_v2.create_exclusion.js +++ b/samples/generated/v2/config_service_v2.create_exclusion.js @@ -21,6 +21,9 @@ function main(parent, exclusion) { // [START logging_v2_generated_ConfigServiceV2_CreateExclusion_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/samples/generated/v2/config_service_v2.create_sink.js b/samples/generated/v2/config_service_v2.create_sink.js index 34ddc52c..f9c38b6b 100644 --- a/samples/generated/v2/config_service_v2.create_sink.js +++ b/samples/generated/v2/config_service_v2.create_sink.js @@ -21,6 +21,9 @@ function main(parent, sink) { // [START logging_v2_generated_ConfigServiceV2_CreateSink_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/samples/generated/v2/config_service_v2.create_view.js b/samples/generated/v2/config_service_v2.create_view.js index 3cbb9e67..b1a65978 100644 --- a/samples/generated/v2/config_service_v2.create_view.js +++ b/samples/generated/v2/config_service_v2.create_view.js @@ -21,6 +21,9 @@ function main(parent, viewId, view) { // [START logging_v2_generated_ConfigServiceV2_CreateView_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/samples/generated/v2/config_service_v2.delete_bucket.js b/samples/generated/v2/config_service_v2.delete_bucket.js index 1fbb4654..99a667a0 100644 --- a/samples/generated/v2/config_service_v2.delete_bucket.js +++ b/samples/generated/v2/config_service_v2.delete_bucket.js @@ -21,6 +21,9 @@ function main(name) { // [START logging_v2_generated_ConfigServiceV2_DeleteBucket_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/samples/generated/v2/config_service_v2.delete_exclusion.js b/samples/generated/v2/config_service_v2.delete_exclusion.js index ccfcfb2f..8a3aa7d9 100644 --- a/samples/generated/v2/config_service_v2.delete_exclusion.js +++ b/samples/generated/v2/config_service_v2.delete_exclusion.js @@ -21,6 +21,9 @@ function main(name) { // [START logging_v2_generated_ConfigServiceV2_DeleteExclusion_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/samples/generated/v2/config_service_v2.delete_sink.js b/samples/generated/v2/config_service_v2.delete_sink.js index 553c9f6f..c4f92bfb 100644 --- a/samples/generated/v2/config_service_v2.delete_sink.js +++ b/samples/generated/v2/config_service_v2.delete_sink.js @@ -21,6 +21,9 @@ function main(sinkName) { // [START logging_v2_generated_ConfigServiceV2_DeleteSink_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/samples/generated/v2/config_service_v2.delete_view.js b/samples/generated/v2/config_service_v2.delete_view.js index ccd8288b..3a82d5f9 100644 --- a/samples/generated/v2/config_service_v2.delete_view.js +++ b/samples/generated/v2/config_service_v2.delete_view.js @@ -21,6 +21,9 @@ function main(name) { // [START logging_v2_generated_ConfigServiceV2_DeleteView_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/samples/generated/v2/config_service_v2.get_bucket.js b/samples/generated/v2/config_service_v2.get_bucket.js index 8c72bce8..da62aa90 100644 --- a/samples/generated/v2/config_service_v2.get_bucket.js +++ b/samples/generated/v2/config_service_v2.get_bucket.js @@ -21,6 +21,9 @@ function main(name) { // [START logging_v2_generated_ConfigServiceV2_GetBucket_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/samples/generated/v2/config_service_v2.get_cmek_settings.js b/samples/generated/v2/config_service_v2.get_cmek_settings.js index adc9542b..c42efa79 100644 --- a/samples/generated/v2/config_service_v2.get_cmek_settings.js +++ b/samples/generated/v2/config_service_v2.get_cmek_settings.js @@ -21,6 +21,9 @@ function main(name) { // [START logging_v2_generated_ConfigServiceV2_GetCmekSettings_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/samples/generated/v2/config_service_v2.get_exclusion.js b/samples/generated/v2/config_service_v2.get_exclusion.js index 180245ca..bd036636 100644 --- a/samples/generated/v2/config_service_v2.get_exclusion.js +++ b/samples/generated/v2/config_service_v2.get_exclusion.js @@ -21,6 +21,9 @@ function main(name) { // [START logging_v2_generated_ConfigServiceV2_GetExclusion_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/samples/generated/v2/config_service_v2.get_settings.js b/samples/generated/v2/config_service_v2.get_settings.js index 184aeb49..ee772fe1 100644 --- a/samples/generated/v2/config_service_v2.get_settings.js +++ b/samples/generated/v2/config_service_v2.get_settings.js @@ -21,6 +21,9 @@ function main(name) { // [START logging_v2_generated_ConfigServiceV2_GetSettings_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/samples/generated/v2/config_service_v2.get_sink.js b/samples/generated/v2/config_service_v2.get_sink.js index 9f9a0d3d..d4e31e95 100644 --- a/samples/generated/v2/config_service_v2.get_sink.js +++ b/samples/generated/v2/config_service_v2.get_sink.js @@ -21,6 +21,9 @@ function main(sinkName) { // [START logging_v2_generated_ConfigServiceV2_GetSink_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/samples/generated/v2/config_service_v2.get_view.js b/samples/generated/v2/config_service_v2.get_view.js index 4ad0fc4a..7a736f6c 100644 --- a/samples/generated/v2/config_service_v2.get_view.js +++ b/samples/generated/v2/config_service_v2.get_view.js @@ -21,6 +21,9 @@ function main(name) { // [START logging_v2_generated_ConfigServiceV2_GetView_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/samples/generated/v2/config_service_v2.list_buckets.js b/samples/generated/v2/config_service_v2.list_buckets.js index 8a7a7390..d882c8ef 100644 --- a/samples/generated/v2/config_service_v2.list_buckets.js +++ b/samples/generated/v2/config_service_v2.list_buckets.js @@ -21,6 +21,9 @@ function main(parent) { // [START logging_v2_generated_ConfigServiceV2_ListBuckets_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/samples/generated/v2/config_service_v2.list_exclusions.js b/samples/generated/v2/config_service_v2.list_exclusions.js index 939385d7..13af69cb 100644 --- a/samples/generated/v2/config_service_v2.list_exclusions.js +++ b/samples/generated/v2/config_service_v2.list_exclusions.js @@ -21,6 +21,9 @@ function main(parent) { // [START logging_v2_generated_ConfigServiceV2_ListExclusions_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/samples/generated/v2/config_service_v2.list_sinks.js b/samples/generated/v2/config_service_v2.list_sinks.js index 25424f3e..529cc02c 100644 --- a/samples/generated/v2/config_service_v2.list_sinks.js +++ b/samples/generated/v2/config_service_v2.list_sinks.js @@ -21,6 +21,9 @@ function main(parent) { // [START logging_v2_generated_ConfigServiceV2_ListSinks_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/samples/generated/v2/config_service_v2.list_views.js b/samples/generated/v2/config_service_v2.list_views.js index 3fa4f9ce..5a329081 100644 --- a/samples/generated/v2/config_service_v2.list_views.js +++ b/samples/generated/v2/config_service_v2.list_views.js @@ -21,6 +21,9 @@ function main(parent) { // [START logging_v2_generated_ConfigServiceV2_ListViews_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/samples/generated/v2/config_service_v2.undelete_bucket.js b/samples/generated/v2/config_service_v2.undelete_bucket.js index 30a6935c..f49964da 100644 --- a/samples/generated/v2/config_service_v2.undelete_bucket.js +++ b/samples/generated/v2/config_service_v2.undelete_bucket.js @@ -21,6 +21,9 @@ function main(name) { // [START logging_v2_generated_ConfigServiceV2_UndeleteBucket_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/samples/generated/v2/config_service_v2.update_bucket.js b/samples/generated/v2/config_service_v2.update_bucket.js index 31222974..a768e294 100644 --- a/samples/generated/v2/config_service_v2.update_bucket.js +++ b/samples/generated/v2/config_service_v2.update_bucket.js @@ -21,6 +21,9 @@ function main(name, bucket, updateMask) { // [START logging_v2_generated_ConfigServiceV2_UpdateBucket_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/samples/generated/v2/config_service_v2.update_cmek_settings.js b/samples/generated/v2/config_service_v2.update_cmek_settings.js index a2fb3356..afc43031 100644 --- a/samples/generated/v2/config_service_v2.update_cmek_settings.js +++ b/samples/generated/v2/config_service_v2.update_cmek_settings.js @@ -21,6 +21,9 @@ function main(name, cmekSettings) { // [START logging_v2_generated_ConfigServiceV2_UpdateCmekSettings_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/samples/generated/v2/config_service_v2.update_exclusion.js b/samples/generated/v2/config_service_v2.update_exclusion.js index 0bef0516..70c07f2b 100644 --- a/samples/generated/v2/config_service_v2.update_exclusion.js +++ b/samples/generated/v2/config_service_v2.update_exclusion.js @@ -21,6 +21,9 @@ function main(name, exclusion, updateMask) { // [START logging_v2_generated_ConfigServiceV2_UpdateExclusion_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/samples/generated/v2/config_service_v2.update_settings.js b/samples/generated/v2/config_service_v2.update_settings.js index cfbdb18e..b5f9a9dc 100644 --- a/samples/generated/v2/config_service_v2.update_settings.js +++ b/samples/generated/v2/config_service_v2.update_settings.js @@ -21,6 +21,9 @@ function main(name, settings) { // [START logging_v2_generated_ConfigServiceV2_UpdateSettings_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/samples/generated/v2/config_service_v2.update_sink.js b/samples/generated/v2/config_service_v2.update_sink.js index 9132584d..dbb4b8eb 100644 --- a/samples/generated/v2/config_service_v2.update_sink.js +++ b/samples/generated/v2/config_service_v2.update_sink.js @@ -21,6 +21,9 @@ function main(sinkName, sink) { // [START logging_v2_generated_ConfigServiceV2_UpdateSink_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/samples/generated/v2/config_service_v2.update_view.js b/samples/generated/v2/config_service_v2.update_view.js index 2f98c824..efcf7cd2 100644 --- a/samples/generated/v2/config_service_v2.update_view.js +++ b/samples/generated/v2/config_service_v2.update_view.js @@ -21,6 +21,9 @@ function main(name, view) { // [START logging_v2_generated_ConfigServiceV2_UpdateView_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/samples/generated/v2/logging_service_v2.delete_log.js b/samples/generated/v2/logging_service_v2.delete_log.js index 99bc7875..94e351fd 100644 --- a/samples/generated/v2/logging_service_v2.delete_log.js +++ b/samples/generated/v2/logging_service_v2.delete_log.js @@ -21,6 +21,9 @@ function main(logName) { // [START logging_v2_generated_LoggingServiceV2_DeleteLog_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/samples/generated/v2/logging_service_v2.list_log_entries.js b/samples/generated/v2/logging_service_v2.list_log_entries.js index f0992952..d958d6f9 100644 --- a/samples/generated/v2/logging_service_v2.list_log_entries.js +++ b/samples/generated/v2/logging_service_v2.list_log_entries.js @@ -21,6 +21,9 @@ function main(resourceNames) { // [START logging_v2_generated_LoggingServiceV2_ListLogEntries_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/samples/generated/v2/logging_service_v2.list_logs.js b/samples/generated/v2/logging_service_v2.list_logs.js index ed0d28a1..aafc050a 100644 --- a/samples/generated/v2/logging_service_v2.list_logs.js +++ b/samples/generated/v2/logging_service_v2.list_logs.js @@ -21,6 +21,9 @@ function main(parent) { // [START logging_v2_generated_LoggingServiceV2_ListLogs_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/samples/generated/v2/logging_service_v2.list_monitored_resource_descriptors.js b/samples/generated/v2/logging_service_v2.list_monitored_resource_descriptors.js index 71e2931b..026e736e 100644 --- a/samples/generated/v2/logging_service_v2.list_monitored_resource_descriptors.js +++ b/samples/generated/v2/logging_service_v2.list_monitored_resource_descriptors.js @@ -21,6 +21,9 @@ function main() { // [START logging_v2_generated_LoggingServiceV2_ListMonitoredResourceDescriptors_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/samples/generated/v2/logging_service_v2.tail_log_entries.js b/samples/generated/v2/logging_service_v2.tail_log_entries.js index 6f0146e4..4b115b06 100644 --- a/samples/generated/v2/logging_service_v2.tail_log_entries.js +++ b/samples/generated/v2/logging_service_v2.tail_log_entries.js @@ -21,6 +21,9 @@ function main(resourceNames) { // [START logging_v2_generated_LoggingServiceV2_TailLogEntries_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/samples/generated/v2/logging_service_v2.write_log_entries.js b/samples/generated/v2/logging_service_v2.write_log_entries.js index b3e7e59c..cfa5d2aa 100644 --- a/samples/generated/v2/logging_service_v2.write_log_entries.js +++ b/samples/generated/v2/logging_service_v2.write_log_entries.js @@ -21,6 +21,9 @@ function main(entries) { // [START logging_v2_generated_LoggingServiceV2_WriteLogEntries_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/samples/generated/v2/metrics_service_v2.create_log_metric.js b/samples/generated/v2/metrics_service_v2.create_log_metric.js index 32a4f35f..7b38bfc8 100644 --- a/samples/generated/v2/metrics_service_v2.create_log_metric.js +++ b/samples/generated/v2/metrics_service_v2.create_log_metric.js @@ -21,6 +21,9 @@ function main(parent, metric) { // [START logging_v2_generated_MetricsServiceV2_CreateLogMetric_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/samples/generated/v2/metrics_service_v2.delete_log_metric.js b/samples/generated/v2/metrics_service_v2.delete_log_metric.js index db0c2667..f1093021 100644 --- a/samples/generated/v2/metrics_service_v2.delete_log_metric.js +++ b/samples/generated/v2/metrics_service_v2.delete_log_metric.js @@ -21,6 +21,9 @@ function main(metricName) { // [START logging_v2_generated_MetricsServiceV2_DeleteLogMetric_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/samples/generated/v2/metrics_service_v2.get_log_metric.js b/samples/generated/v2/metrics_service_v2.get_log_metric.js index fddd8493..6711f4ba 100644 --- a/samples/generated/v2/metrics_service_v2.get_log_metric.js +++ b/samples/generated/v2/metrics_service_v2.get_log_metric.js @@ -21,6 +21,9 @@ function main(metricName) { // [START logging_v2_generated_MetricsServiceV2_GetLogMetric_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/samples/generated/v2/metrics_service_v2.list_log_metrics.js b/samples/generated/v2/metrics_service_v2.list_log_metrics.js index cab64828..fffc1b88 100644 --- a/samples/generated/v2/metrics_service_v2.list_log_metrics.js +++ b/samples/generated/v2/metrics_service_v2.list_log_metrics.js @@ -21,6 +21,9 @@ function main(parent) { // [START logging_v2_generated_MetricsServiceV2_ListLogMetrics_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/samples/generated/v2/metrics_service_v2.update_log_metric.js b/samples/generated/v2/metrics_service_v2.update_log_metric.js index 89362b9f..c8f89517 100644 --- a/samples/generated/v2/metrics_service_v2.update_log_metric.js +++ b/samples/generated/v2/metrics_service_v2.update_log_metric.js @@ -21,6 +21,9 @@ function main(metricName, metric) { // [START logging_v2_generated_MetricsServiceV2_UpdateLogMetric_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/samples/generated/v2/snippet_metadata.google.logging.v2.json b/samples/generated/v2/snippet_metadata.google.logging.v2.json index 6d2b8203..90563ae6 100644 --- a/samples/generated/v2/snippet_metadata.google.logging.v2.json +++ b/samples/generated/v2/snippet_metadata.google.logging.v2.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 75, "type": "FULL" } ], @@ -70,7 +70,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -110,7 +110,7 @@ "segments": [ { "start": 25, - "end": 67, + "end": 70, "type": "FULL" } ], @@ -158,7 +158,7 @@ "segments": [ { "start": 25, - "end": 71, + "end": 74, "type": "FULL" } ], @@ -206,7 +206,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -246,7 +246,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -286,7 +286,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 69, "type": "FULL" } ], @@ -334,7 +334,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -374,7 +374,7 @@ "segments": [ { "start": 25, - "end": 63, + "end": 66, "type": "FULL" } ], @@ -422,7 +422,7 @@ "segments": [ { "start": 25, - "end": 67, + "end": 70, "type": "FULL" } ], @@ -470,7 +470,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -510,7 +510,7 @@ "segments": [ { "start": 25, - "end": 69, + "end": 72, "type": "FULL" } ], @@ -558,7 +558,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -598,7 +598,7 @@ "segments": [ { "start": 25, - "end": 76, + "end": 79, "type": "FULL" } ], @@ -646,7 +646,7 @@ "segments": [ { "start": 25, - "end": 90, + "end": 93, "type": "FULL" } ], @@ -698,7 +698,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], @@ -738,7 +738,7 @@ "segments": [ { "start": 25, - "end": 69, + "end": 72, "type": "FULL" } ], @@ -786,7 +786,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -826,7 +826,7 @@ "segments": [ { "start": 25, - "end": 63, + "end": 66, "type": "FULL" } ], @@ -870,7 +870,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 75, "type": "FULL" } ], @@ -918,7 +918,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -958,7 +958,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 63, "type": "FULL" } ], @@ -998,7 +998,7 @@ "segments": [ { "start": 25, - "end": 75, + "end": 78, "type": "FULL" } ], @@ -1046,7 +1046,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 63, "type": "FULL" } ], @@ -1086,7 +1086,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 75, "type": "FULL" } ], @@ -1134,7 +1134,7 @@ "segments": [ { "start": 25, - "end": 63, + "end": 66, "type": "FULL" } ], @@ -1182,7 +1182,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], @@ -1222,7 +1222,7 @@ "segments": [ { "start": 25, - "end": 116, + "end": 119, "type": "FULL" } ], @@ -1282,7 +1282,7 @@ "segments": [ { "start": 25, - "end": 96, + "end": 99, "type": "FULL" } ], @@ -1338,7 +1338,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 63, "type": "FULL" } ], @@ -1382,7 +1382,7 @@ "segments": [ { "start": 25, - "end": 82, + "end": 85, "type": "FULL" } ], @@ -1434,7 +1434,7 @@ "segments": [ { "start": 25, - "end": 80, + "end": 83, "type": "FULL" } ], @@ -1482,7 +1482,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 69, "type": "FULL" } ], @@ -1530,7 +1530,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -1570,7 +1570,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 61, "type": "FULL" } ], @@ -1614,7 +1614,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], @@ -1658,7 +1658,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], diff --git a/src/v2/config_service_v2_client.ts b/src/v2/config_service_v2_client.ts index 53254704..eafea13f 100644 --- a/src/v2/config_service_v2_client.ts +++ b/src/v2/config_service_v2_client.ts @@ -30,7 +30,6 @@ import { } 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'); /** @@ -463,7 +462,8 @@ export class ConfigServiceV2Client { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -2808,7 +2808,7 @@ export class ConfigServiceV2Client { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.copyLogEntries, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.logging.v2.CopyLogEntriesResponse, @@ -2972,7 +2972,7 @@ export class ConfigServiceV2Client { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listBuckets.createStream( - this.innerApiCalls.listBuckets as gax.GaxCall, + this.innerApiCalls.listBuckets as GaxCall, request, callSettings ); @@ -3034,7 +3034,7 @@ export class ConfigServiceV2Client { this.initialize(); return this.descriptors.page.listBuckets.asyncIterate( this.innerApiCalls['listBuckets'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3183,7 +3183,7 @@ export class ConfigServiceV2Client { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listViews.createStream( - this.innerApiCalls.listViews as gax.GaxCall, + this.innerApiCalls.listViews as GaxCall, request, callSettings ); @@ -3239,7 +3239,7 @@ export class ConfigServiceV2Client { this.initialize(); return this.descriptors.page.listViews.asyncIterate( this.innerApiCalls['listViews'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3392,7 +3392,7 @@ export class ConfigServiceV2Client { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSinks.createStream( - this.innerApiCalls.listSinks as gax.GaxCall, + this.innerApiCalls.listSinks as GaxCall, request, callSettings ); @@ -3450,7 +3450,7 @@ export class ConfigServiceV2Client { this.initialize(); return this.descriptors.page.listSinks.asyncIterate( this.innerApiCalls['listSinks'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3603,7 +3603,7 @@ export class ConfigServiceV2Client { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listExclusions.createStream( - this.innerApiCalls.listExclusions as gax.GaxCall, + this.innerApiCalls.listExclusions as GaxCall, request, callSettings ); @@ -3661,7 +3661,7 @@ export class ConfigServiceV2Client { this.initialize(); return this.descriptors.page.listExclusions.asyncIterate( this.innerApiCalls['listExclusions'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/src/v2/logging_service_v2_client.ts b/src/v2/logging_service_v2_client.ts index 4c2c774a..36795d2e 100644 --- a/src/v2/logging_service_v2_client.ts +++ b/src/v2/logging_service_v2_client.ts @@ -29,7 +29,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import {PassThrough} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -396,7 +395,8 @@ export class LoggingServiceV2Client { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -930,7 +930,7 @@ export class LoggingServiceV2Client { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listLogEntries.createStream( - this.innerApiCalls.listLogEntries as gax.GaxCall, + this.innerApiCalls.listLogEntries as GaxCall, request, callSettings ); @@ -1010,7 +1010,7 @@ export class LoggingServiceV2Client { this.initialize(); return this.descriptors.page.listLogEntries.asyncIterate( this.innerApiCalls['listLogEntries'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -1154,7 +1154,7 @@ export class LoggingServiceV2Client { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listMonitoredResourceDescriptors.createStream( - this.innerApiCalls.listMonitoredResourceDescriptors as gax.GaxCall, + this.innerApiCalls.listMonitoredResourceDescriptors as GaxCall, request, callSettings ); @@ -1202,7 +1202,7 @@ export class LoggingServiceV2Client { this.initialize(); return this.descriptors.page.listMonitoredResourceDescriptors.asyncIterate( this.innerApiCalls['listMonitoredResourceDescriptors'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -1384,7 +1384,7 @@ export class LoggingServiceV2Client { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listLogs.createStream( - this.innerApiCalls.listLogs as gax.GaxCall, + this.innerApiCalls.listLogs as GaxCall, request, callSettings ); @@ -1456,7 +1456,7 @@ export class LoggingServiceV2Client { this.initialize(); return this.descriptors.page.listLogs.asyncIterate( this.innerApiCalls['listLogs'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/src/v2/metrics_service_v2_client.ts b/src/v2/metrics_service_v2_client.ts index 9a8155df..56d33898 100644 --- a/src/v2/metrics_service_v2_client.ts +++ b/src/v2/metrics_service_v2_client.ts @@ -28,7 +28,6 @@ import { } 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'); /** @@ -344,7 +343,8 @@ export class MetricsServiceV2Client { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -907,7 +907,7 @@ export class MetricsServiceV2Client { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listLogMetrics.createStream( - this.innerApiCalls.listLogMetrics as gax.GaxCall, + this.innerApiCalls.listLogMetrics as GaxCall, request, callSettings ); @@ -962,7 +962,7 @@ export class MetricsServiceV2Client { this.initialize(); return this.descriptors.page.listLogMetrics.asyncIterate( this.innerApiCalls['listLogMetrics'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/test/gapic_config_service_v2_v2.ts b/test/gapic_config_service_v2_v2.ts index 53dbd244..901770cd 100644 --- a/test/gapic_config_service_v2_v2.ts +++ b/test/gapic_config_service_v2_v2.ts @@ -145,101 +145,103 @@ function stubAsyncIterationCall( } describe('v2.ConfigServiceV2Client', () => { - it('has servicePath', () => { - const servicePath = - configservicev2Module.v2.ConfigServiceV2Client.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - configservicev2Module.v2.ConfigServiceV2Client.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = configservicev2Module.v2.ConfigServiceV2Client.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + configservicev2Module.v2.ConfigServiceV2Client.servicePath; + assert(servicePath); + }); - it('should create a client with no option', () => { - const client = new configservicev2Module.v2.ConfigServiceV2Client(); - assert(client); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + configservicev2Module.v2.ConfigServiceV2Client.apiEndpoint; + assert(apiEndpoint); + }); - it('should create a client with gRPC fallback', () => { - const client = new configservicev2Module.v2.ConfigServiceV2Client({ - fallback: true, + it('has port', () => { + const port = configservicev2Module.v2.ConfigServiceV2Client.port; + assert(port); + assert(typeof port === 'number'); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new configservicev2Module.v2.ConfigServiceV2Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client(); + assert(client); }); - assert.strictEqual(client.configServiceV2Stub, undefined); - await client.initialize(); - assert(client.configServiceV2Stub); - }); - it('has close method for the initialized client', done => { - const client = new configservicev2Module.v2.ConfigServiceV2Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with gRPC fallback', () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + fallback: true, + }); + assert(client); }); - client.initialize(); - assert(client.configServiceV2Stub); - client.close().then(() => { - done(); + + it('has initialize method and supports deferred initialization', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.configServiceV2Stub, undefined); + await client.initialize(); + assert(client.configServiceV2Stub); }); - }); - it('has close method for the non-initialized client', done => { - const client = new configservicev2Module.v2.ConfigServiceV2Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.configServiceV2Stub); + client.close().then(() => { + done(); + }); }); - assert.strictEqual(client.configServiceV2Stub, undefined); - client.close().then(() => { - done(); + + it('has close method for the non-initialized client', done => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.configServiceV2Stub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new configservicev2Module.v2.ConfigServiceV2Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + 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 configservicev2Module.v2.ConfigServiceV2Client({ - 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 configservicev2Module.v2.ConfigServiceV2Client({ + 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('getBucket', () => { diff --git a/test/gapic_logging_service_v2_v2.ts b/test/gapic_logging_service_v2_v2.ts index 99142c85..b1111a0e 100644 --- a/test/gapic_logging_service_v2_v2.ts +++ b/test/gapic_logging_service_v2_v2.ts @@ -127,101 +127,103 @@ function stubAsyncIterationCall( } describe('v2.LoggingServiceV2Client', () => { - it('has servicePath', () => { - const servicePath = - loggingservicev2Module.v2.LoggingServiceV2Client.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - loggingservicev2Module.v2.LoggingServiceV2Client.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = loggingservicev2Module.v2.LoggingServiceV2Client.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + loggingservicev2Module.v2.LoggingServiceV2Client.servicePath; + assert(servicePath); + }); - it('should create a client with no option', () => { - const client = new loggingservicev2Module.v2.LoggingServiceV2Client(); - assert(client); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + loggingservicev2Module.v2.LoggingServiceV2Client.apiEndpoint; + assert(apiEndpoint); + }); - it('should create a client with gRPC fallback', () => { - const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ - fallback: true, + it('has port', () => { + const port = loggingservicev2Module.v2.LoggingServiceV2Client.port; + assert(port); + assert(typeof port === 'number'); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client(); + assert(client); }); - assert.strictEqual(client.loggingServiceV2Stub, undefined); - await client.initialize(); - assert(client.loggingServiceV2Stub); - }); - it('has close method for the initialized client', done => { - const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with gRPC fallback', () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + fallback: true, + }); + assert(client); }); - client.initialize(); - assert(client.loggingServiceV2Stub); - client.close().then(() => { - done(); + + it('has initialize method and supports deferred initialization', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.loggingServiceV2Stub, undefined); + await client.initialize(); + assert(client.loggingServiceV2Stub); }); - }); - it('has close method for the non-initialized client', done => { - const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.loggingServiceV2Stub); + client.close().then(() => { + done(); + }); }); - assert.strictEqual(client.loggingServiceV2Stub, undefined); - client.close().then(() => { - done(); + + it('has close method for the non-initialized client', done => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.loggingServiceV2Stub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + 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 loggingservicev2Module.v2.LoggingServiceV2Client({ - 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 loggingservicev2Module.v2.LoggingServiceV2Client({ + 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('deleteLog', () => { diff --git a/test/gapic_metrics_service_v2_v2.ts b/test/gapic_metrics_service_v2_v2.ts index 874df85a..4c3cb8fa 100644 --- a/test/gapic_metrics_service_v2_v2.ts +++ b/test/gapic_metrics_service_v2_v2.ts @@ -113,101 +113,103 @@ function stubAsyncIterationCall( } describe('v2.MetricsServiceV2Client', () => { - it('has servicePath', () => { - const servicePath = - metricsservicev2Module.v2.MetricsServiceV2Client.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - metricsservicev2Module.v2.MetricsServiceV2Client.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = metricsservicev2Module.v2.MetricsServiceV2Client.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + metricsservicev2Module.v2.MetricsServiceV2Client.servicePath; + assert(servicePath); + }); - it('should create a client with no option', () => { - const client = new metricsservicev2Module.v2.MetricsServiceV2Client(); - assert(client); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + metricsservicev2Module.v2.MetricsServiceV2Client.apiEndpoint; + assert(apiEndpoint); + }); - it('should create a client with gRPC fallback', () => { - const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ - fallback: true, + it('has port', () => { + const port = metricsservicev2Module.v2.MetricsServiceV2Client.port; + assert(port); + assert(typeof port === 'number'); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client(); + assert(client); }); - assert.strictEqual(client.metricsServiceV2Stub, undefined); - await client.initialize(); - assert(client.metricsServiceV2Stub); - }); - it('has close method for the initialized client', done => { - const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with gRPC fallback', () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + fallback: true, + }); + assert(client); }); - client.initialize(); - assert(client.metricsServiceV2Stub); - client.close().then(() => { - done(); + + it('has initialize method and supports deferred initialization', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.metricsServiceV2Stub, undefined); + await client.initialize(); + assert(client.metricsServiceV2Stub); }); - }); - it('has close method for the non-initialized client', done => { - const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.metricsServiceV2Stub); + client.close().then(() => { + done(); + }); }); - assert.strictEqual(client.metricsServiceV2Stub, undefined); - client.close().then(() => { - done(); + + it('has close method for the non-initialized client', done => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.metricsServiceV2Stub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + 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 metricsservicev2Module.v2.MetricsServiceV2Client({ - 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 metricsservicev2Module.v2.MetricsServiceV2Client({ + 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('getLogMetric', () => {