From b7fbb18ca54f12293bae6022d16b02df6f1a416e Mon Sep 17 00:00:00 2001 From: dbolduc Date: Wed, 31 Jul 2024 18:04:03 +0000 Subject: [PATCH 1/4] refactor(generator): prepare for dynamic query params --- generator/internal/descriptor_utils_test.cc | 6 ----- generator/internal/http_option_utils.cc | 23 ++++++++----------- generator/internal/http_option_utils_test.cc | 16 ++++++------- generator/internal/stub_rest_generator.cc | 24 +++++++++++++++----- 4 files changed, 35 insertions(+), 34 deletions(-) diff --git a/generator/internal/descriptor_utils_test.cc b/generator/internal/descriptor_utils_test.cc index 60f021263308e..85d298cb0ea59 100644 --- a/generator/internal/descriptor_utils_test.cc +++ b/generator/internal/descriptor_utils_test.cc @@ -1275,12 +1275,6 @@ INSTANTIATE_TEST_SUITE_P( "method_return_doxygen_link", "@googleapis_link{my::service::v1::Bar,google/" "foo/v1/service.proto#L19}"), - MethodVarsTestValues("my.service.v1.Service.Method1", - "method_http_query_parameters", R"""(, - rest_internal::TrimEmptyQueryParameters({std::make_pair("number", std::to_string(request.number())), - std::make_pair("toggle", (request.toggle() ? "1" : "0")), - std::make_pair("title", request.title()), - std::make_pair("parent", request.parent())}))"""), // Method2 MethodVarsTestValues("my.service.v1.Service.Method2", "longrunning_metadata_type", diff --git a/generator/internal/http_option_utils.cc b/generator/internal/http_option_utils.cc index 1ae175acc0d24..320957b3fcc8b 100644 --- a/generator/internal/http_option_utils.cc +++ b/generator/internal/http_option_utils.cc @@ -112,7 +112,8 @@ std::string FormatQueryParameterCode( } } - auto format = [](auto* out, auto const& i) { + std::string code; + for (auto const& i : remaining_request_fields) { std::string field_access; if (i.second.cpp_type == protobuf::FieldDescriptor::CPPTYPE_STRING) { field_access = i.second.request_field_accessor; @@ -125,21 +126,17 @@ std::string FormatQueryParameterCode( } if (i.second.check_presence) { - out->append(absl::StrFormat( - R"""(std::make_pair("%s", (request.has_%s() ? %s : "")))""", i.first, - i.first, field_access)); + code += absl::StrFormat( + R"""( + query_params.push_back({"%s", (request.has_%s() ? %s : "")});)""", + i.first, i.first, field_access); } else { - out->append(absl::StrFormat(R"""(std::make_pair("%s", %s))""", i.first, - field_access)); + code += absl::StrFormat(R"""( + query_params.push_back({"%s", %s});)""", + i.first, field_access); } - }; - - if (remaining_request_fields.empty()) { - return ""; } - return absl::StrCat( - ",\n rest_internal::TrimEmptyQueryParameters({", - absl::StrJoin(remaining_request_fields, ",\n ", format), "})"); + return code; } } // namespace diff --git a/generator/internal/http_option_utils_test.cc b/generator/internal/http_option_utils_test.cc index 2e9b4f394b76c..50a8a4783ea20 100644 --- a/generator/internal/http_option_utils_test.cc +++ b/generator/internal/http_option_utils_test.cc @@ -628,15 +628,13 @@ TEST_F(HttpOptionUtilsTest, service_file_descriptor->service(0)->method(0); VarsDictionary vars; SetHttpQueryParameters(ParseHttpExtension(*method), *method, vars); - EXPECT_THAT(vars.at("method_http_query_parameters"), Eq(R"""(, - rest_internal::TrimEmptyQueryParameters({std::make_pair("start_index", (request.has_start_index() ? std::to_string(request.start_index().value()) : "")), - std::make_pair("page_token", (request.has_page_token() ? request.page_token().value() : "")), - std::make_pair("max_results", (request.has_max_results() ? std::to_string(request.max_results().value()) : "")), - std::make_pair("include_location", (request.has_include_location() ? (request.include_location().value() ? "1" : "0") : "")), - std::make_pair("double_value", (request.has_double_value() ? std::to_string(request.double_value().value()) : "")), - std::make_pair("float_value", (request.has_float_value() ? std::to_string(request.float_value().value()) : "")), - std::make_pair("int32_value", (request.has_int32_value() ? std::to_string(request.int32_value().value()) : "")), - std::make_pair("int64_value", (request.has_int64_value() ? std::to_string(request.int64_value().value()) : ""))}))""")); + EXPECT_THAT( + vars, Contains(Pair( + "method_http_query_parameters", + AllOf(HasSubstr("page_token"), HasSubstr("max_results"), + HasSubstr("include_location"), HasSubstr("double_value"), + HasSubstr("float_value"), HasSubstr("int32_value"), + HasSubstr("int64_value"))))); } TEST_F(HttpOptionUtilsTest, HasHttpAnnotationRoutingHeaderSuccess) { diff --git a/generator/internal/stub_rest_generator.cc b/generator/internal/stub_rest_generator.cc index 0b6e757bab579..145cc62c59654 100644 --- a/generator/internal/stub_rest_generator.cc +++ b/generator/internal/stub_rest_generator.cc @@ -354,10 +354,12 @@ Default$stub_rest_class_name$::Async$method_name$( future> f = p.get_future(); std::thread t{[]( auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params;$method_http_query_parameters$ + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::$method_http_verb$<$response_type$>( *service, *rest_context, $request_resource$, $preserve_proto_field_names_in_json$, - $method_rest_path_async$$method_http_query_parameters$)); + $method_rest_path_async$, std::move(query_params))); }, std::move(p), service_, request, std::move(rest_context), std::move(options)}; @@ -376,9 +378,11 @@ Default$stub_rest_class_name$::$method_name$( google::cloud::rest_internal::RestContext& rest_context, Options const& options, $request_type$ const& request) { + std::vector> query_params;$method_http_query_parameters$ + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::$method_http_verb$<$response_type$>( *service_, rest_context, $request_resource$, $preserve_proto_field_names_in_json$, - $method_rest_path$$method_http_query_parameters$); + $method_rest_path$, std::move(query_params)); } )"""); @@ -389,9 +393,11 @@ Status Default$stub_rest_class_name$::$method_name$( google::cloud::rest_internal::RestContext& rest_context, Options const& options, $request_type$ const& request) { + std::vector> query_params;$method_http_query_parameters$ + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::$method_http_verb$( *service_, rest_context, $request_resource$, $preserve_proto_field_names_in_json$, - $method_rest_path$$method_http_query_parameters$); + $method_rest_path$, std::move(query_params)); } )"""); } else { @@ -401,9 +407,11 @@ Default$stub_rest_class_name$::$method_name$( google::cloud::rest_internal::RestContext& rest_context, Options const& options, $request_type$ const& request) { + std::vector> query_params;$method_http_query_parameters$ + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::$method_http_verb$<$response_type$>( *service_, rest_context, $request_resource$, $preserve_proto_field_names_in_json$, - $method_rest_path$$method_http_query_parameters$); + $method_rest_path$, std::move(query_params)); } )"""); } @@ -426,9 +434,11 @@ Default$stub_rest_class_name$::Async$method_name$( future> f = p.get_future(); std::thread t{[]( auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params;$method_http_query_parameters$ + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::$method_http_verb$( *service, *rest_context, $request_resource$, $preserve_proto_field_names_in_json$, - $method_rest_path_async$$method_http_query_parameters$)); + $method_rest_path_async$, std::move(query_params))); }, std::move(p), service_, request, std::move(rest_context), std::move(options)}; @@ -452,9 +462,11 @@ Default$stub_rest_class_name$::Async$method_name$( future> f = p.get_future(); std::thread t{[]( auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params;$method_http_query_parameters$ + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::$method_http_verb$<$response_type$>( *service, *rest_context, $request_resource$, $preserve_proto_field_names_in_json$, - $method_rest_path_async$$method_http_query_parameters$)); + $method_rest_path_async$, std::move(query_params))); }, std::move(p), service_, request, std::move(rest_context), std::move(options)}; From f6a4417a2044e4e4e7cd7232d63b0f53b6be3ad4 Mon Sep 17 00:00:00 2001 From: dbolduc Date: Wed, 31 Jul 2024 18:24:54 +0000 Subject: [PATCH 2/4] generated changes --- .../internal/golden_kitchen_sink_rest_stub.cc | 36 +- .../v1/internal/golden_rest_only_rest_stub.cc | 4 +- .../internal/golden_thing_admin_rest_stub.cc | 118 +++- .../v2/internal/dataset_rest_stub.cc | 59 +- .../v2/internal/job_rest_stub.cc | 101 +-- .../v2/internal/model_rest_stub.cc | 33 +- .../v2/internal/project_rest_stub.cc | 6 +- .../v2/internal/routine_rest_stub.cc | 41 +- .../internal/row_access_policy_rest_stub.cc | 9 +- .../v2/internal/table_rest_stub.cc | 52 +- .../internal/accelerator_types_rest_stub.cc | 50 +- .../v1/internal/addresses_rest_stub.cc | 106 ++- .../v1/internal/autoscalers_rest_stub.cc | 114 +-- .../v1/internal/backend_buckets_rest_stub.cc | 142 ++-- .../v1/internal/backend_services_rest_stub.cc | 206 ++++-- .../v1/internal/disk_types_rest_stub.cc | 50 +- .../disks/v1/internal/disks_rest_stub.cc | 256 ++++--- .../external_vpn_gateways_rest_stub.cc | 70 +- .../internal/firewall_policies_rest_stub.cc | 222 ++++-- .../v1/internal/firewalls_rest_stub.cc | 80 ++- .../v1/internal/forwarding_rules_rest_stub.cc | 120 ++-- .../v1/internal/global_addresses_rest_stub.cc | 78 ++- .../global_forwarding_rules_rest_stub.cc | 92 ++- ...lobal_network_endpoint_groups_rest_stub.cc | 86 ++- .../internal/global_operations_rest_stub.cc | 62 +- ...lobal_organization_operations_rest_stub.cc | 34 +- ...bal_public_delegated_prefixes_rest_stub.cc | 66 +- .../v1/internal/health_checks_rest_stub.cc | 106 ++- .../internal/http_health_checks_rest_stub.cc | 80 ++- .../internal/https_health_checks_rest_stub.cc | 80 ++- .../internal/image_family_views_rest_stub.cc | 6 +- .../images/v1/internal/images_rest_stub.cc | 127 +++- ...group_manager_resize_requests_rest_stub.cc | 64 +- .../instance_group_managers_rest_stub.cc | 270 +++++--- .../v1/internal/instance_groups_rest_stub.cc | 138 ++-- .../internal/instance_settings_rest_stub.cc | 24 +- .../internal/instance_templates_rest_stub.cc | 100 ++- .../v1/internal/instances_rest_stub.cc | 655 +++++++++++++----- .../interconnect_attachments_rest_stub.cc | 114 +-- .../interconnect_locations_rest_stub.cc | 24 +- ...interconnect_remote_locations_rest_stub.cc | 24 +- .../v1/internal/interconnects_rest_stub.cc | 90 ++- .../v1/internal/license_codes_rest_stub.cc | 12 +- .../v1/internal/licenses_rest_stub.cc | 74 +- .../v1/internal/machine_images_rest_stub.cc | 79 ++- .../v1/internal/machine_types_rest_stub.cc | 50 +- .../internal/network_attachments_rest_stub.cc | 114 ++- ...etwork_edge_security_services_rest_stub.cc | 90 ++- .../network_endpoint_groups_rest_stub.cc | 130 ++-- .../network_firewall_policies_rest_stub.cc | 213 ++++-- .../v1/internal/networks_rest_stub.cc | 150 ++-- .../v1/internal/node_groups_rest_stub.cc | 199 ++++-- .../v1/internal/node_templates_rest_stub.cc | 100 ++- .../v1/internal/node_types_rest_stub.cc | 50 +- .../internal/packet_mirrorings_rest_stub.cc | 98 ++- .../v1/internal/projects_rest_stub.cc | 184 +++-- .../public_advertised_prefixes_rest_stub.cc | 90 ++- .../public_delegated_prefixes_rest_stub.cc | 116 +++- .../internal/region_autoscalers_rest_stub.cc | 88 ++- .../region_backend_services_rest_stub.cc | 140 ++-- .../internal/region_commitments_rest_stub.cc | 86 ++- .../internal/region_disk_types_rest_stub.cc | 24 +- .../v1/internal/region_disks_rest_stub.cc | 225 ++++-- .../region_health_check_services_rest_stub.cc | 66 +- .../region_health_checks_rest_stub.cc | 80 ++- ...egion_instance_group_managers_rest_stub.cc | 244 +++++-- .../region_instance_groups_rest_stub.cc | 56 +- .../region_instance_templates_rest_stub.cc | 52 +- .../v1/internal/region_instances_rest_stub.cc | 14 +- ...egion_network_endpoint_groups_rest_stub.cc | 86 ++- ...ion_network_firewall_policies_rest_stub.cc | 220 ++++-- ...region_notification_endpoints_rest_stub.cc | 52 +- .../internal/region_operations_rest_stub.cc | 36 +- .../region_security_policies_rest_stub.cc | 141 ++-- .../region_ssl_certificates_rest_stub.cc | 52 +- .../internal/region_ssl_policies_rest_stub.cc | 84 ++- .../region_target_http_proxies_rest_stub.cc | 66 +- .../region_target_https_proxies_rest_stub.cc | 94 ++- .../region_target_tcp_proxies_rest_stub.cc | 52 +- .../v1/internal/region_url_maps_rest_stub.cc | 86 ++- .../v1/internal/region_zones_rest_stub.cc | 18 +- .../regions/v1/internal/regions_rest_stub.cc | 24 +- .../v1/internal/reservations_rest_stub.cc | 136 ++-- .../internal/resource_policies_rest_stub.cc | 118 +++- .../routers/v1/internal/routers_rest_stub.cc | 145 ++-- .../routes/v1/internal/routes_rest_stub.cc | 52 +- .../internal/security_policies_rest_stub.cc | 197 ++++-- .../internal/service_attachments_rest_stub.cc | 114 ++- .../internal/snapshot_settings_rest_stub.cc | 24 +- .../v1/internal/snapshots_rest_stub.cc | 86 ++- .../v1/internal/ssl_certificates_rest_stub.cc | 78 ++- .../v1/internal/ssl_policies_rest_stub.cc | 110 ++- .../internal/storage_pool_types_rest_stub.cc | 50 +- .../v1/internal/storage_pools_rest_stub.cc | 136 ++-- .../v1/internal/subnetworks_rest_stub.cc | 170 +++-- .../internal/target_grpc_proxies_rest_stub.cc | 66 +- .../internal/target_http_proxies_rest_stub.cc | 106 ++- .../target_https_proxies_rest_stub.cc | 162 +++-- .../v1/internal/target_instances_rest_stub.cc | 92 ++- .../v1/internal/target_pools_rest_stub.cc | 176 +++-- .../internal/target_ssl_proxies_rest_stub.cc | 122 +++- .../internal/target_tcp_proxies_rest_stub.cc | 106 ++- .../internal/target_vpn_gateways_rest_stub.cc | 92 ++- .../v1/internal/url_maps_rest_stub.cc | 126 ++-- .../v1/internal/vpn_gateways_rest_stub.cc | 104 ++- .../v1/internal/vpn_tunnels_rest_stub.cc | 92 ++- .../v1/internal/zone_operations_rest_stub.cc | 38 +- .../zones/v1/internal/zones_rest_stub.cc | 24 +- .../internal/database_admin_rest_stub.cc | 213 ++++-- .../internal/instance_admin_rest_stub.cc | 183 +++-- .../v1/internal/sql_backup_runs_rest_stub.cc | 28 +- .../sql/v1/internal/sql_connect_rest_stub.cc | 12 +- .../v1/internal/sql_databases_rest_stub.cc | 36 +- .../sql/v1/internal/sql_flags_rest_stub.cc | 7 +- .../v1/internal/sql_instances_rest_stub.cc | 211 +++++- .../v1/internal/sql_operations_rest_stub.cc | 24 +- .../v1/internal/sql_ssl_certs_rest_stub.cc | 24 +- .../sql/v1/internal/sql_tiers_rest_stub.cc | 6 +- .../sql/v1/internal/sql_users_rest_stub.cc | 37 +- 119 files changed, 8044 insertions(+), 3489 deletions(-) diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_stub.cc b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_stub.cc index 61d8b3ff8b10f..d1b77b58c81c1 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_stub.cc +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_stub.cc @@ -46,9 +46,11 @@ DefaultGoldenKitchenSinkRestStub::GenerateAccessToken( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::GenerateAccessTokenRequest const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.name(), ":generateAccessToken")); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.name(), ":generateAccessToken"), std::move(query_params)); } StatusOr @@ -56,9 +58,11 @@ DefaultGoldenKitchenSinkRestStub::GenerateIdToken( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::GenerateIdTokenRequest const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "token", ":generate")); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "token", ":generate"), std::move(query_params)); } StatusOr @@ -66,9 +70,11 @@ DefaultGoldenKitchenSinkRestStub::WriteLogEntries( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::WriteLogEntriesRequest const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "entries", ":write")); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "entries", ":write"), std::move(query_params)); } StatusOr @@ -76,11 +82,13 @@ DefaultGoldenKitchenSinkRestStub::ListLogs( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::ListLogsRequest const& request) { + std::vector> query_params; + query_params.push_back({"page_size", std::to_string(request.page_size())}); + query_params.push_back({"page_token", request.page_token()}); + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "logs"), - rest_internal::TrimEmptyQueryParameters({std::make_pair("page_size", std::to_string(request.page_size())), - std::make_pair("page_token", request.page_token())})); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "logs"), std::move(query_params)); } StatusOr @@ -88,36 +96,44 @@ DefaultGoldenKitchenSinkRestStub::ListServiceAccountKeys( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::ListServiceAccountKeysRequest const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.name(), "/", "keys")); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.name(), "/", "keys"), std::move(query_params)); } Status DefaultGoldenKitchenSinkRestStub::DoNothing( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::protobuf::Empty const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "doNothing")); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "doNothing"), std::move(query_params)); } Status DefaultGoldenKitchenSinkRestStub::ExplicitRouting1( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::ExplicitRoutingRequest const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.table_name(), ":explicitRouting1")); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.table_name(), ":explicitRouting1"), std::move(query_params)); } Status DefaultGoldenKitchenSinkRestStub::ExplicitRouting2( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::ExplicitRoutingRequest const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.table_name(), ":explicitRouting2")); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.table_name(), ":explicitRouting2"), std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_stub.cc b/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_stub.cc index bbaa5fea15ba8..d6df4cbb9a237 100644 --- a/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_stub.cc +++ b/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_stub.cc @@ -45,9 +45,11 @@ Status DefaultGoldenRestOnlyRestStub::Noop( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::protobuf::Empty const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "noop")); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "noop"), std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_stub.cc b/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_stub.cc index bb2435892fd38..0ca7bfd27c318 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_stub.cc +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_stub.cc @@ -51,11 +51,13 @@ DefaultGoldenThingAdminRestStub::ListDatabases( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::ListDatabasesRequest const& request) { + std::vector> query_params; + query_params.push_back({"page_size", std::to_string(request.page_size())}); + query_params.push_back({"page_token", request.page_token()}); + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "databases"), - rest_internal::TrimEmptyQueryParameters({std::make_pair("page_size", std::to_string(request.page_size())), - std::make_pair("page_token", request.page_token())})); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "databases"), std::move(query_params)); } future> @@ -68,10 +70,12 @@ DefaultGoldenThingAdminRestStub::AsyncCreateDatabase( future> f = p.get_future(); std::thread t{[]( auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), "/", request.parent(), "/", "databases"))); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), "/", request.parent(), "/", "databases"), std::move(query_params))); }, std::move(p), service_, request, std::move(rest_context), std::move(options)}; @@ -88,9 +92,11 @@ DefaultGoldenThingAdminRestStub::CreateDatabase( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::CreateDatabaseRequest const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "databases")); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "databases"), std::move(query_params)); } StatusOr @@ -98,9 +104,11 @@ DefaultGoldenThingAdminRestStub::GetDatabase( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::GetDatabaseRequest const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.name())); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.name()), std::move(query_params)); } future> @@ -113,10 +121,12 @@ DefaultGoldenThingAdminRestStub::AsyncUpdateDatabaseDdl( future> f = p.get_future(); std::thread t{[]( auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Patch( *service, *rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), "/", request.database(), "/", "ddl"))); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), "/", request.database(), "/", "ddl"), std::move(query_params))); }, std::move(p), service_, request, std::move(rest_context), std::move(options)}; @@ -133,18 +143,22 @@ DefaultGoldenThingAdminRestStub::UpdateDatabaseDdl( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::UpdateDatabaseDdlRequest const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.database(), "/", "ddl")); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.database(), "/", "ddl"), std::move(query_params)); } Status DefaultGoldenThingAdminRestStub::DropDatabase( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::DropDatabaseRequest const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.database())); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.database()), std::move(query_params)); } StatusOr @@ -152,9 +166,11 @@ DefaultGoldenThingAdminRestStub::GetDatabaseDdl( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::GetDatabaseDdlRequest const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.database(), "/", "ddl")); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.database(), "/", "ddl"), std::move(query_params)); } StatusOr @@ -162,9 +178,11 @@ DefaultGoldenThingAdminRestStub::SetIamPolicy( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::iam::v1::SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.resource(), ":setIamPolicy")); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.resource(), ":setIamPolicy"), std::move(query_params)); } StatusOr @@ -172,9 +190,11 @@ DefaultGoldenThingAdminRestStub::GetIamPolicy( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::iam::v1::GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.resource(), ":getIamPolicy")); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.resource(), ":getIamPolicy"), std::move(query_params)); } StatusOr @@ -182,9 +202,11 @@ DefaultGoldenThingAdminRestStub::TestIamPermissions( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::iam::v1::TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.resource(), ":testIamPermissions")); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.resource(), ":testIamPermissions"), std::move(query_params)); } future> @@ -197,11 +219,13 @@ DefaultGoldenThingAdminRestStub::AsyncCreateBackup( future> f = p.get_future(); std::thread t{[]( auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"backup_id", request.backup_id()}); + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request.backup(), false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), "/", request.parent(), "/", "backups"), - rest_internal::TrimEmptyQueryParameters({std::make_pair("backup_id", request.backup_id())}))); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), "/", request.parent(), "/", "backups"), std::move(query_params))); }, std::move(p), service_, request, std::move(rest_context), std::move(options)}; @@ -218,10 +242,12 @@ DefaultGoldenThingAdminRestStub::CreateBackup( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::CreateBackupRequest const& request) { + std::vector> query_params; + query_params.push_back({"backup_id", request.backup_id()}); + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.backup(), false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "backups"), - rest_internal::TrimEmptyQueryParameters({std::make_pair("backup_id", request.backup_id())})); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "backups"), std::move(query_params)); } StatusOr @@ -229,9 +255,11 @@ DefaultGoldenThingAdminRestStub::GetBackup( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::GetBackupRequest const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.name())); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.name()), std::move(query_params)); } StatusOr @@ -239,18 +267,22 @@ DefaultGoldenThingAdminRestStub::UpdateBackup( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::UpdateBackupRequest const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.backup(), false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.backup().name())); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.backup().name()), std::move(query_params)); } Status DefaultGoldenThingAdminRestStub::DeleteBackup( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::DeleteBackupRequest const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.name())); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.name()), std::move(query_params)); } StatusOr @@ -258,12 +290,14 @@ DefaultGoldenThingAdminRestStub::ListBackups( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::ListBackupsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back({"page_size", std::to_string(request.page_size())}); + query_params.push_back({"page_token", request.page_token()}); + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "backups"), - rest_internal::TrimEmptyQueryParameters({std::make_pair("filter", request.filter()), - std::make_pair("page_size", std::to_string(request.page_size())), - std::make_pair("page_token", request.page_token())})); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "backups"), std::move(query_params)); } future> @@ -276,10 +310,12 @@ DefaultGoldenThingAdminRestStub::AsyncRestoreDatabase( future> f = p.get_future(); std::thread t{[]( auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), "/", request.parent(), "/", "databases", ":restore"))); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), "/", request.parent(), "/", "databases", ":restore"), std::move(query_params))); }, std::move(p), service_, request, std::move(rest_context), std::move(options)}; @@ -296,9 +332,11 @@ DefaultGoldenThingAdminRestStub::RestoreDatabase( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::RestoreDatabaseRequest const& request) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "databases", ":restore")); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "databases", ":restore"), std::move(query_params)); } StatusOr @@ -306,12 +344,14 @@ DefaultGoldenThingAdminRestStub::ListDatabaseOperations( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::ListDatabaseOperationsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back({"page_size", std::to_string(request.page_size())}); + query_params.push_back({"page_token", request.page_token()}); + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "databaseOperations"), - rest_internal::TrimEmptyQueryParameters({std::make_pair("filter", request.filter()), - std::make_pair("page_size", std::to_string(request.page_size())), - std::make_pair("page_token", request.page_token())})); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "databaseOperations"), std::move(query_params)); } StatusOr @@ -319,12 +359,14 @@ DefaultGoldenThingAdminRestStub::ListBackupOperations( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::test::admin::database::v1::ListBackupOperationsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back({"page_size", std::to_string(request.page_size())}); + query_params.push_back({"page_token", request.page_token()}); + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "backupOperations"), - rest_internal::TrimEmptyQueryParameters({std::make_pair("filter", request.filter()), - std::make_pair("page_size", std::to_string(request.page_size())), - std::make_pair("page_token", request.page_token())})); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "backupOperations"), std::move(query_params)); } future> @@ -337,9 +379,11 @@ DefaultGoldenThingAdminRestStub::AsyncGetDatabase( future> f = p.get_future(); std::thread t{[]( auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Get( *service, *rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), "/", request.name()))); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), "/", request.name()), std::move(query_params))); }, std::move(p), service_, request, std::move(rest_context), std::move(options)}; @@ -361,9 +405,11 @@ DefaultGoldenThingAdminRestStub::AsyncDropDatabase( future> f = p.get_future(); std::thread t{[]( auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Delete( *service, *rest_context, request, false, - absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), "/", request.database()))); + absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), "/", request.database()), std::move(query_params))); }, std::move(p), service_, request, std::move(rest_context), std::move(options)}; diff --git a/google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.cc index bbb55afd53c0a..3bbe9c378e3fa 100644 --- a/google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.cc @@ -44,14 +44,18 @@ DefaultDatasetServiceRestStub::GetDataset( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::GetDatasetRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"dataset_view", std::to_string(request.dataset_view())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "datasets", "/", request.dataset_id()), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "dataset_view", std::to_string(request.dataset_view()))})); + std::move(query_params)); } StatusOr @@ -59,11 +63,15 @@ DefaultDatasetServiceRestStub::InsertDataset( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::InsertDatasetRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.dataset(), false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", - "projects", "/", request.project_id(), "/", "datasets")); + "projects", "/", request.project_id(), "/", "datasets"), + std::move(query_params)); } StatusOr @@ -71,12 +79,16 @@ DefaultDatasetServiceRestStub::PatchDataset( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::UpdateOrPatchDatasetRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.dataset(), false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "datasets", "/", - request.dataset_id())); + request.dataset_id()), + std::move(query_params)); } StatusOr @@ -84,26 +96,34 @@ DefaultDatasetServiceRestStub::UpdateDataset( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::UpdateOrPatchDatasetRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.dataset(), false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "datasets", "/", - request.dataset_id())); + request.dataset_id()), + std::move(query_params)); } Status DefaultDatasetServiceRestStub::DeleteDataset( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::DeleteDatasetRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"delete_contents", (request.delete_contents() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "datasets", "/", request.dataset_id()), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "delete_contents", (request.delete_contents() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -111,19 +131,22 @@ DefaultDatasetServiceRestStub::ListDatasets( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::ListDatasetsRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"max_results", (request.has_max_results() + ? std::to_string(request.max_results().value()) + : "")}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"all", (request.all() ? "1" : "0")}); + query_params.push_back({"filter", request.filter()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "datasets"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("max_results", - (request.has_max_results() - ? std::to_string(request.max_results().value()) - : "")), - std::make_pair("page_token", request.page_token()), - std::make_pair("all", (request.all() ? "1" : "0")), - std::make_pair("filter", request.filter())})); + std::move(query_params)); } StatusOr @@ -131,12 +154,16 @@ DefaultDatasetServiceRestStub::UndeleteDataset( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::UndeleteDatasetRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "datasets", "/", - request.dataset_id(), ":undelete")); + request.dataset_id(), ":undelete"), + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/bigquerycontrol/v2/internal/job_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/job_rest_stub.cc index e1561079cd9b7..7f2bb30f37a57 100644 --- a/google/cloud/bigquerycontrol/v2/internal/job_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/job_rest_stub.cc @@ -44,53 +44,66 @@ DefaultJobServiceRestStub::CancelJob( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::CancelJobRequest const& request) { + std::vector> query_params; + query_params.push_back({"location", request.location()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "jobs", "/", request.job_id(), "/", "cancel"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("location", request.location())})); + std::move(query_params)); } StatusOr DefaultJobServiceRestStub::GetJob( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::GetJobRequest const& request) { + std::vector> query_params; + query_params.push_back({"location", request.location()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "jobs", "/", request.job_id()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("location", request.location())})); + std::move(query_params)); } StatusOr DefaultJobServiceRestStub::InsertJob( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::InsertJobRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.job(), false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", - "projects", "/", request.project_id(), "/", "jobs")); + "projects", "/", request.project_id(), "/", "jobs"), + std::move(query_params)); } Status DefaultJobServiceRestStub::DeleteJob( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::DeleteJobRequest const& request) { + std::vector> query_params; + query_params.push_back({"location", request.location()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "jobs", "/", request.job_id(), "/", "delete"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("location", request.location())})); + std::move(query_params)); } StatusOr @@ -98,27 +111,30 @@ DefaultJobServiceRestStub::ListJobs( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::ListJobsRequest const& request) { + std::vector> query_params; + query_params.push_back({"all_users", (request.all_users() ? "1" : "0")}); + query_params.push_back( + {"max_results", (request.has_max_results() + ? std::to_string(request.max_results().value()) + : "")}); + query_params.push_back( + {"min_creation_time", std::to_string(request.min_creation_time())}); + query_params.push_back( + {"max_creation_time", + (request.has_max_creation_time() + ? std::to_string(request.max_creation_time().value()) + : "")}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"projection", std::to_string(request.projection())}); + query_params.push_back({"parent_job_id", request.parent_job_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "jobs"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("all_users", (request.all_users() ? "1" : "0")), - std::make_pair("max_results", - (request.has_max_results() - ? std::to_string(request.max_results().value()) - : "")), - std::make_pair("min_creation_time", - std::to_string(request.min_creation_time())), - std::make_pair( - "max_creation_time", - (request.has_max_creation_time() - ? std::to_string(request.max_creation_time().value()) - : "")), - std::make_pair("page_token", request.page_token()), - std::make_pair("projection", std::to_string(request.projection())), - std::make_pair("parent_job_id", request.parent_job_id())})); + std::move(query_params)); } StatusOr @@ -126,6 +142,23 @@ DefaultJobServiceRestStub::GetQueryResults( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::GetQueryResultsRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"start_index", (request.has_start_index() + ? std::to_string(request.start_index().value()) + : "")}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back( + {"max_results", (request.has_max_results() + ? std::to_string(request.max_results().value()) + : "")}); + query_params.push_back( + {"timeout_ms", + (request.has_timeout_ms() ? std::to_string(request.timeout_ms().value()) + : "")}); + query_params.push_back({"location", request.location()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::bigquery::v2::GetQueryResultsResponse>( *service_, rest_context, request, false, @@ -133,21 +166,7 @@ DefaultJobServiceRestStub::GetQueryResults( rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "queries", "/", request.job_id()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("start_index", - (request.has_start_index() - ? std::to_string(request.start_index().value()) - : "")), - std::make_pair("page_token", request.page_token()), - std::make_pair("max_results", - (request.has_max_results() - ? std::to_string(request.max_results().value()) - : "")), - std::make_pair("timeout_ms", - (request.has_timeout_ms() - ? std::to_string(request.timeout_ms().value()) - : "")), - std::make_pair("location", request.location())})); + std::move(query_params)); } StatusOr @@ -155,11 +174,15 @@ DefaultJobServiceRestStub::Query( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::PostQueryRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.query_request(), false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", - "projects", "/", request.project_id(), "/", "queries")); + "projects", "/", request.project_id(), "/", "queries"), + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/bigquerycontrol/v2/internal/model_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/model_rest_stub.cc index c559fe3ab7fa3..78cccb82eec21 100644 --- a/google/cloud/bigquerycontrol/v2/internal/model_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/model_rest_stub.cc @@ -44,13 +44,17 @@ DefaultModelServiceRestStub::GetModel( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::GetModelRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "datasets", "/", request.dataset_id(), "/", "models", "/", - request.model_id())); + request.model_id()), + std::move(query_params)); } StatusOr @@ -58,18 +62,21 @@ DefaultModelServiceRestStub::ListModels( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::ListModelsRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"max_results", (request.has_max_results() + ? std::to_string(request.max_results().value()) + : "")}); + query_params.push_back({"page_token", request.page_token()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "datasets", "/", request.dataset_id(), "/", "models"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("max_results", - (request.has_max_results() - ? std::to_string(request.max_results().value()) - : "")), - std::make_pair("page_token", request.page_token())})); + std::move(query_params)); } StatusOr @@ -77,26 +84,34 @@ DefaultModelServiceRestStub::PatchModel( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::PatchModelRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.model(), false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "datasets", "/", request.dataset_id(), "/", "models", "/", - request.model_id())); + request.model_id()), + std::move(query_params)); } Status DefaultModelServiceRestStub::DeleteModel( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::DeleteModelRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "datasets", "/", request.dataset_id(), "/", "models", "/", - request.model_id())); + request.model_id()), + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/bigquerycontrol/v2/internal/project_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/project_rest_stub.cc index 840a0f3287dcb..d1aeb8e8a0793 100644 --- a/google/cloud/bigquerycontrol/v2/internal/project_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/project_rest_stub.cc @@ -44,13 +44,17 @@ DefaultProjectServiceRestStub::GetServiceAccount( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::GetServiceAccountRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::bigquery::v2::GetServiceAccountResponse>( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", - "serviceAccount")); + "serviceAccount"), + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.cc index 1b15857e03dae..892de8557bd43 100644 --- a/google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.cc @@ -44,13 +44,17 @@ DefaultRoutineServiceRestStub::GetRoutine( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::GetRoutineRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "datasets", "/", request.dataset_id(), "/", "routines", "/", - request.routine_id())); + request.routine_id()), + std::move(query_params)); } StatusOr @@ -58,12 +62,16 @@ DefaultRoutineServiceRestStub::InsertRoutine( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::InsertRoutineRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.routine(), false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "datasets", "/", - request.dataset_id(), "/", "routines")); + request.dataset_id(), "/", "routines"), + std::move(query_params)); } StatusOr @@ -71,26 +79,34 @@ DefaultRoutineServiceRestStub::UpdateRoutine( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::UpdateRoutineRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.routine(), false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "datasets", "/", request.dataset_id(), "/", "routines", "/", - request.routine_id())); + request.routine_id()), + std::move(query_params)); } Status DefaultRoutineServiceRestStub::DeleteRoutine( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::DeleteRoutineRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "datasets", "/", request.dataset_id(), "/", "routines", "/", - request.routine_id())); + request.routine_id()), + std::move(query_params)); } StatusOr @@ -98,19 +114,22 @@ DefaultRoutineServiceRestStub::ListRoutines( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::ListRoutinesRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"max_results", (request.has_max_results() + ? std::to_string(request.max_results().value()) + : "")}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"filter", request.filter()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "datasets", "/", request.dataset_id(), "/", "routines"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("max_results", - (request.has_max_results() - ? std::to_string(request.max_results().value()) - : "")), - std::make_pair("page_token", request.page_token()), - std::make_pair("filter", request.filter())})); + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_stub.cc index d4b00bd726c97..7ee77df38b4a8 100644 --- a/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/row_access_policy_rest_stub.cc @@ -45,6 +45,11 @@ DefaultRowAccessPolicyServiceRestStub::ListRowAccessPolicies( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::ListRowAccessPoliciesRequest const& request) { + std::vector> query_params; + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"page_size", std::to_string(request.page_size())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::bigquery::v2::ListRowAccessPoliciesResponse>( *service_, rest_context, request, false, @@ -53,9 +58,7 @@ DefaultRowAccessPolicyServiceRestStub::ListRowAccessPolicies( "projects", "/", request.project_id(), "/", "datasets", "/", request.dataset_id(), "/", "tables", "/", request.table_id(), "/", "rowAccessPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("page_token", request.page_token()), - std::make_pair("page_size", std::to_string(request.page_size()))})); + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/bigquerycontrol/v2/internal/table_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/table_rest_stub.cc index cf7fcebeab0cd..4a6f4c472ad56 100644 --- a/google/cloud/bigquerycontrol/v2/internal/table_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/table_rest_stub.cc @@ -44,6 +44,11 @@ DefaultTableServiceRestStub::GetTable( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::GetTableRequest const& request) { + std::vector> query_params; + query_params.push_back({"selected_fields", request.selected_fields()}); + query_params.push_back({"view", std::to_string(request.view())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", @@ -51,9 +56,7 @@ DefaultTableServiceRestStub::GetTable( "projects", "/", request.project_id(), "/", "datasets", "/", request.dataset_id(), "/", "tables", "/", request.table_id()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("selected_fields", request.selected_fields()), - std::make_pair("view", std::to_string(request.view()))})); + std::move(query_params)); } StatusOr @@ -61,12 +64,16 @@ DefaultTableServiceRestStub::InsertTable( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::InsertTableRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.table(), false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "datasets", "/", - request.dataset_id(), "/", "tables")); + request.dataset_id(), "/", "tables"), + std::move(query_params)); } StatusOr @@ -74,6 +81,11 @@ DefaultTableServiceRestStub::PatchTable( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::UpdateOrPatchTableRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"autodetect_schema", (request.autodetect_schema() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.table(), false, absl::StrCat("/", "bigquery", "/", @@ -81,8 +93,7 @@ DefaultTableServiceRestStub::PatchTable( "projects", "/", request.project_id(), "/", "datasets", "/", request.dataset_id(), "/", "tables", "/", request.table_id()), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "autodetect_schema", (request.autodetect_schema() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -90,6 +101,11 @@ DefaultTableServiceRestStub::UpdateTable( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::UpdateOrPatchTableRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"autodetect_schema", (request.autodetect_schema() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.table(), false, absl::StrCat("/", "bigquery", "/", @@ -97,21 +113,24 @@ DefaultTableServiceRestStub::UpdateTable( "projects", "/", request.project_id(), "/", "datasets", "/", request.dataset_id(), "/", "tables", "/", request.table_id()), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "autodetect_schema", (request.autodetect_schema() ? "1" : "0"))})); + std::move(query_params)); } Status DefaultTableServiceRestStub::DeleteTable( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::DeleteTableRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "datasets", "/", request.dataset_id(), "/", "tables", "/", - request.table_id())); + request.table_id()), + std::move(query_params)); } StatusOr @@ -119,18 +138,21 @@ DefaultTableServiceRestStub::ListTables( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::bigquery::v2::ListTablesRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"max_results", (request.has_max_results() + ? std::to_string(request.max_results().value()) + : "")}); + query_params.push_back({"page_token", request.page_token()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", rest_internal::DetermineApiVersion("v2", options), "/", "projects", "/", request.project_id(), "/", "datasets", "/", request.dataset_id(), "/", "tables"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("max_results", - (request.has_max_results() - ? std::to_string(request.max_results().value()) - : "")), - std::make_pair("page_token", request.page_token())})); + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_stub.cc b/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_stub.cc index 9297dd9691332..102582c50a7f9 100644 --- a/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_stub.cc +++ b/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_stub.cc @@ -46,6 +46,20 @@ DefaultAcceleratorTypesRestStub::AggregatedListAcceleratorTypes( Options const& options, google::cloud::cpp::compute::accelerator_types::v1:: AggregatedListAcceleratorTypesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::AcceleratorTypeAggregatedList>( *service_, rest_context, request, false, @@ -53,17 +67,7 @@ DefaultAcceleratorTypesRestStub::AggregatedListAcceleratorTypes( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "acceleratorTypes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } StatusOr @@ -72,13 +76,17 @@ DefaultAcceleratorTypesRestStub::GetAcceleratorType( Options const& options, google::cloud::cpp::compute::accelerator_types::v1:: GetAcceleratorTypeRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "acceleratorTypes", "/", - request.accelerator_type())); + request.accelerator_type()), + std::move(query_params)); } StatusOr @@ -87,6 +95,16 @@ DefaultAcceleratorTypesRestStub::ListAcceleratorTypes( Options const& options, google::cloud::cpp::compute::accelerator_types::v1:: ListAcceleratorTypesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::AcceleratorTypeList>( *service_, rest_context, request, false, @@ -94,13 +112,7 @@ DefaultAcceleratorTypesRestStub::ListAcceleratorTypes( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "acceleratorTypes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/compute/addresses/v1/internal/addresses_rest_stub.cc b/google/cloud/compute/addresses/v1/internal/addresses_rest_stub.cc index 06220ff8720ac..fd203f96ca6e4 100644 --- a/google/cloud/compute/addresses/v1/internal/addresses_rest_stub.cc +++ b/google/cloud/compute/addresses/v1/internal/addresses_rest_stub.cc @@ -51,6 +51,20 @@ DefaultAddressesRestStub::AggregatedListAddresses( Options const& options, google::cloud::cpp::compute::addresses::v1:: AggregatedListAddressesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::AddressAggregatedList>( *service_, rest_context, request, false, @@ -58,17 +72,7 @@ DefaultAddressesRestStub::AggregatedListAddresses( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "addresses"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -83,6 +87,10 @@ DefaultAddressesRestStub::AsyncDeleteAddress( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -91,8 +99,7 @@ DefaultAddressesRestStub::AsyncDeleteAddress( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "addresses", "/", request.address()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -111,14 +118,17 @@ DefaultAddressesRestStub::DeleteAddress( Options const& options, google::cloud::cpp::compute::addresses::v1::DeleteAddressRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "addresses", "/", request.address()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -127,12 +137,16 @@ DefaultAddressesRestStub::GetAddress( Options const& options, google::cloud::cpp::compute::addresses::v1::GetAddressRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", - request.region(), "/", "addresses", "/", request.address())); + request.region(), "/", "addresses", "/", request.address()), + std::move(query_params)); } future> @@ -147,6 +161,10 @@ DefaultAddressesRestStub::AsyncInsertAddress( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.address_resource(), false, @@ -155,8 +173,7 @@ DefaultAddressesRestStub::AsyncInsertAddress( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "addresses"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -175,14 +192,17 @@ DefaultAddressesRestStub::InsertAddress( Options const& options, google::cloud::cpp::compute::addresses::v1::InsertAddressRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.address_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "addresses"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -191,19 +211,23 @@ DefaultAddressesRestStub::ListAddresses( Options const& options, google::cloud::cpp::compute::addresses::v1::ListAddressesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "addresses"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -217,6 +241,10 @@ DefaultAddressesRestStub::AsyncMove( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -226,8 +254,7 @@ DefaultAddressesRestStub::AsyncMove( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "addresses", "/", request.address(), "/", "move"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -245,6 +272,10 @@ DefaultAddressesRestStub::Move( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::addresses::v1::MoveRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_addresses_move_request_resource(), false, @@ -253,8 +284,7 @@ DefaultAddressesRestStub::Move( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "addresses", "/", request.address(), "/", "move"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -269,6 +299,10 @@ DefaultAddressesRestStub::AsyncSetLabels( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -278,8 +312,7 @@ DefaultAddressesRestStub::AsyncSetLabels( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "addresses", "/", request.resource(), "/", "setLabels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -298,6 +331,10 @@ DefaultAddressesRestStub::SetLabels( Options const& options, google::cloud::cpp::compute::addresses::v1::SetLabelsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_labels_request_resource(), false, @@ -306,8 +343,7 @@ DefaultAddressesRestStub::SetLabels( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "addresses", "/", request.resource(), "/", "setLabels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.cc b/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.cc index 979a1c902c312..f33e252e44173 100644 --- a/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.cc +++ b/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.cc @@ -51,6 +51,20 @@ DefaultAutoscalersRestStub::AggregatedListAutoscalers( Options const& options, google::cloud::cpp::compute::autoscalers::v1:: AggregatedListAutoscalersRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::AutoscalerAggregatedList>( *service_, rest_context, request, false, @@ -58,17 +72,7 @@ DefaultAutoscalersRestStub::AggregatedListAutoscalers( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "autoscalers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -83,6 +87,10 @@ DefaultAutoscalersRestStub::AsyncDeleteAutoscaler( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -91,8 +99,7 @@ DefaultAutoscalersRestStub::AsyncDeleteAutoscaler( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "autoscalers", "/", request.autoscaler()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -111,6 +118,10 @@ DefaultAutoscalersRestStub::DeleteAutoscaler( Options const& options, google::cloud::cpp::compute::autoscalers::v1::DeleteAutoscalerRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -118,8 +129,7 @@ DefaultAutoscalersRestStub::DeleteAutoscaler( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "autoscalers", "/", request.autoscaler()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -128,13 +138,17 @@ DefaultAutoscalersRestStub::GetAutoscaler( Options const& options, google::cloud::cpp::compute::autoscalers::v1::GetAutoscalerRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "autoscalers", "/", - request.autoscaler())); + request.autoscaler()), + std::move(query_params)); } future> @@ -149,6 +163,10 @@ DefaultAutoscalersRestStub::AsyncInsertAutoscaler( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.autoscaler_resource(), false, @@ -156,8 +174,7 @@ DefaultAutoscalersRestStub::AsyncInsertAutoscaler( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "autoscalers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -176,14 +193,17 @@ DefaultAutoscalersRestStub::InsertAutoscaler( Options const& options, google::cloud::cpp::compute::autoscalers::v1::InsertAutoscalerRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.autoscaler_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "autoscalers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -192,19 +212,23 @@ DefaultAutoscalersRestStub::ListAutoscalers( Options const& options, google::cloud::cpp::compute::autoscalers::v1::ListAutoscalersRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "autoscalers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -219,6 +243,11 @@ DefaultAutoscalersRestStub::AsyncPatchAutoscaler( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"autoscaler", request.autoscaler()}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.autoscaler_resource(), false, @@ -226,9 +255,7 @@ DefaultAutoscalersRestStub::AsyncPatchAutoscaler( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "autoscalers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("autoscaler", request.autoscaler()), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -247,15 +274,18 @@ DefaultAutoscalersRestStub::PatchAutoscaler( Options const& options, google::cloud::cpp::compute::autoscalers::v1::PatchAutoscalerRequest const& request) { + std::vector> query_params; + query_params.push_back({"autoscaler", request.autoscaler()}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.autoscaler_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "autoscalers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("autoscaler", request.autoscaler()), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -270,6 +300,11 @@ DefaultAutoscalersRestStub::AsyncUpdateAutoscaler( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"autoscaler", request.autoscaler()}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Put( *service, *rest_context, request.autoscaler_resource(), false, @@ -277,9 +312,7 @@ DefaultAutoscalersRestStub::AsyncUpdateAutoscaler( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "autoscalers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("autoscaler", request.autoscaler()), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -298,15 +331,18 @@ DefaultAutoscalersRestStub::UpdateAutoscaler( Options const& options, google::cloud::cpp::compute::autoscalers::v1::UpdateAutoscalerRequest const& request) { + std::vector> query_params; + query_params.push_back({"autoscaler", request.autoscaler()}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.autoscaler_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "autoscalers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("autoscaler", request.autoscaler()), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.cc b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.cc index 55ae723dd2afd..e8a003b455bb9 100644 --- a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.cc +++ b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.cc @@ -57,6 +57,10 @@ DefaultBackendBucketsRestStub::AsyncAddSignedUrlKey( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.signed_url_key_resource(), @@ -66,8 +70,7 @@ DefaultBackendBucketsRestStub::AsyncAddSignedUrlKey( "/", "projects", "/", request.project(), "/", "global", "/", "backendBuckets", "/", request.backend_bucket(), "/", "addSignedUrlKey"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -86,6 +89,10 @@ DefaultBackendBucketsRestStub::AddSignedUrlKey( Options const& options, google::cloud::cpp::compute::backend_buckets::v1:: AddSignedUrlKeyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.signed_url_key_resource(), false, absl::StrCat("/", "compute", "/", @@ -93,8 +100,7 @@ DefaultBackendBucketsRestStub::AddSignedUrlKey( "projects", "/", request.project(), "/", "global", "/", "backendBuckets", "/", request.backend_bucket(), "/", "addSignedUrlKey"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -109,6 +115,10 @@ DefaultBackendBucketsRestStub::AsyncDeleteBackendBucket( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -117,8 +127,7 @@ DefaultBackendBucketsRestStub::AsyncDeleteBackendBucket( "/", "projects", "/", request.project(), "/", "global", "/", "backendBuckets", "/", request.backend_bucket()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -137,14 +146,17 @@ DefaultBackendBucketsRestStub::DeleteBackendBucket( Options const& options, google::cloud::cpp::compute::backend_buckets::v1:: DeleteBackendBucketRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "backendBuckets", "/", request.backend_bucket()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -159,6 +171,9 @@ DefaultBackendBucketsRestStub::AsyncDeleteSignedUrlKey( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -167,7 +182,8 @@ DefaultBackendBucketsRestStub::AsyncDeleteSignedUrlKey( "/", "projects", "/", request.project(), "/", "global", "/", "backendBuckets", "/", request.backend_bucket(), "/", - "deleteSignedUrlKey"))); + "deleteSignedUrlKey"), + std::move(query_params))); }, std::move(p), service_, @@ -186,13 +202,17 @@ DefaultBackendBucketsRestStub::DeleteSignedUrlKey( Options const& options, google::cloud::cpp::compute::backend_buckets::v1:: DeleteSignedUrlKeyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "backendBuckets", "/", request.backend_bucket(), "/", - "deleteSignedUrlKey")); + "deleteSignedUrlKey"), + std::move(query_params)); } StatusOr @@ -201,12 +221,16 @@ DefaultBackendBucketsRestStub::GetBackendBucket( Options const& options, google::cloud::cpp::compute::backend_buckets::v1:: GetBackendBucketRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "backendBuckets", "/", request.backend_bucket())); + "backendBuckets", "/", request.backend_bucket()), + std::move(query_params)); } StatusOr @@ -215,6 +239,12 @@ DefaultBackendBucketsRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::backend_buckets::v1::GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -222,9 +252,7 @@ DefaultBackendBucketsRestStub::GetIamPolicy( "projects", "/", request.project(), "/", "global", "/", "backendBuckets", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } future> @@ -239,6 +267,10 @@ DefaultBackendBucketsRestStub::AsyncInsertBackendBucket( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.backend_bucket_resource(), @@ -247,8 +279,7 @@ DefaultBackendBucketsRestStub::AsyncInsertBackendBucket( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "backendBuckets"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -267,14 +298,17 @@ DefaultBackendBucketsRestStub::InsertBackendBucket( Options const& options, google::cloud::cpp::compute::backend_buckets::v1:: InsertBackendBucketRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.backend_bucket_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "backendBuckets"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -283,19 +317,23 @@ DefaultBackendBucketsRestStub::ListBackendBuckets( Options const& options, google::cloud::cpp::compute::backend_buckets::v1:: ListBackendBucketsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "backendBuckets"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -310,6 +348,10 @@ DefaultBackendBucketsRestStub::AsyncPatchBackendBucket( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.backend_bucket_resource(), @@ -319,8 +361,7 @@ DefaultBackendBucketsRestStub::AsyncPatchBackendBucket( "/", "projects", "/", request.project(), "/", "global", "/", "backendBuckets", "/", request.backend_bucket()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -339,14 +380,17 @@ DefaultBackendBucketsRestStub::PatchBackendBucket( Options const& options, google::cloud::cpp::compute::backend_buckets::v1:: PatchBackendBucketRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.backend_bucket_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "backendBuckets", "/", request.backend_bucket()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -361,6 +405,10 @@ DefaultBackendBucketsRestStub::AsyncSetEdgeSecurityPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -371,8 +419,7 @@ DefaultBackendBucketsRestStub::AsyncSetEdgeSecurityPolicy( "global", "/", "backendBuckets", "/", request.backend_bucket(), "/", "setEdgeSecurityPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -391,6 +438,10 @@ DefaultBackendBucketsRestStub::SetEdgeSecurityPolicy( Options const& options, google::cloud::cpp::compute::backend_buckets::v1:: SetEdgeSecurityPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.security_policy_reference_resource(), false, @@ -399,8 +450,7 @@ DefaultBackendBucketsRestStub::SetEdgeSecurityPolicy( "projects", "/", request.project(), "/", "global", "/", "backendBuckets", "/", request.backend_bucket(), "/", "setEdgeSecurityPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -409,6 +459,9 @@ DefaultBackendBucketsRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::backend_buckets::v1::SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_policy_request_resource(), false, @@ -416,7 +469,8 @@ DefaultBackendBucketsRestStub::SetIamPolicy( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "backendBuckets", "/", request.resource(), "/", - "setIamPolicy")); + "setIamPolicy"), + std::move(query_params)); } StatusOr @@ -425,6 +479,9 @@ DefaultBackendBucketsRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::backend_buckets::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -433,7 +490,8 @@ DefaultBackendBucketsRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "backendBuckets", "/", request.resource(), "/", - "testIamPermissions")); + "testIamPermissions"), + std::move(query_params)); } future> @@ -448,6 +506,10 @@ DefaultBackendBucketsRestStub::AsyncUpdateBackendBucket( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Put( *service, *rest_context, request.backend_bucket_resource(), @@ -457,8 +519,7 @@ DefaultBackendBucketsRestStub::AsyncUpdateBackendBucket( "/", "projects", "/", request.project(), "/", "global", "/", "backendBuckets", "/", request.backend_bucket()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -477,14 +538,17 @@ DefaultBackendBucketsRestStub::UpdateBackendBucket( Options const& options, google::cloud::cpp::compute::backend_buckets::v1:: UpdateBackendBucketRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.backend_bucket_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "backendBuckets", "/", request.backend_bucket()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.cc b/google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.cc index 66dd93407fe27..3d25a60d72a0e 100644 --- a/google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.cc +++ b/google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.cc @@ -57,6 +57,10 @@ DefaultBackendServicesRestStub::AsyncAddSignedUrlKey( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.signed_url_key_resource(), @@ -66,8 +70,7 @@ DefaultBackendServicesRestStub::AsyncAddSignedUrlKey( "/", "projects", "/", request.project(), "/", "global", "/", "backendServices", "/", request.backend_service(), "/", "addSignedUrlKey"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -86,6 +89,10 @@ DefaultBackendServicesRestStub::AddSignedUrlKey( Options const& options, google::cloud::cpp::compute::backend_services::v1:: AddSignedUrlKeyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.signed_url_key_resource(), false, absl::StrCat("/", "compute", "/", @@ -93,8 +100,7 @@ DefaultBackendServicesRestStub::AddSignedUrlKey( "projects", "/", request.project(), "/", "global", "/", "backendServices", "/", request.backend_service(), "/", "addSignedUrlKey"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -103,6 +109,20 @@ DefaultBackendServicesRestStub::AggregatedListBackendServices( Options const& options, google::cloud::cpp::compute::backend_services::v1:: AggregatedListBackendServicesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::BackendServiceAggregatedList>( *service_, rest_context, request, false, @@ -110,17 +130,7 @@ DefaultBackendServicesRestStub::AggregatedListBackendServices( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "backendServices"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -135,6 +145,10 @@ DefaultBackendServicesRestStub::AsyncDeleteBackendService( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -143,8 +157,7 @@ DefaultBackendServicesRestStub::AsyncDeleteBackendService( "/", "projects", "/", request.project(), "/", "global", "/", "backendServices", "/", request.backend_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -163,14 +176,17 @@ DefaultBackendServicesRestStub::DeleteBackendService( Options const& options, google::cloud::cpp::compute::backend_services::v1:: DeleteBackendServiceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "backendServices", "/", request.backend_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -185,6 +201,9 @@ DefaultBackendServicesRestStub::AsyncDeleteSignedUrlKey( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -193,7 +212,8 @@ DefaultBackendServicesRestStub::AsyncDeleteSignedUrlKey( "/", "projects", "/", request.project(), "/", "global", "/", "backendServices", "/", request.backend_service(), "/", - "deleteSignedUrlKey"))); + "deleteSignedUrlKey"), + std::move(query_params))); }, std::move(p), service_, @@ -212,13 +232,17 @@ DefaultBackendServicesRestStub::DeleteSignedUrlKey( Options const& options, google::cloud::cpp::compute::backend_services::v1:: DeleteSignedUrlKeyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "backendServices", "/", request.backend_service(), "/", - "deleteSignedUrlKey")); + "deleteSignedUrlKey"), + std::move(query_params)); } StatusOr @@ -227,12 +251,16 @@ DefaultBackendServicesRestStub::GetBackendService( Options const& options, google::cloud::cpp::compute::backend_services::v1:: GetBackendServiceRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "backendServices", "/", request.backend_service())); + "backendServices", "/", request.backend_service()), + std::move(query_params)); } StatusOr @@ -241,6 +269,9 @@ DefaultBackendServicesRestStub::GetHealth( Options const& options, google::cloud::cpp::compute::backend_services::v1::GetHealthRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::BackendServiceGroupHealth>( *service_, rest_context, request.resource_group_reference_resource(), @@ -249,7 +280,8 @@ DefaultBackendServicesRestStub::GetHealth( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "backendServices", "/", request.backend_service(), "/", - "getHealth")); + "getHealth"), + std::move(query_params)); } StatusOr @@ -258,6 +290,12 @@ DefaultBackendServicesRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::backend_services::v1:: GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -265,9 +303,7 @@ DefaultBackendServicesRestStub::GetIamPolicy( "projects", "/", request.project(), "/", "global", "/", "backendServices", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } future> @@ -282,6 +318,10 @@ DefaultBackendServicesRestStub::AsyncInsertBackendService( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.backend_service_resource(), @@ -290,8 +330,7 @@ DefaultBackendServicesRestStub::AsyncInsertBackendService( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "backendServices"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -310,14 +349,17 @@ DefaultBackendServicesRestStub::InsertBackendService( Options const& options, google::cloud::cpp::compute::backend_services::v1:: InsertBackendServiceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.backend_service_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "backendServices"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -326,6 +368,16 @@ DefaultBackendServicesRestStub::ListBackendServices( Options const& options, google::cloud::cpp::compute::backend_services::v1:: ListBackendServicesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::BackendServiceList>( *service_, rest_context, request, false, @@ -333,13 +385,7 @@ DefaultBackendServicesRestStub::ListBackendServices( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "backendServices"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -348,6 +394,16 @@ DefaultBackendServicesRestStub::ListUsable( Options const& options, google::cloud::cpp::compute::backend_services::v1::ListUsableRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::BackendServiceListUsable>( *service_, rest_context, request, false, @@ -355,13 +411,7 @@ DefaultBackendServicesRestStub::ListUsable( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "backendServices", "/", "listUsable"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -376,6 +426,10 @@ DefaultBackendServicesRestStub::AsyncPatchBackendService( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.backend_service_resource(), @@ -385,8 +439,7 @@ DefaultBackendServicesRestStub::AsyncPatchBackendService( "/", "projects", "/", request.project(), "/", "global", "/", "backendServices", "/", request.backend_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -405,14 +458,17 @@ DefaultBackendServicesRestStub::PatchBackendService( Options const& options, google::cloud::cpp::compute::backend_services::v1:: PatchBackendServiceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.backend_service_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "backendServices", "/", request.backend_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -427,6 +483,10 @@ DefaultBackendServicesRestStub::AsyncSetEdgeSecurityPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -437,8 +497,7 @@ DefaultBackendServicesRestStub::AsyncSetEdgeSecurityPolicy( "global", "/", "backendServices", "/", request.backend_service(), "/", "setEdgeSecurityPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -457,6 +516,10 @@ DefaultBackendServicesRestStub::SetEdgeSecurityPolicy( Options const& options, google::cloud::cpp::compute::backend_services::v1:: SetEdgeSecurityPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.security_policy_reference_resource(), false, @@ -465,8 +528,7 @@ DefaultBackendServicesRestStub::SetEdgeSecurityPolicy( "projects", "/", request.project(), "/", "global", "/", "backendServices", "/", request.backend_service(), "/", "setEdgeSecurityPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -475,6 +537,9 @@ DefaultBackendServicesRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::backend_services::v1:: SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_policy_request_resource(), false, @@ -482,7 +547,8 @@ DefaultBackendServicesRestStub::SetIamPolicy( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "backendServices", "/", request.resource(), "/", - "setIamPolicy")); + "setIamPolicy"), + std::move(query_params)); } future> @@ -497,6 +563,10 @@ DefaultBackendServicesRestStub::AsyncSetSecurityPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -507,8 +577,7 @@ DefaultBackendServicesRestStub::AsyncSetSecurityPolicy( "global", "/", "backendServices", "/", request.backend_service(), "/", "setSecurityPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -527,6 +596,10 @@ DefaultBackendServicesRestStub::SetSecurityPolicy( Options const& options, google::cloud::cpp::compute::backend_services::v1:: SetSecurityPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.security_policy_reference_resource(), false, @@ -535,8 +608,7 @@ DefaultBackendServicesRestStub::SetSecurityPolicy( "projects", "/", request.project(), "/", "global", "/", "backendServices", "/", request.backend_service(), "/", "setSecurityPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -545,6 +617,9 @@ DefaultBackendServicesRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::backend_services::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -553,7 +628,8 @@ DefaultBackendServicesRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "backendServices", "/", request.resource(), "/", - "testIamPermissions")); + "testIamPermissions"), + std::move(query_params)); } future> @@ -568,6 +644,10 @@ DefaultBackendServicesRestStub::AsyncUpdateBackendService( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Put( *service, *rest_context, request.backend_service_resource(), @@ -577,8 +657,7 @@ DefaultBackendServicesRestStub::AsyncUpdateBackendService( "/", "projects", "/", request.project(), "/", "global", "/", "backendServices", "/", request.backend_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -597,14 +676,17 @@ DefaultBackendServicesRestStub::UpdateBackendService( Options const& options, google::cloud::cpp::compute::backend_services::v1:: UpdateBackendServiceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.backend_service_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "backendServices", "/", request.backend_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.cc b/google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.cc index 4852484b7ea75..0b562e7ed4b70 100644 --- a/google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.cc +++ b/google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.cc @@ -45,6 +45,20 @@ DefaultDiskTypesRestStub::AggregatedListDiskTypes( Options const& options, google::cloud::cpp::compute::disk_types::v1:: AggregatedListDiskTypesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::DiskTypeAggregatedList>( *service_, rest_context, request, false, @@ -52,17 +66,7 @@ DefaultDiskTypesRestStub::AggregatedListDiskTypes( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "diskTypes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } StatusOr @@ -71,12 +75,16 @@ DefaultDiskTypesRestStub::GetDiskType( Options const& options, google::cloud::cpp::compute::disk_types::v1::GetDiskTypeRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", - request.zone(), "/", "diskTypes", "/", request.disk_type())); + request.zone(), "/", "diskTypes", "/", request.disk_type()), + std::move(query_params)); } StatusOr @@ -85,19 +93,23 @@ DefaultDiskTypesRestStub::ListDiskTypes( Options const& options, google::cloud::cpp::compute::disk_types::v1::ListDiskTypesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "diskTypes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/compute/disks/v1/internal/disks_rest_stub.cc b/google/cloud/compute/disks/v1/internal/disks_rest_stub.cc index add7bc998543e..ae6c1633d6e7e 100644 --- a/google/cloud/compute/disks/v1/internal/disks_rest_stub.cc +++ b/google/cloud/compute/disks/v1/internal/disks_rest_stub.cc @@ -57,6 +57,10 @@ DefaultDisksRestStub::AsyncAddResourcePolicies( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -66,8 +70,7 @@ DefaultDisksRestStub::AsyncAddResourcePolicies( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.disk(), "/", "addResourcePolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -86,6 +89,10 @@ DefaultDisksRestStub::AddResourcePolicies( Options const& options, google::cloud::cpp::compute::disks::v1::AddResourcePoliciesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.disks_add_resource_policies_request_resource(), false, @@ -94,8 +101,7 @@ DefaultDisksRestStub::AddResourcePolicies( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.disk(), "/", "addResourcePolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -104,6 +110,20 @@ DefaultDisksRestStub::AggregatedListDisks( Options const& options, google::cloud::cpp::compute::disks::v1::AggregatedListDisksRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::DiskAggregatedList>( *service_, rest_context, request, false, @@ -111,17 +131,7 @@ DefaultDisksRestStub::AggregatedListDisks( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "disks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -135,6 +145,10 @@ DefaultDisksRestStub::AsyncBulkInsert( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.bulk_insert_disk_resource(), @@ -144,8 +158,7 @@ DefaultDisksRestStub::AsyncBulkInsert( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", "bulkInsert"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -163,14 +176,17 @@ DefaultDisksRestStub::BulkInsert( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::disks::v1::BulkInsertRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.bulk_insert_disk_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", "bulkInsert"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -185,6 +201,12 @@ DefaultDisksRestStub::AsyncCreateSnapshot( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"guest_flush", (request.guest_flush() ? "1" : "0")}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.snapshot_resource(), false, @@ -193,10 +215,7 @@ DefaultDisksRestStub::AsyncCreateSnapshot( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.disk(), "/", "createSnapshot"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("guest_flush", - (request.guest_flush() ? "1" : "0")), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -215,6 +234,11 @@ DefaultDisksRestStub::CreateSnapshot( Options const& options, google::cloud::cpp::compute::disks::v1::CreateSnapshotRequest const& request) { + std::vector> query_params; + query_params.push_back({"guest_flush", (request.guest_flush() ? "1" : "0")}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.snapshot_resource(), false, absl::StrCat("/", "compute", "/", @@ -222,9 +246,7 @@ DefaultDisksRestStub::CreateSnapshot( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.disk(), "/", "createSnapshot"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("guest_flush", (request.guest_flush() ? "1" : "0")), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -238,6 +260,10 @@ DefaultDisksRestStub::AsyncDeleteDisk( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -246,8 +272,7 @@ DefaultDisksRestStub::AsyncDeleteDisk( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.disk()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -265,26 +290,33 @@ DefaultDisksRestStub::DeleteDisk( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::disks::v1::DeleteDiskRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.disk()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr DefaultDisksRestStub::GetDisk( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::disks::v1::GetDiskRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", - request.zone(), "/", "disks", "/", request.disk())); + request.zone(), "/", "disks", "/", request.disk()), + std::move(query_params)); } StatusOr @@ -293,6 +325,12 @@ DefaultDisksRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::disks::v1::GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -300,9 +338,7 @@ DefaultDisksRestStub::GetIamPolicy( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } future> @@ -316,6 +352,11 @@ DefaultDisksRestStub::AsyncInsertDisk( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"source_image", request.source_image()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.disk_resource(), false, @@ -323,9 +364,7 @@ DefaultDisksRestStub::AsyncInsertDisk( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("source_image", request.source_image())}))); + std::move(query_params))); }, std::move(p), service_, @@ -343,15 +382,18 @@ DefaultDisksRestStub::InsertDisk( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::disks::v1::InsertDiskRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"source_image", request.source_image()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.disk_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("source_image", request.source_image())})); + std::move(query_params)); } StatusOr @@ -359,19 +401,23 @@ DefaultDisksRestStub::ListDisks( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::disks::v1::ListDisksRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -386,6 +432,10 @@ DefaultDisksRestStub::AsyncRemoveResourcePolicies( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -396,8 +446,7 @@ DefaultDisksRestStub::AsyncRemoveResourcePolicies( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.disk(), "/", "removeResourcePolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -416,6 +465,10 @@ DefaultDisksRestStub::RemoveResourcePolicies( Options const& options, google::cloud::cpp::compute::disks::v1::RemoveResourcePoliciesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.disks_remove_resource_policies_request_resource(), false, @@ -424,8 +477,7 @@ DefaultDisksRestStub::RemoveResourcePolicies( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.disk(), "/", "removeResourcePolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -439,6 +491,10 @@ DefaultDisksRestStub::AsyncResize( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -448,8 +504,7 @@ DefaultDisksRestStub::AsyncResize( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.disk(), "/", "resize"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -467,6 +522,10 @@ DefaultDisksRestStub::Resize( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::disks::v1::ResizeRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.disks_resize_request_resource(), false, absl::StrCat("/", "compute", "/", @@ -474,8 +533,7 @@ DefaultDisksRestStub::Resize( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.disk(), "/", "resize"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -484,6 +542,9 @@ DefaultDisksRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::disks::v1::SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.zone_set_policy_request_resource(), false, @@ -491,7 +552,8 @@ DefaultDisksRestStub::SetIamPolicy( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.resource(), "/", - "setIamPolicy")); + "setIamPolicy"), + std::move(query_params)); } future> @@ -505,6 +567,10 @@ DefaultDisksRestStub::AsyncSetLabels( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -514,8 +580,7 @@ DefaultDisksRestStub::AsyncSetLabels( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.resource(), "/", "setLabels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -533,6 +598,10 @@ DefaultDisksRestStub::SetLabels( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::disks::v1::SetLabelsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.zone_set_labels_request_resource(), false, @@ -541,8 +610,7 @@ DefaultDisksRestStub::SetLabels( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.resource(), "/", "setLabels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -557,6 +625,10 @@ DefaultDisksRestStub::AsyncStartAsyncReplication( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -566,8 +638,7 @@ DefaultDisksRestStub::AsyncStartAsyncReplication( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.disk(), "/", "startAsyncReplication"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -586,6 +657,10 @@ DefaultDisksRestStub::StartAsyncReplication( Options const& options, google::cloud::cpp::compute::disks::v1::StartAsyncReplicationRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.disks_start_async_replication_request_resource(), false, @@ -594,8 +669,7 @@ DefaultDisksRestStub::StartAsyncReplication( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.disk(), "/", "startAsyncReplication"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -610,6 +684,9 @@ DefaultDisksRestStub::AsyncStopAsyncReplication( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -617,7 +694,8 @@ DefaultDisksRestStub::AsyncStopAsyncReplication( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", - request.disk(), "/", "stopAsyncReplication"))); + request.disk(), "/", "stopAsyncReplication"), + std::move(query_params))); }, std::move(p), service_, @@ -636,13 +714,17 @@ DefaultDisksRestStub::StopAsyncReplication( Options const& options, google::cloud::cpp::compute::disks::v1::StopAsyncReplicationRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.disk(), "/", - "stopAsyncReplication")); + "stopAsyncReplication"), + std::move(query_params)); } future> @@ -657,6 +739,10 @@ DefaultDisksRestStub::AsyncStopGroupAsyncReplication( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -666,8 +752,7 @@ DefaultDisksRestStub::AsyncStopGroupAsyncReplication( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", "stopGroupAsyncReplication"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -686,6 +771,10 @@ DefaultDisksRestStub::StopGroupAsyncReplication( Options const& options, google::cloud::cpp::compute::disks::v1:: StopGroupAsyncReplicationRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.disks_stop_group_async_replication_resource(), false, @@ -694,8 +783,7 @@ DefaultDisksRestStub::StopGroupAsyncReplication( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", "stopGroupAsyncReplication"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -704,6 +792,9 @@ DefaultDisksRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::disks::v1::TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -712,7 +803,8 @@ DefaultDisksRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.resource(), "/", - "testIamPermissions")); + "testIamPermissions"), + std::move(query_params)); } future> @@ -726,6 +818,12 @@ DefaultDisksRestStub::AsyncUpdateDisk( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"paths", request.paths()}); + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.disk_resource(), false, @@ -734,10 +832,7 @@ DefaultDisksRestStub::AsyncUpdateDisk( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.disk()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("paths", request.paths()), - std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())}))); + std::move(query_params))); }, std::move(p), service_, @@ -755,16 +850,19 @@ DefaultDisksRestStub::UpdateDisk( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::disks::v1::UpdateDiskRequest const& request) { + std::vector> query_params; + query_params.push_back({"paths", request.paths()}); + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.disk_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "disks", "/", request.disk()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("paths", request.paths()), - std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.cc b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.cc index fb91a3541b016..1a342cb3255fa 100644 --- a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.cc +++ b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.cc @@ -59,6 +59,10 @@ DefaultExternalVpnGatewaysRestStub::AsyncDeleteExternalVpnGateway( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -67,8 +71,7 @@ DefaultExternalVpnGatewaysRestStub::AsyncDeleteExternalVpnGateway( "/", "projects", "/", request.project(), "/", "global", "/", "externalVpnGateways", "/", request.external_vpn_gateway()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -87,14 +90,17 @@ DefaultExternalVpnGatewaysRestStub::DeleteExternalVpnGateway( Options const& options, google::cloud::cpp::compute::external_vpn_gateways::v1:: DeleteExternalVpnGatewayRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "externalVpnGateways", "/", request.external_vpn_gateway()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -103,13 +109,17 @@ DefaultExternalVpnGatewaysRestStub::GetExternalVpnGateway( Options const& options, google::cloud::cpp::compute::external_vpn_gateways::v1:: GetExternalVpnGatewayRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::ExternalVpnGateway>( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "externalVpnGateways", "/", request.external_vpn_gateway())); + "externalVpnGateways", "/", request.external_vpn_gateway()), + std::move(query_params)); } future> @@ -124,6 +134,10 @@ DefaultExternalVpnGatewaysRestStub::AsyncInsertExternalVpnGateway( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -132,8 +146,7 @@ DefaultExternalVpnGatewaysRestStub::AsyncInsertExternalVpnGateway( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "externalVpnGateways"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -152,14 +165,17 @@ DefaultExternalVpnGatewaysRestStub::InsertExternalVpnGateway( Options const& options, google::cloud::cpp::compute::external_vpn_gateways::v1:: InsertExternalVpnGatewayRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.external_vpn_gateway_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "externalVpnGateways"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -168,6 +184,16 @@ DefaultExternalVpnGatewaysRestStub::ListExternalVpnGateways( Options const& options, google::cloud::cpp::compute::external_vpn_gateways::v1:: ListExternalVpnGatewaysRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::ExternalVpnGatewayList>( *service_, rest_context, request, false, @@ -175,13 +201,7 @@ DefaultExternalVpnGatewaysRestStub::ListExternalVpnGateways( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "externalVpnGateways"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -196,6 +216,9 @@ DefaultExternalVpnGatewaysRestStub::AsyncSetLabels( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -204,7 +227,8 @@ DefaultExternalVpnGatewaysRestStub::AsyncSetLabels( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "externalVpnGateways", "/", - request.resource(), "/", "setLabels"))); + request.resource(), "/", "setLabels"), + std::move(query_params))); }, std::move(p), service_, @@ -223,6 +247,9 @@ DefaultExternalVpnGatewaysRestStub::SetLabels( Options const& options, google::cloud::cpp::compute::external_vpn_gateways::v1:: SetLabelsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_labels_request_resource(), false, @@ -230,7 +257,8 @@ DefaultExternalVpnGatewaysRestStub::SetLabels( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "externalVpnGateways", "/", request.resource(), "/", - "setLabels")); + "setLabels"), + std::move(query_params)); } StatusOr @@ -239,6 +267,9 @@ DefaultExternalVpnGatewaysRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::external_vpn_gateways::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -247,7 +278,8 @@ DefaultExternalVpnGatewaysRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "externalVpnGateways", "/", request.resource(), "/", - "testIamPermissions")); + "testIamPermissions"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.cc b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.cc index ebdbcfeff963b..19d6f491db3e0 100644 --- a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.cc +++ b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.cc @@ -58,6 +58,13 @@ DefaultFirewallPoliciesRestStub::AsyncAddAssociation( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"replace_existing_association", + (request.replace_existing_association() ? "1" : "0")}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -67,11 +74,7 @@ DefaultFirewallPoliciesRestStub::AsyncAddAssociation( "/", "locations", "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", "addAssociation"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair( - "replace_existing_association", - (request.replace_existing_association() ? "1" : "0")), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -90,6 +93,13 @@ DefaultFirewallPoliciesRestStub::AddAssociation( Options const& options, google::cloud::cpp::compute::firewall_policies::v1:: AddAssociationRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"replace_existing_association", + (request.replace_existing_association() ? "1" : "0")}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.firewall_policy_association_resource(), false, @@ -97,10 +107,7 @@ DefaultFirewallPoliciesRestStub::AddAssociation( rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", "addAssociation"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("replace_existing_association", - (request.replace_existing_association() ? "1" : "0")), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -115,6 +122,10 @@ DefaultFirewallPoliciesRestStub::AsyncAddRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -124,8 +135,7 @@ DefaultFirewallPoliciesRestStub::AsyncAddRule( "/", "locations", "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", "addRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -144,14 +154,17 @@ DefaultFirewallPoliciesRestStub::AddRule( Options const& options, google::cloud::cpp::compute::firewall_policies::v1::AddRuleRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.firewall_policy_rule_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", "addRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -166,6 +179,9 @@ DefaultFirewallPoliciesRestStub::AsyncCloneRules( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -173,7 +189,8 @@ DefaultFirewallPoliciesRestStub::AsyncCloneRules( rest_internal::DetermineApiVersion("v1", *options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), - "/", "cloneRules"))); + "/", "cloneRules"), + std::move(query_params))); }, std::move(p), service_, @@ -192,12 +209,16 @@ DefaultFirewallPoliciesRestStub::CloneRules( Options const& options, google::cloud::cpp::compute::firewall_policies::v1::CloneRulesRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", - request.firewall_policy(), "/", "cloneRules")); + request.firewall_policy(), "/", "cloneRules"), + std::move(query_params)); } future> @@ -212,6 +233,10 @@ DefaultFirewallPoliciesRestStub::AsyncDeleteFirewallPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -220,8 +245,7 @@ DefaultFirewallPoliciesRestStub::AsyncDeleteFirewallPolicy( "/", "locations", "/", "global", "/", "firewallPolicies", "/", request.firewall_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -240,14 +264,17 @@ DefaultFirewallPoliciesRestStub::DeleteFirewallPolicy( Options const& options, google::cloud::cpp::compute::firewall_policies::v1:: DeleteFirewallPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", request.firewall_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -256,12 +283,16 @@ DefaultFirewallPoliciesRestStub::GetFirewallPolicy( Options const& options, google::cloud::cpp::compute::firewall_policies::v1:: GetFirewallPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", - request.firewall_policy())); + request.firewall_policy()), + std::move(query_params)); } StatusOr @@ -270,6 +301,10 @@ DefaultFirewallPoliciesRestStub::GetAssociation( Options const& options, google::cloud::cpp::compute::firewall_policies::v1:: GetAssociationRequest const& request) { + std::vector> query_params; + query_params.push_back({"name", request.name()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::FirewallPolicyAssociation>( *service_, rest_context, request, false, @@ -277,8 +312,7 @@ DefaultFirewallPoliciesRestStub::GetAssociation( rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", "getAssociation"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("name", request.name())})); + std::move(query_params)); } StatusOr @@ -287,15 +321,19 @@ DefaultFirewallPoliciesRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::firewall_policies::v1:: GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } StatusOr @@ -304,6 +342,10 @@ DefaultFirewallPoliciesRestStub::GetRule( Options const& options, google::cloud::cpp::compute::firewall_policies::v1::GetRuleRequest const& request) { + std::vector> query_params; + query_params.push_back({"priority", std::to_string(request.priority())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::FirewallPolicyRule>( *service_, rest_context, request, false, @@ -311,8 +353,7 @@ DefaultFirewallPoliciesRestStub::GetRule( rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", "getRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("priority", std::to_string(request.priority()))})); + std::move(query_params)); } future> @@ -327,6 +368,11 @@ DefaultFirewallPoliciesRestStub::AsyncInsertFirewallPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"parent_id", request.parent_id()}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.firewall_policy_resource(), @@ -335,9 +381,7 @@ DefaultFirewallPoliciesRestStub::AsyncInsertFirewallPolicy( rest_internal::DetermineApiVersion("v1", *options), "/", "locations", "/", "global", "/", "firewallPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("parent_id", request.parent_id()), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -356,14 +400,17 @@ DefaultFirewallPoliciesRestStub::InsertFirewallPolicy( Options const& options, google::cloud::cpp::compute::firewall_policies::v1:: InsertFirewallPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"parent_id", request.parent_id()}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.firewall_policy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "firewallPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("parent_id", request.parent_id()), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -372,20 +419,24 @@ DefaultFirewallPoliciesRestStub::ListFirewallPolicies( Options const& options, google::cloud::cpp::compute::firewall_policies::v1:: ListFirewallPoliciesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"parent_id", request.parent_id()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::FirewallPolicyList>( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "firewallPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("parent_id", request.parent_id()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr< @@ -395,6 +446,10 @@ DefaultFirewallPoliciesRestStub::ListAssociations( Options const& options, google::cloud::cpp::compute::firewall_policies::v1:: ListAssociationsRequest const& request) { + std::vector> query_params; + query_params.push_back({"target_resource", request.target_resource()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, @@ -402,8 +457,7 @@ DefaultFirewallPoliciesRestStub::ListAssociations( rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", "listAssociations"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("target_resource", request.target_resource())})); + std::move(query_params)); } future> @@ -418,6 +472,9 @@ DefaultFirewallPoliciesRestStub::AsyncMove( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -425,7 +482,8 @@ DefaultFirewallPoliciesRestStub::AsyncMove( rest_internal::DetermineApiVersion("v1", *options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), - "/", "move"))); + "/", "move"), + std::move(query_params))); }, std::move(p), service_, @@ -444,12 +502,16 @@ DefaultFirewallPoliciesRestStub::Move( Options const& options, google::cloud::cpp::compute::firewall_policies::v1::MoveRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", - request.firewall_policy(), "/", "move")); + request.firewall_policy(), "/", "move"), + std::move(query_params)); } future> @@ -464,6 +526,10 @@ DefaultFirewallPoliciesRestStub::AsyncPatchFirewallPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.firewall_policy_resource(), @@ -473,8 +539,7 @@ DefaultFirewallPoliciesRestStub::AsyncPatchFirewallPolicy( "/", "locations", "/", "global", "/", "firewallPolicies", "/", request.firewall_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -493,14 +558,17 @@ DefaultFirewallPoliciesRestStub::PatchFirewallPolicy( Options const& options, google::cloud::cpp::compute::firewall_policies::v1:: PatchFirewallPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.firewall_policy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", request.firewall_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -515,6 +583,12 @@ DefaultFirewallPoliciesRestStub::AsyncPatchRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"priority", std::to_string(request.priority())}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -524,10 +598,7 @@ DefaultFirewallPoliciesRestStub::AsyncPatchRule( "/", "locations", "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", "patchRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("priority", - std::to_string(request.priority())), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -546,15 +617,18 @@ DefaultFirewallPoliciesRestStub::PatchRule( Options const& options, google::cloud::cpp::compute::firewall_policies::v1::PatchRuleRequest const& request) { + std::vector> query_params; + query_params.push_back({"priority", std::to_string(request.priority())}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.firewall_policy_rule_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", "patchRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("priority", std::to_string(request.priority())), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -569,6 +643,9 @@ DefaultFirewallPoliciesRestStub::AsyncRemoveAssociation( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -576,7 +653,8 @@ DefaultFirewallPoliciesRestStub::AsyncRemoveAssociation( rest_internal::DetermineApiVersion("v1", *options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), - "/", "removeAssociation"))); + "/", "removeAssociation"), + std::move(query_params))); }, std::move(p), service_, @@ -595,12 +673,16 @@ DefaultFirewallPoliciesRestStub::RemoveAssociation( Options const& options, google::cloud::cpp::compute::firewall_policies::v1:: RemoveAssociationRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", - request.firewall_policy(), "/", "removeAssociation")); + request.firewall_policy(), "/", "removeAssociation"), + std::move(query_params)); } future> @@ -615,6 +697,9 @@ DefaultFirewallPoliciesRestStub::AsyncRemoveRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -622,7 +707,8 @@ DefaultFirewallPoliciesRestStub::AsyncRemoveRule( rest_internal::DetermineApiVersion("v1", *options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), - "/", "removeRule"))); + "/", "removeRule"), + std::move(query_params))); }, std::move(p), service_, @@ -641,12 +727,16 @@ DefaultFirewallPoliciesRestStub::RemoveRule( Options const& options, google::cloud::cpp::compute::firewall_policies::v1::RemoveRuleRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", - request.firewall_policy(), "/", "removeRule")); + request.firewall_policy(), "/", "removeRule"), + std::move(query_params)); } StatusOr @@ -655,13 +745,17 @@ DefaultFirewallPoliciesRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::firewall_policies::v1:: SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_organization_set_policy_request_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", - request.resource(), "/", "setIamPolicy")); + request.resource(), "/", "setIamPolicy"), + std::move(query_params)); } StatusOr @@ -670,6 +764,9 @@ DefaultFirewallPoliciesRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::firewall_policies::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -677,7 +774,8 @@ DefaultFirewallPoliciesRestStub::TestIamPermissions( absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "firewallPolicies", "/", - request.resource(), "/", "testIamPermissions")); + request.resource(), "/", "testIamPermissions"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.cc b/google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.cc index 7ccfb9501fa06..37942e205c949 100644 --- a/google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.cc +++ b/google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.cc @@ -57,6 +57,10 @@ DefaultFirewallsRestStub::AsyncDeleteFirewall( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -65,8 +69,7 @@ DefaultFirewallsRestStub::AsyncDeleteFirewall( "/", "projects", "/", request.project(), "/", "global", "/", "firewalls", "/", request.firewall()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -85,14 +88,17 @@ DefaultFirewallsRestStub::DeleteFirewall( Options const& options, google::cloud::cpp::compute::firewalls::v1::DeleteFirewallRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "firewalls", "/", request.firewall()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -101,12 +107,16 @@ DefaultFirewallsRestStub::GetFirewall( Options const& options, google::cloud::cpp::compute::firewalls::v1::GetFirewallRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "firewalls", "/", request.firewall())); + "firewalls", "/", request.firewall()), + std::move(query_params)); } future> @@ -121,6 +131,10 @@ DefaultFirewallsRestStub::AsyncInsertFirewall( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.firewall_resource(), false, @@ -128,8 +142,7 @@ DefaultFirewallsRestStub::AsyncInsertFirewall( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "firewalls"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -148,14 +161,17 @@ DefaultFirewallsRestStub::InsertFirewall( Options const& options, google::cloud::cpp::compute::firewalls::v1::InsertFirewallRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.firewall_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "firewalls"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -164,19 +180,23 @@ DefaultFirewallsRestStub::ListFirewalls( Options const& options, google::cloud::cpp::compute::firewalls::v1::ListFirewallsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "firewalls"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -191,6 +211,10 @@ DefaultFirewallsRestStub::AsyncPatchFirewall( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.firewall_resource(), false, @@ -199,8 +223,7 @@ DefaultFirewallsRestStub::AsyncPatchFirewall( "/", "projects", "/", request.project(), "/", "global", "/", "firewalls", "/", request.firewall()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -219,14 +242,17 @@ DefaultFirewallsRestStub::PatchFirewall( Options const& options, google::cloud::cpp::compute::firewalls::v1::PatchFirewallRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.firewall_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "firewalls", "/", request.firewall()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -241,6 +267,10 @@ DefaultFirewallsRestStub::AsyncUpdateFirewall( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Put( *service, *rest_context, request.firewall_resource(), false, @@ -249,8 +279,7 @@ DefaultFirewallsRestStub::AsyncUpdateFirewall( "/", "projects", "/", request.project(), "/", "global", "/", "firewalls", "/", request.firewall()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -269,14 +298,17 @@ DefaultFirewallsRestStub::UpdateFirewall( Options const& options, google::cloud::cpp::compute::firewalls::v1::UpdateFirewallRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.firewall_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "firewalls", "/", request.firewall()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.cc b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.cc index 96f7d0fee17bd..ee1d2050846a7 100644 --- a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.cc +++ b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.cc @@ -51,6 +51,20 @@ DefaultForwardingRulesRestStub::AggregatedListForwardingRules( Options const& options, google::cloud::cpp::compute::forwarding_rules::v1:: AggregatedListForwardingRulesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::ForwardingRuleAggregatedList>( *service_, rest_context, request, false, @@ -58,17 +72,7 @@ DefaultForwardingRulesRestStub::AggregatedListForwardingRules( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "forwardingRules"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -83,6 +87,10 @@ DefaultForwardingRulesRestStub::AsyncDeleteForwardingRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -91,8 +99,7 @@ DefaultForwardingRulesRestStub::AsyncDeleteForwardingRule( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "forwardingRules", "/", request.forwarding_rule()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -111,6 +118,10 @@ DefaultForwardingRulesRestStub::DeleteForwardingRule( Options const& options, google::cloud::cpp::compute::forwarding_rules::v1:: DeleteForwardingRuleRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -118,8 +129,7 @@ DefaultForwardingRulesRestStub::DeleteForwardingRule( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "forwardingRules", "/", request.forwarding_rule()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -128,13 +138,17 @@ DefaultForwardingRulesRestStub::GetForwardingRule( Options const& options, google::cloud::cpp::compute::forwarding_rules::v1:: GetForwardingRuleRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "forwardingRules", "/", - request.forwarding_rule())); + request.forwarding_rule()), + std::move(query_params)); } future> @@ -149,6 +163,10 @@ DefaultForwardingRulesRestStub::AsyncInsertForwardingRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.forwarding_rule_resource(), @@ -158,8 +176,7 @@ DefaultForwardingRulesRestStub::AsyncInsertForwardingRule( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "forwardingRules"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -178,14 +195,17 @@ DefaultForwardingRulesRestStub::InsertForwardingRule( Options const& options, google::cloud::cpp::compute::forwarding_rules::v1:: InsertForwardingRuleRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.forwarding_rule_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "forwardingRules"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -194,6 +214,16 @@ DefaultForwardingRulesRestStub::ListForwardingRules( Options const& options, google::cloud::cpp::compute::forwarding_rules::v1:: ListForwardingRulesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::ForwardingRuleList>( *service_, rest_context, request, false, @@ -201,13 +231,7 @@ DefaultForwardingRulesRestStub::ListForwardingRules( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "forwardingRules"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -222,6 +246,10 @@ DefaultForwardingRulesRestStub::AsyncPatchForwardingRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.forwarding_rule_resource(), @@ -231,8 +259,7 @@ DefaultForwardingRulesRestStub::AsyncPatchForwardingRule( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "forwardingRules", "/", request.forwarding_rule()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -251,6 +278,10 @@ DefaultForwardingRulesRestStub::PatchForwardingRule( Options const& options, google::cloud::cpp::compute::forwarding_rules::v1:: PatchForwardingRuleRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.forwarding_rule_resource(), false, absl::StrCat("/", "compute", "/", @@ -258,8 +289,7 @@ DefaultForwardingRulesRestStub::PatchForwardingRule( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "forwardingRules", "/", request.forwarding_rule()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -274,6 +304,10 @@ DefaultForwardingRulesRestStub::AsyncSetLabels( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -284,8 +318,7 @@ DefaultForwardingRulesRestStub::AsyncSetLabels( "regions", "/", request.region(), "/", "forwardingRules", "/", request.resource(), "/", "setLabels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -304,6 +337,10 @@ DefaultForwardingRulesRestStub::SetLabels( Options const& options, google::cloud::cpp::compute::forwarding_rules::v1::SetLabelsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_labels_request_resource(), false, @@ -312,8 +349,7 @@ DefaultForwardingRulesRestStub::SetLabels( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "forwardingRules", "/", request.resource(), "/", "setLabels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -328,6 +364,10 @@ DefaultForwardingRulesRestStub::AsyncSetTarget( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.target_reference_resource(), @@ -338,8 +378,7 @@ DefaultForwardingRulesRestStub::AsyncSetTarget( "regions", "/", request.region(), "/", "forwardingRules", "/", request.forwarding_rule(), "/", "setTarget"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -358,6 +397,10 @@ DefaultForwardingRulesRestStub::SetTarget( Options const& options, google::cloud::cpp::compute::forwarding_rules::v1::SetTargetRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_reference_resource(), false, absl::StrCat("/", "compute", "/", @@ -365,8 +408,7 @@ DefaultForwardingRulesRestStub::SetTarget( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "forwardingRules", "/", request.forwarding_rule(), "/", "setTarget"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.cc b/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.cc index 91f38ec68fd49..144f2b32a8a16 100644 --- a/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.cc +++ b/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.cc @@ -57,6 +57,10 @@ DefaultGlobalAddressesRestStub::AsyncDeleteAddress( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -65,8 +69,7 @@ DefaultGlobalAddressesRestStub::AsyncDeleteAddress( "/", "projects", "/", request.project(), "/", "global", "/", "addresses", "/", request.address()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -85,14 +88,17 @@ DefaultGlobalAddressesRestStub::DeleteAddress( Options const& options, google::cloud::cpp::compute::global_addresses::v1:: DeleteAddressRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "addresses", "/", request.address()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -101,12 +107,16 @@ DefaultGlobalAddressesRestStub::GetAddress( Options const& options, google::cloud::cpp::compute::global_addresses::v1::GetAddressRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "addresses", "/", request.address())); + "addresses", "/", request.address()), + std::move(query_params)); } future> @@ -121,6 +131,10 @@ DefaultGlobalAddressesRestStub::AsyncInsertAddress( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.address_resource(), false, @@ -128,8 +142,7 @@ DefaultGlobalAddressesRestStub::AsyncInsertAddress( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "addresses"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -148,14 +161,17 @@ DefaultGlobalAddressesRestStub::InsertAddress( Options const& options, google::cloud::cpp::compute::global_addresses::v1:: InsertAddressRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.address_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "addresses"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -164,19 +180,23 @@ DefaultGlobalAddressesRestStub::ListGlobalAddresses( Options const& options, google::cloud::cpp::compute::global_addresses::v1:: ListGlobalAddressesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "addresses"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -191,6 +211,10 @@ DefaultGlobalAddressesRestStub::AsyncMove( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -200,8 +224,7 @@ DefaultGlobalAddressesRestStub::AsyncMove( "/", "projects", "/", request.project(), "/", "global", "/", "addresses", "/", request.address(), "/", "move"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -220,6 +243,10 @@ DefaultGlobalAddressesRestStub::Move( Options const& options, google::cloud::cpp::compute::global_addresses::v1::MoveRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_addresses_move_request_resource(), false, @@ -227,8 +254,7 @@ DefaultGlobalAddressesRestStub::Move( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "addresses", "/", request.address(), "/", "move"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -243,6 +269,9 @@ DefaultGlobalAddressesRestStub::AsyncSetLabels( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -251,7 +280,8 @@ DefaultGlobalAddressesRestStub::AsyncSetLabels( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "addresses", "/", - request.resource(), "/", "setLabels"))); + request.resource(), "/", "setLabels"), + std::move(query_params))); }, std::move(p), service_, @@ -270,13 +300,17 @@ DefaultGlobalAddressesRestStub::SetLabels( Options const& options, google::cloud::cpp::compute::global_addresses::v1::SetLabelsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_labels_request_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "addresses", "/", request.resource(), "/", "setLabels")); + "addresses", "/", request.resource(), "/", "setLabels"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.cc b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.cc index 1e2b40c4709f2..3119c721da07c 100644 --- a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.cc +++ b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.cc @@ -59,6 +59,10 @@ DefaultGlobalForwardingRulesRestStub::AsyncDeleteForwardingRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -67,8 +71,7 @@ DefaultGlobalForwardingRulesRestStub::AsyncDeleteForwardingRule( "/", "projects", "/", request.project(), "/", "global", "/", "forwardingRules", "/", request.forwarding_rule()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -87,14 +90,17 @@ DefaultGlobalForwardingRulesRestStub::DeleteForwardingRule( Options const& options, google::cloud::cpp::compute::global_forwarding_rules::v1:: DeleteForwardingRuleRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "forwardingRules", "/", request.forwarding_rule()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -103,12 +109,16 @@ DefaultGlobalForwardingRulesRestStub::GetForwardingRule( Options const& options, google::cloud::cpp::compute::global_forwarding_rules::v1:: GetForwardingRuleRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "forwardingRules", "/", request.forwarding_rule())); + "forwardingRules", "/", request.forwarding_rule()), + std::move(query_params)); } future> @@ -123,6 +133,10 @@ DefaultGlobalForwardingRulesRestStub::AsyncInsertForwardingRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.forwarding_rule_resource(), @@ -131,8 +145,7 @@ DefaultGlobalForwardingRulesRestStub::AsyncInsertForwardingRule( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "forwardingRules"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -151,14 +164,17 @@ DefaultGlobalForwardingRulesRestStub::InsertForwardingRule( Options const& options, google::cloud::cpp::compute::global_forwarding_rules::v1:: InsertForwardingRuleRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.forwarding_rule_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "forwardingRules"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -167,6 +183,16 @@ DefaultGlobalForwardingRulesRestStub::ListGlobalForwardingRules( Options const& options, google::cloud::cpp::compute::global_forwarding_rules::v1:: ListGlobalForwardingRulesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::ForwardingRuleList>( *service_, rest_context, request, false, @@ -174,13 +200,7 @@ DefaultGlobalForwardingRulesRestStub::ListGlobalForwardingRules( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "forwardingRules"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -195,6 +215,10 @@ DefaultGlobalForwardingRulesRestStub::AsyncPatchForwardingRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.forwarding_rule_resource(), @@ -204,8 +228,7 @@ DefaultGlobalForwardingRulesRestStub::AsyncPatchForwardingRule( "/", "projects", "/", request.project(), "/", "global", "/", "forwardingRules", "/", request.forwarding_rule()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -224,14 +247,17 @@ DefaultGlobalForwardingRulesRestStub::PatchForwardingRule( Options const& options, google::cloud::cpp::compute::global_forwarding_rules::v1:: PatchForwardingRuleRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.forwarding_rule_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "forwardingRules", "/", request.forwarding_rule()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -246,6 +272,9 @@ DefaultGlobalForwardingRulesRestStub::AsyncSetLabels( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -254,7 +283,8 @@ DefaultGlobalForwardingRulesRestStub::AsyncSetLabels( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "forwardingRules", "/", - request.resource(), "/", "setLabels"))); + request.resource(), "/", "setLabels"), + std::move(query_params))); }, std::move(p), service_, @@ -273,6 +303,9 @@ DefaultGlobalForwardingRulesRestStub::SetLabels( Options const& options, google::cloud::cpp::compute::global_forwarding_rules::v1:: SetLabelsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_labels_request_resource(), false, @@ -280,7 +313,8 @@ DefaultGlobalForwardingRulesRestStub::SetLabels( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "forwardingRules", "/", request.resource(), "/", - "setLabels")); + "setLabels"), + std::move(query_params)); } future> @@ -295,6 +329,10 @@ DefaultGlobalForwardingRulesRestStub::AsyncSetTarget( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.target_reference_resource(), @@ -304,8 +342,7 @@ DefaultGlobalForwardingRulesRestStub::AsyncSetTarget( "/", "projects", "/", request.project(), "/", "global", "/", "forwardingRules", "/", request.forwarding_rule(), "/", "setTarget"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -324,6 +361,10 @@ DefaultGlobalForwardingRulesRestStub::SetTarget( Options const& options, google::cloud::cpp::compute::global_forwarding_rules::v1:: SetTargetRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_reference_resource(), false, absl::StrCat("/", "compute", "/", @@ -331,8 +372,7 @@ DefaultGlobalForwardingRulesRestStub::SetTarget( "projects", "/", request.project(), "/", "global", "/", "forwardingRules", "/", request.forwarding_rule(), "/", "setTarget"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.cc b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.cc index 0a86e1b3ec4a6..7f9379f8ac6b9 100644 --- a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.cc +++ b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.cc @@ -60,6 +60,10 @@ DefaultGlobalNetworkEndpointGroupsRestStub::AsyncAttachNetworkEndpoints( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -72,8 +76,7 @@ DefaultGlobalNetworkEndpointGroupsRestStub::AsyncAttachNetworkEndpoints( "/", "networkEndpointGroups", "/", request.network_endpoint_group(), "/", "attachNetworkEndpoints"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -92,6 +95,10 @@ DefaultGlobalNetworkEndpointGroupsRestStub::AttachNetworkEndpoints( Options const& options, google::cloud::cpp::compute::global_network_endpoint_groups::v1:: AttachNetworkEndpointsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request @@ -102,8 +109,7 @@ DefaultGlobalNetworkEndpointGroupsRestStub::AttachNetworkEndpoints( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "networkEndpointGroups", "/", request.network_endpoint_group(), "/", "attachNetworkEndpoints"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -118,6 +124,10 @@ DefaultGlobalNetworkEndpointGroupsRestStub::AsyncDeleteNetworkEndpointGroup( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -126,8 +136,7 @@ DefaultGlobalNetworkEndpointGroupsRestStub::AsyncDeleteNetworkEndpointGroup( "/", "projects", "/", request.project(), "/", "global", "/", "networkEndpointGroups", "/", request.network_endpoint_group()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -146,6 +155,10 @@ DefaultGlobalNetworkEndpointGroupsRestStub::DeleteNetworkEndpointGroup( Options const& options, google::cloud::cpp::compute::global_network_endpoint_groups::v1:: DeleteNetworkEndpointGroupRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -153,8 +166,7 @@ DefaultGlobalNetworkEndpointGroupsRestStub::DeleteNetworkEndpointGroup( "projects", "/", request.project(), "/", "global", "/", "networkEndpointGroups", "/", request.network_endpoint_group()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -169,6 +181,10 @@ DefaultGlobalNetworkEndpointGroupsRestStub::AsyncDetachNetworkEndpoints( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -181,8 +197,7 @@ DefaultGlobalNetworkEndpointGroupsRestStub::AsyncDetachNetworkEndpoints( "/", "networkEndpointGroups", "/", request.network_endpoint_group(), "/", "detachNetworkEndpoints"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -201,6 +216,10 @@ DefaultGlobalNetworkEndpointGroupsRestStub::DetachNetworkEndpoints( Options const& options, google::cloud::cpp::compute::global_network_endpoint_groups::v1:: DetachNetworkEndpointsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request @@ -211,8 +230,7 @@ DefaultGlobalNetworkEndpointGroupsRestStub::DetachNetworkEndpoints( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "networkEndpointGroups", "/", request.network_endpoint_group(), "/", "detachNetworkEndpoints"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -221,6 +239,9 @@ DefaultGlobalNetworkEndpointGroupsRestStub::GetNetworkEndpointGroup( Options const& options, google::cloud::cpp::compute::global_network_endpoint_groups::v1:: GetNetworkEndpointGroupRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NetworkEndpointGroup>( *service_, rest_context, request, false, @@ -228,7 +249,8 @@ DefaultGlobalNetworkEndpointGroupsRestStub::GetNetworkEndpointGroup( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "networkEndpointGroups", "/", - request.network_endpoint_group())); + request.network_endpoint_group()), + std::move(query_params)); } future> @@ -243,6 +265,10 @@ DefaultGlobalNetworkEndpointGroupsRestStub::AsyncInsertNetworkEndpointGroup( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -251,8 +277,7 @@ DefaultGlobalNetworkEndpointGroupsRestStub::AsyncInsertNetworkEndpointGroup( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "networkEndpointGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -271,14 +296,17 @@ DefaultGlobalNetworkEndpointGroupsRestStub::InsertNetworkEndpointGroup( Options const& options, google::cloud::cpp::compute::global_network_endpoint_groups::v1:: InsertNetworkEndpointGroupRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.network_endpoint_group_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "networkEndpointGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -287,6 +315,16 @@ DefaultGlobalNetworkEndpointGroupsRestStub::ListGlobalNetworkEndpointGroups( Options const& options, google::cloud::cpp::compute::global_network_endpoint_groups::v1:: ListGlobalNetworkEndpointGroupsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NetworkEndpointGroupList>( *service_, rest_context, request, false, @@ -294,13 +332,7 @@ DefaultGlobalNetworkEndpointGroupsRestStub::ListGlobalNetworkEndpointGroups( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "networkEndpointGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr< @@ -310,6 +342,9 @@ DefaultGlobalNetworkEndpointGroupsRestStub::ListNetworkEndpoints( Options const& options, google::cloud::cpp::compute::global_network_endpoint_groups::v1:: ListNetworkEndpointsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, @@ -317,7 +352,8 @@ DefaultGlobalNetworkEndpointGroupsRestStub::ListNetworkEndpoints( "/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "networkEndpointGroups", - "/", request.network_endpoint_group(), "/", "listNetworkEndpoints")); + "/", request.network_endpoint_group(), "/", "listNetworkEndpoints"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/global_operations/v1/internal/global_operations_rest_stub.cc b/google/cloud/compute/global_operations/v1/internal/global_operations_rest_stub.cc index eb086992a3d82..ce38f60c01921 100644 --- a/google/cloud/compute/global_operations/v1/internal/global_operations_rest_stub.cc +++ b/google/cloud/compute/global_operations/v1/internal/global_operations_rest_stub.cc @@ -46,6 +46,20 @@ DefaultGlobalOperationsRestStub::AggregatedListGlobalOperations( Options const& options, google::cloud::cpp::compute::global_operations::v1:: AggregatedListGlobalOperationsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::OperationAggregatedList>( *service_, rest_context, request, false, @@ -53,17 +67,7 @@ DefaultGlobalOperationsRestStub::AggregatedListGlobalOperations( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "operations"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } Status DefaultGlobalOperationsRestStub::DeleteOperation( @@ -71,12 +75,16 @@ Status DefaultGlobalOperationsRestStub::DeleteOperation( Options const& options, google::cloud::cpp::compute::global_operations::v1:: DeleteOperationRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "operations", "/", request.operation())); + "operations", "/", request.operation()), + std::move(query_params)); } StatusOr @@ -85,12 +93,16 @@ DefaultGlobalOperationsRestStub::GetOperation( Options const& options, google::cloud::cpp::compute::global_operations::v1:: GetOperationRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "operations", "/", request.operation())); + "operations", "/", request.operation()), + std::move(query_params)); } StatusOr @@ -99,19 +111,23 @@ DefaultGlobalOperationsRestStub::ListGlobalOperations( Options const& options, google::cloud::cpp::compute::global_operations::v1:: ListGlobalOperationsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "operations"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -120,12 +136,16 @@ DefaultGlobalOperationsRestStub::Wait( Options const& options, google::cloud::cpp::compute::global_operations::v1::WaitRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "operations", "/", request.operation(), "/", "wait")); + "operations", "/", request.operation(), "/", "wait"), + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_stub.cc b/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_stub.cc index 31921d730d2d7..6aa5cfdb5a12f 100644 --- a/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_stub.cc +++ b/google/cloud/compute/global_organization_operations/v1/internal/global_organization_operations_rest_stub.cc @@ -47,14 +47,17 @@ Status DefaultGlobalOrganizationOperationsRestStub::DeleteOperation( Options const& options, google::cloud::cpp::compute::global_organization_operations::v1:: DeleteOperationRequest const& request) { + std::vector> query_params; + query_params.push_back({"parent_id", request.parent_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "operations", "/", request.operation()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("parent_id", request.parent_id())})); + std::move(query_params)); } StatusOr @@ -63,14 +66,17 @@ DefaultGlobalOrganizationOperationsRestStub::GetOperation( Options const& options, google::cloud::cpp::compute::global_organization_operations::v1:: GetOperationRequest const& request) { + std::vector> query_params; + query_params.push_back({"parent_id", request.parent_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "operations", "/", request.operation()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("parent_id", request.parent_id())})); + std::move(query_params)); } StatusOr @@ -79,19 +85,23 @@ DefaultGlobalOrganizationOperationsRestStub::ListGlobalOrganizationOperations( Options const& options, google::cloud::cpp::compute::global_organization_operations::v1:: ListGlobalOrganizationOperationsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"parent_id", request.parent_id()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "locations", "/", "global", "/", "operations"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("parent_id", request.parent_id()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.cc b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.cc index 0b66e51ed77bb..6eb8590eb5705 100644 --- a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.cc +++ b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.cc @@ -60,6 +60,10 @@ DefaultGlobalPublicDelegatedPrefixesRestStub::AsyncDeletePublicDelegatedPrefix( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -68,8 +72,7 @@ DefaultGlobalPublicDelegatedPrefixesRestStub::AsyncDeletePublicDelegatedPrefix( "/", "projects", "/", request.project(), "/", "global", "/", "publicDelegatedPrefixes", "/", request.public_delegated_prefix()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -88,6 +91,10 @@ DefaultGlobalPublicDelegatedPrefixesRestStub::DeletePublicDelegatedPrefix( Options const& options, google::cloud::cpp::compute::global_public_delegated_prefixes::v1:: DeletePublicDelegatedPrefixRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -95,8 +102,7 @@ DefaultGlobalPublicDelegatedPrefixesRestStub::DeletePublicDelegatedPrefix( "projects", "/", request.project(), "/", "global", "/", "publicDelegatedPrefixes", "/", request.public_delegated_prefix()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -105,6 +111,9 @@ DefaultGlobalPublicDelegatedPrefixesRestStub::GetPublicDelegatedPrefix( Options const& options, google::cloud::cpp::compute::global_public_delegated_prefixes::v1:: GetPublicDelegatedPrefixRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::PublicDelegatedPrefix>( *service_, rest_context, request, false, @@ -112,7 +121,8 @@ DefaultGlobalPublicDelegatedPrefixesRestStub::GetPublicDelegatedPrefix( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "publicDelegatedPrefixes", "/", - request.public_delegated_prefix())); + request.public_delegated_prefix()), + std::move(query_params)); } future> @@ -127,6 +137,10 @@ DefaultGlobalPublicDelegatedPrefixesRestStub::AsyncInsertPublicDelegatedPrefix( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -135,8 +149,7 @@ DefaultGlobalPublicDelegatedPrefixesRestStub::AsyncInsertPublicDelegatedPrefix( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "publicDelegatedPrefixes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -155,6 +168,10 @@ DefaultGlobalPublicDelegatedPrefixesRestStub::InsertPublicDelegatedPrefix( Options const& options, google::cloud::cpp::compute::global_public_delegated_prefixes::v1:: InsertPublicDelegatedPrefixRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.public_delegated_prefix_resource(), false, @@ -162,8 +179,7 @@ DefaultGlobalPublicDelegatedPrefixesRestStub::InsertPublicDelegatedPrefix( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "publicDelegatedPrefixes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -172,6 +188,16 @@ DefaultGlobalPublicDelegatedPrefixesRestStub::ListGlobalPublicDelegatedPrefixes( Options const& options, google::cloud::cpp::compute::global_public_delegated_prefixes::v1:: ListGlobalPublicDelegatedPrefixesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::PublicDelegatedPrefixList>( *service_, rest_context, request, false, @@ -179,13 +205,7 @@ DefaultGlobalPublicDelegatedPrefixesRestStub::ListGlobalPublicDelegatedPrefixes( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "publicDelegatedPrefixes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -200,6 +220,10 @@ DefaultGlobalPublicDelegatedPrefixesRestStub::AsyncPatchPublicDelegatedPrefix( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, @@ -209,8 +233,7 @@ DefaultGlobalPublicDelegatedPrefixesRestStub::AsyncPatchPublicDelegatedPrefix( "/", "projects", "/", request.project(), "/", "global", "/", "publicDelegatedPrefixes", "/", request.public_delegated_prefix()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -229,6 +252,10 @@ DefaultGlobalPublicDelegatedPrefixesRestStub::PatchPublicDelegatedPrefix( Options const& options, google::cloud::cpp::compute::global_public_delegated_prefixes::v1:: PatchPublicDelegatedPrefixRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.public_delegated_prefix_resource(), false, @@ -237,8 +264,7 @@ DefaultGlobalPublicDelegatedPrefixesRestStub::PatchPublicDelegatedPrefix( "projects", "/", request.project(), "/", "global", "/", "publicDelegatedPrefixes", "/", request.public_delegated_prefix()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.cc b/google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.cc index 2996f8d5e9f70..9c6d4a01f6f9c 100644 --- a/google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.cc +++ b/google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.cc @@ -51,6 +51,20 @@ DefaultHealthChecksRestStub::AggregatedListHealthChecks( Options const& options, google::cloud::cpp::compute::health_checks::v1:: AggregatedListHealthChecksRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::HealthChecksAggregatedList>( *service_, rest_context, request, false, @@ -58,17 +72,7 @@ DefaultHealthChecksRestStub::AggregatedListHealthChecks( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "healthChecks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -83,6 +87,10 @@ DefaultHealthChecksRestStub::AsyncDeleteHealthCheck( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -91,8 +99,7 @@ DefaultHealthChecksRestStub::AsyncDeleteHealthCheck( "/", "projects", "/", request.project(), "/", "global", "/", "healthChecks", "/", request.health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -111,14 +118,17 @@ DefaultHealthChecksRestStub::DeleteHealthCheck( Options const& options, google::cloud::cpp::compute::health_checks::v1:: DeleteHealthCheckRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "healthChecks", "/", request.health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -127,12 +137,16 @@ DefaultHealthChecksRestStub::GetHealthCheck( Options const& options, google::cloud::cpp::compute::health_checks::v1::GetHealthCheckRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "healthChecks", "/", request.health_check())); + "healthChecks", "/", request.health_check()), + std::move(query_params)); } future> @@ -147,6 +161,10 @@ DefaultHealthChecksRestStub::AsyncInsertHealthCheck( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.health_check_resource(), false, @@ -154,8 +172,7 @@ DefaultHealthChecksRestStub::AsyncInsertHealthCheck( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "healthChecks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -174,14 +191,17 @@ DefaultHealthChecksRestStub::InsertHealthCheck( Options const& options, google::cloud::cpp::compute::health_checks::v1:: InsertHealthCheckRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.health_check_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "healthChecks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -190,19 +210,23 @@ DefaultHealthChecksRestStub::ListHealthChecks( Options const& options, google::cloud::cpp::compute::health_checks::v1:: ListHealthChecksRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "healthChecks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -217,6 +241,10 @@ DefaultHealthChecksRestStub::AsyncPatchHealthCheck( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.health_check_resource(), false, @@ -225,8 +253,7 @@ DefaultHealthChecksRestStub::AsyncPatchHealthCheck( "/", "projects", "/", request.project(), "/", "global", "/", "healthChecks", "/", request.health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -245,14 +272,17 @@ DefaultHealthChecksRestStub::PatchHealthCheck( Options const& options, google::cloud::cpp::compute::health_checks::v1:: PatchHealthCheckRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.health_check_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "healthChecks", "/", request.health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -267,6 +297,10 @@ DefaultHealthChecksRestStub::AsyncUpdateHealthCheck( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Put( *service, *rest_context, request.health_check_resource(), false, @@ -275,8 +309,7 @@ DefaultHealthChecksRestStub::AsyncUpdateHealthCheck( "/", "projects", "/", request.project(), "/", "global", "/", "healthChecks", "/", request.health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -295,14 +328,17 @@ DefaultHealthChecksRestStub::UpdateHealthCheck( Options const& options, google::cloud::cpp::compute::health_checks::v1:: UpdateHealthCheckRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.health_check_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "healthChecks", "/", request.health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.cc b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.cc index c93d191d8cd83..0c47e83025967 100644 --- a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.cc +++ b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.cc @@ -58,6 +58,10 @@ DefaultHttpHealthChecksRestStub::AsyncDeleteHttpHealthCheck( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -66,8 +70,7 @@ DefaultHttpHealthChecksRestStub::AsyncDeleteHttpHealthCheck( "/", "projects", "/", request.project(), "/", "global", "/", "httpHealthChecks", "/", request.http_health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -86,14 +89,17 @@ DefaultHttpHealthChecksRestStub::DeleteHttpHealthCheck( Options const& options, google::cloud::cpp::compute::http_health_checks::v1:: DeleteHttpHealthCheckRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "httpHealthChecks", "/", request.http_health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -102,12 +108,16 @@ DefaultHttpHealthChecksRestStub::GetHttpHealthCheck( Options const& options, google::cloud::cpp::compute::http_health_checks::v1:: GetHttpHealthCheckRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "httpHealthChecks", "/", request.http_health_check())); + "httpHealthChecks", "/", request.http_health_check()), + std::move(query_params)); } future> @@ -122,6 +132,10 @@ DefaultHttpHealthChecksRestStub::AsyncInsertHttpHealthCheck( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.http_health_check_resource(), @@ -130,8 +144,7 @@ DefaultHttpHealthChecksRestStub::AsyncInsertHttpHealthCheck( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "httpHealthChecks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -150,14 +163,17 @@ DefaultHttpHealthChecksRestStub::InsertHttpHealthCheck( Options const& options, google::cloud::cpp::compute::http_health_checks::v1:: InsertHttpHealthCheckRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.http_health_check_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "httpHealthChecks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -166,6 +182,16 @@ DefaultHttpHealthChecksRestStub::ListHttpHealthChecks( Options const& options, google::cloud::cpp::compute::http_health_checks::v1:: ListHttpHealthChecksRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::HttpHealthCheckList>( *service_, rest_context, request, false, @@ -173,13 +199,7 @@ DefaultHttpHealthChecksRestStub::ListHttpHealthChecks( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "httpHealthChecks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -194,6 +214,10 @@ DefaultHttpHealthChecksRestStub::AsyncPatchHttpHealthCheck( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.http_health_check_resource(), @@ -203,8 +227,7 @@ DefaultHttpHealthChecksRestStub::AsyncPatchHttpHealthCheck( "/", "projects", "/", request.project(), "/", "global", "/", "httpHealthChecks", "/", request.http_health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -223,14 +246,17 @@ DefaultHttpHealthChecksRestStub::PatchHttpHealthCheck( Options const& options, google::cloud::cpp::compute::http_health_checks::v1:: PatchHttpHealthCheckRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.http_health_check_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "httpHealthChecks", "/", request.http_health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -245,6 +271,10 @@ DefaultHttpHealthChecksRestStub::AsyncUpdateHttpHealthCheck( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Put( *service, *rest_context, request.http_health_check_resource(), @@ -254,8 +284,7 @@ DefaultHttpHealthChecksRestStub::AsyncUpdateHttpHealthCheck( "/", "projects", "/", request.project(), "/", "global", "/", "httpHealthChecks", "/", request.http_health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -274,14 +303,17 @@ DefaultHttpHealthChecksRestStub::UpdateHttpHealthCheck( Options const& options, google::cloud::cpp::compute::http_health_checks::v1:: UpdateHttpHealthCheckRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.http_health_check_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "httpHealthChecks", "/", request.http_health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.cc b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.cc index b1c09231f81cf..67b0645f716af 100644 --- a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.cc +++ b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.cc @@ -58,6 +58,10 @@ DefaultHttpsHealthChecksRestStub::AsyncDeleteHttpsHealthCheck( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -66,8 +70,7 @@ DefaultHttpsHealthChecksRestStub::AsyncDeleteHttpsHealthCheck( "/", "projects", "/", request.project(), "/", "global", "/", "httpsHealthChecks", "/", request.https_health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -86,14 +89,17 @@ DefaultHttpsHealthChecksRestStub::DeleteHttpsHealthCheck( Options const& options, google::cloud::cpp::compute::https_health_checks::v1:: DeleteHttpsHealthCheckRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "httpsHealthChecks", "/", request.https_health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -102,12 +108,16 @@ DefaultHttpsHealthChecksRestStub::GetHttpsHealthCheck( Options const& options, google::cloud::cpp::compute::https_health_checks::v1:: GetHttpsHealthCheckRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "httpsHealthChecks", "/", request.https_health_check())); + "httpsHealthChecks", "/", request.https_health_check()), + std::move(query_params)); } future> @@ -122,6 +132,10 @@ DefaultHttpsHealthChecksRestStub::AsyncInsertHttpsHealthCheck( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.https_health_check_resource(), @@ -130,8 +144,7 @@ DefaultHttpsHealthChecksRestStub::AsyncInsertHttpsHealthCheck( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "httpsHealthChecks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -150,14 +163,17 @@ DefaultHttpsHealthChecksRestStub::InsertHttpsHealthCheck( Options const& options, google::cloud::cpp::compute::https_health_checks::v1:: InsertHttpsHealthCheckRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.https_health_check_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "httpsHealthChecks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -166,6 +182,16 @@ DefaultHttpsHealthChecksRestStub::ListHttpsHealthChecks( Options const& options, google::cloud::cpp::compute::https_health_checks::v1:: ListHttpsHealthChecksRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::HttpsHealthCheckList>( *service_, rest_context, request, false, @@ -173,13 +199,7 @@ DefaultHttpsHealthChecksRestStub::ListHttpsHealthChecks( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "httpsHealthChecks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -194,6 +214,10 @@ DefaultHttpsHealthChecksRestStub::AsyncPatchHttpsHealthCheck( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.https_health_check_resource(), @@ -203,8 +227,7 @@ DefaultHttpsHealthChecksRestStub::AsyncPatchHttpsHealthCheck( "/", "projects", "/", request.project(), "/", "global", "/", "httpsHealthChecks", "/", request.https_health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -223,14 +246,17 @@ DefaultHttpsHealthChecksRestStub::PatchHttpsHealthCheck( Options const& options, google::cloud::cpp::compute::https_health_checks::v1:: PatchHttpsHealthCheckRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.https_health_check_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "httpsHealthChecks", "/", request.https_health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -245,6 +271,10 @@ DefaultHttpsHealthChecksRestStub::AsyncUpdateHttpsHealthCheck( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Put( *service, *rest_context, request.https_health_check_resource(), @@ -254,8 +284,7 @@ DefaultHttpsHealthChecksRestStub::AsyncUpdateHttpsHealthCheck( "/", "projects", "/", request.project(), "/", "global", "/", "httpsHealthChecks", "/", request.https_health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -274,14 +303,17 @@ DefaultHttpsHealthChecksRestStub::UpdateHttpsHealthCheck( Options const& options, google::cloud::cpp::compute::https_health_checks::v1:: UpdateHttpsHealthCheckRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.https_health_check_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "httpsHealthChecks", "/", request.https_health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_stub.cc b/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_stub.cc index e6bf36584c4b0..4328c9161d84f 100644 --- a/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_stub.cc +++ b/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_stub.cc @@ -46,13 +46,17 @@ DefaultImageFamilyViewsRestStub::GetImageFamilyView( Options const& options, google::cloud::cpp::compute::image_family_views::v1:: GetImageFamilyViewRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "imageFamilyViews", "/", - request.family())); + request.family()), + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/compute/images/v1/internal/images_rest_stub.cc b/google/cloud/compute/images/v1/internal/images_rest_stub.cc index 135ba4b2d3bde..8bdf5f1c3d782 100644 --- a/google/cloud/compute/images/v1/internal/images_rest_stub.cc +++ b/google/cloud/compute/images/v1/internal/images_rest_stub.cc @@ -57,6 +57,10 @@ DefaultImagesRestStub::AsyncDeleteImage( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -64,8 +68,7 @@ DefaultImagesRestStub::AsyncDeleteImage( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "images", "/", request.image()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -84,14 +87,17 @@ DefaultImagesRestStub::DeleteImage( Options const& options, google::cloud::cpp::compute::images::v1::DeleteImageRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "images", "/", request.image()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -105,6 +111,10 @@ DefaultImagesRestStub::AsyncDeprecate( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.deprecation_status_resource(), @@ -114,8 +124,7 @@ DefaultImagesRestStub::AsyncDeprecate( "/", "projects", "/", request.project(), "/", "global", "/", "images", "/", request.image(), "/", "deprecate"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -133,14 +142,17 @@ DefaultImagesRestStub::Deprecate( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::images::v1::DeprecateRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.deprecation_status_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "images", "/", request.image(), "/", "deprecate"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -148,12 +160,16 @@ DefaultImagesRestStub::GetImage( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::images::v1::GetImageRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "images", "/", request.image())); + "images", "/", request.image()), + std::move(query_params)); } StatusOr @@ -162,12 +178,16 @@ DefaultImagesRestStub::GetFromFamily( Options const& options, google::cloud::cpp::compute::images::v1::GetFromFamilyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "images", "/", "family", "/", request.family())); + "images", "/", "family", "/", request.family()), + std::move(query_params)); } StatusOr @@ -176,15 +196,19 @@ DefaultImagesRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::images::v1::GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "images", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } future> @@ -199,6 +223,12 @@ DefaultImagesRestStub::AsyncInsertImage( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"force_create", (request.force_create() ? "1" : "0")}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.image_resource(), false, @@ -206,10 +236,7 @@ DefaultImagesRestStub::AsyncInsertImage( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "images"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("force_create", - (request.force_create() ? "1" : "0")), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -228,15 +255,19 @@ DefaultImagesRestStub::InsertImage( Options const& options, google::cloud::cpp::compute::images::v1::InsertImageRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"force_create", (request.force_create() ? "1" : "0")}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.image_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "images"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("force_create", (request.force_create() ? "1" : "0")), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -244,19 +275,23 @@ DefaultImagesRestStub::ListImages( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::images::v1::ListImagesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "images"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -270,6 +305,10 @@ DefaultImagesRestStub::AsyncPatchImage( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.image_resource(), false, @@ -277,8 +316,7 @@ DefaultImagesRestStub::AsyncPatchImage( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "images", "/", request.image()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -296,14 +334,17 @@ DefaultImagesRestStub::PatchImage( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::images::v1::PatchImageRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.image_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "images", "/", request.image()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -312,13 +353,17 @@ DefaultImagesRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::images::v1::SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_policy_request_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "images", "/", request.resource(), "/", "setIamPolicy")); + "images", "/", request.resource(), "/", "setIamPolicy"), + std::move(query_params)); } future> @@ -332,6 +377,9 @@ DefaultImagesRestStub::AsyncSetLabels( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -340,7 +388,8 @@ DefaultImagesRestStub::AsyncSetLabels( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "images", "/", request.resource(), - "/", "setLabels"))); + "/", "setLabels"), + std::move(query_params))); }, std::move(p), service_, @@ -358,13 +407,17 @@ DefaultImagesRestStub::SetLabels( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::images::v1::SetLabelsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_labels_request_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "images", "/", request.resource(), "/", "setLabels")); + "images", "/", request.resource(), "/", "setLabels"), + std::move(query_params)); } StatusOr @@ -373,6 +426,9 @@ DefaultImagesRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::images::v1::TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -381,7 +437,8 @@ DefaultImagesRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "images", "/", request.resource(), "/", - "testIamPermissions")); + "testIamPermissions"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.cc b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.cc index 64263c7fe85e6..40b35c3d3b329 100644 --- a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.cc +++ b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.cc @@ -60,6 +60,9 @@ DefaultInstanceGroupManagerResizeRequestsRestStub::AsyncCancel( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -69,7 +72,8 @@ DefaultInstanceGroupManagerResizeRequestsRestStub::AsyncCancel( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "resizeRequests", - "/", request.resize_request(), "/", "cancel"))); + "/", request.resize_request(), "/", "cancel"), + std::move(query_params))); }, std::move(p), service_, @@ -88,6 +92,9 @@ DefaultInstanceGroupManagerResizeRequestsRestStub::Cancel( Options const& options, google::cloud::cpp::compute::instance_group_manager_resize_requests::v1:: CancelRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -95,7 +102,8 @@ DefaultInstanceGroupManagerResizeRequestsRestStub::Cancel( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "resizeRequests", "/", - request.resize_request(), "/", "cancel")); + request.resize_request(), "/", "cancel"), + std::move(query_params)); } future> @@ -111,6 +119,10 @@ DefaultInstanceGroupManagerResizeRequestsRestStub:: p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -121,8 +133,7 @@ DefaultInstanceGroupManagerResizeRequestsRestStub:: "instanceGroupManagers", "/", request.instance_group_manager(), "/", "resizeRequests", "/", request.resize_request()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -142,6 +153,10 @@ DefaultInstanceGroupManagerResizeRequestsRestStub:: Options const& options, google::cloud::cpp::compute::instance_group_manager_resize_requests:: v1::DeleteInstanceGroupManagerResizeRequestRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -150,8 +165,7 @@ DefaultInstanceGroupManagerResizeRequestsRestStub:: request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "resizeRequests", "/", request.resize_request()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -161,6 +175,9 @@ DefaultInstanceGroupManagerResizeRequestsRestStub:: Options const& options, google::cloud::cpp::compute::instance_group_manager_resize_requests:: v1::GetInstanceGroupManagerResizeRequestRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InstanceGroupManagerResizeRequest>( *service_, rest_context, request, false, @@ -169,7 +186,8 @@ DefaultInstanceGroupManagerResizeRequestsRestStub:: "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "resizeRequests", "/", - request.resize_request())); + request.resize_request()), + std::move(query_params)); } future> @@ -185,6 +203,10 @@ DefaultInstanceGroupManagerResizeRequestsRestStub:: p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -195,8 +217,7 @@ DefaultInstanceGroupManagerResizeRequestsRestStub:: "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "resizeRequests"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -216,6 +237,10 @@ DefaultInstanceGroupManagerResizeRequestsRestStub:: Options const& options, google::cloud::cpp::compute::instance_group_manager_resize_requests:: v1::InsertInstanceGroupManagerResizeRequestRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_group_manager_resize_request_resource(), false, @@ -224,8 +249,7 @@ DefaultInstanceGroupManagerResizeRequestsRestStub:: "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "resizeRequests"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, @@ -244,13 +278,7 @@ DefaultInstanceGroupManagerResizeRequestsRestStub:: "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "resizeRequests"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.cc b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.cc index 6f14f6f42967a..e568c26998462 100644 --- a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.cc +++ b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.cc @@ -59,6 +59,10 @@ DefaultInstanceGroupManagersRestStub::AsyncAbandonInstances( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -71,8 +75,7 @@ DefaultInstanceGroupManagersRestStub::AsyncAbandonInstances( "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "abandonInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -91,6 +94,10 @@ DefaultInstanceGroupManagersRestStub::AbandonInstances( Options const& options, google::cloud::cpp::compute::instance_group_managers::v1:: AbandonInstancesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_group_managers_abandon_instances_request_resource(), @@ -100,8 +107,7 @@ DefaultInstanceGroupManagersRestStub::AbandonInstances( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "abandonInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -110,6 +116,20 @@ DefaultInstanceGroupManagersRestStub::AggregatedListInstanceGroupManagers( Options const& options, google::cloud::cpp::compute::instance_group_managers::v1:: AggregatedListInstanceGroupManagersRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InstanceGroupManagerAggregatedList>( *service_, rest_context, request, false, @@ -117,17 +137,7 @@ DefaultInstanceGroupManagersRestStub::AggregatedListInstanceGroupManagers( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "instanceGroupManagers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -142,6 +152,9 @@ DefaultInstanceGroupManagersRestStub::AsyncApplyUpdatesToInstances( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -154,7 +167,8 @@ DefaultInstanceGroupManagersRestStub::AsyncApplyUpdatesToInstances( "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", - "applyUpdatesToInstances"))); + "applyUpdatesToInstances"), + std::move(query_params))); }, std::move(p), service_, @@ -173,6 +187,9 @@ DefaultInstanceGroupManagersRestStub::ApplyUpdatesToInstances( Options const& options, google::cloud::cpp::compute::instance_group_managers::v1:: ApplyUpdatesToInstancesRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_group_managers_apply_updates_request_resource(), false, @@ -181,7 +198,8 @@ DefaultInstanceGroupManagersRestStub::ApplyUpdatesToInstances( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", - "applyUpdatesToInstances")); + "applyUpdatesToInstances"), + std::move(query_params)); } future> @@ -196,6 +214,10 @@ DefaultInstanceGroupManagersRestStub::AsyncCreateInstances( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -207,8 +229,7 @@ DefaultInstanceGroupManagersRestStub::AsyncCreateInstances( "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "createInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -227,6 +248,10 @@ DefaultInstanceGroupManagersRestStub::CreateInstances( Options const& options, google::cloud::cpp::compute::instance_group_managers::v1:: CreateInstancesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_group_managers_create_instances_request_resource(), @@ -236,8 +261,7 @@ DefaultInstanceGroupManagersRestStub::CreateInstances( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "createInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -252,6 +276,10 @@ DefaultInstanceGroupManagersRestStub::AsyncDeleteInstanceGroupManager( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -261,8 +289,7 @@ DefaultInstanceGroupManagersRestStub::AsyncDeleteInstanceGroupManager( "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -281,6 +308,10 @@ DefaultInstanceGroupManagersRestStub::DeleteInstanceGroupManager( Options const& options, google::cloud::cpp::compute::instance_group_managers::v1:: DeleteInstanceGroupManagerRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -288,8 +319,7 @@ DefaultInstanceGroupManagersRestStub::DeleteInstanceGroupManager( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -304,6 +334,10 @@ DefaultInstanceGroupManagersRestStub::AsyncDeleteInstances( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -315,8 +349,7 @@ DefaultInstanceGroupManagersRestStub::AsyncDeleteInstances( "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "deleteInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -335,6 +368,10 @@ DefaultInstanceGroupManagersRestStub::DeleteInstances( Options const& options, google::cloud::cpp::compute::instance_group_managers::v1:: DeleteInstancesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_group_managers_delete_instances_request_resource(), @@ -344,8 +381,7 @@ DefaultInstanceGroupManagersRestStub::DeleteInstances( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "deleteInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -360,6 +396,9 @@ DefaultInstanceGroupManagersRestStub::AsyncDeletePerInstanceConfigs( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -371,7 +410,8 @@ DefaultInstanceGroupManagersRestStub::AsyncDeletePerInstanceConfigs( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", - "deletePerInstanceConfigs"))); + "deletePerInstanceConfigs"), + std::move(query_params))); }, std::move(p), service_, @@ -390,6 +430,9 @@ DefaultInstanceGroupManagersRestStub::DeletePerInstanceConfigs( Options const& options, google::cloud::cpp::compute::instance_group_managers::v1:: DeletePerInstanceConfigsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request @@ -400,7 +443,8 @@ DefaultInstanceGroupManagersRestStub::DeletePerInstanceConfigs( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", - "deletePerInstanceConfigs")); + "deletePerInstanceConfigs"), + std::move(query_params)); } StatusOr @@ -409,6 +453,9 @@ DefaultInstanceGroupManagersRestStub::GetInstanceGroupManager( Options const& options, google::cloud::cpp::compute::instance_group_managers::v1:: GetInstanceGroupManagerRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InstanceGroupManager>( *service_, rest_context, request, false, @@ -416,7 +463,8 @@ DefaultInstanceGroupManagersRestStub::GetInstanceGroupManager( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", - request.instance_group_manager())); + request.instance_group_manager()), + std::move(query_params)); } future> @@ -431,6 +479,10 @@ DefaultInstanceGroupManagersRestStub::AsyncInsertInstanceGroupManager( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -440,8 +492,7 @@ DefaultInstanceGroupManagersRestStub::AsyncInsertInstanceGroupManager( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -460,14 +511,17 @@ DefaultInstanceGroupManagersRestStub::InsertInstanceGroupManager( Options const& options, google::cloud::cpp::compute::instance_group_managers::v1:: InsertInstanceGroupManagerRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_group_manager_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -476,6 +530,16 @@ DefaultInstanceGroupManagersRestStub::ListInstanceGroupManagers( Options const& options, google::cloud::cpp::compute::instance_group_managers::v1:: ListInstanceGroupManagersRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InstanceGroupManagerList>( *service_, rest_context, request, false, @@ -483,13 +547,7 @@ DefaultInstanceGroupManagersRestStub::ListInstanceGroupManagers( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr< @@ -499,6 +557,16 @@ DefaultInstanceGroupManagersRestStub::ListErrors( Options const& options, google::cloud::cpp::compute::instance_group_managers::v1:: ListErrorsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InstanceGroupManagersListErrorsResponse>( *service_, rest_context, request, false, @@ -507,13 +575,7 @@ DefaultInstanceGroupManagersRestStub::ListErrors( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "listErrors"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1:: InstanceGroupManagersListManagedInstancesResponse>( @@ -532,7 +597,8 @@ DefaultInstanceGroupManagersRestStub::ListManagedInstances( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", - "listManagedInstances")); + "listManagedInstances"), + std::move(query_params)); } StatusOr> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1:: InstanceGroupManagersListPerInstanceConfigsResp>( @@ -551,7 +620,8 @@ DefaultInstanceGroupManagersRestStub::ListPerInstanceConfigs( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", - "listPerInstanceConfigs")); + "listPerInstanceConfigs"), + std::move(query_params)); } future> @@ -566,6 +636,10 @@ DefaultInstanceGroupManagersRestStub::AsyncPatchInstanceGroupManager( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, @@ -576,8 +650,7 @@ DefaultInstanceGroupManagersRestStub::AsyncPatchInstanceGroupManager( "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -596,6 +669,10 @@ DefaultInstanceGroupManagersRestStub::PatchInstanceGroupManager( Options const& options, google::cloud::cpp::compute::instance_group_managers::v1:: PatchInstanceGroupManagerRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.instance_group_manager_resource(), false, absl::StrCat("/", "compute", "/", @@ -603,8 +680,7 @@ DefaultInstanceGroupManagersRestStub::PatchInstanceGroupManager( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -619,6 +695,10 @@ DefaultInstanceGroupManagersRestStub::AsyncPatchPerInstanceConfigs( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -631,8 +711,7 @@ DefaultInstanceGroupManagersRestStub::AsyncPatchPerInstanceConfigs( "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "patchPerInstanceConfigs"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -651,6 +730,10 @@ DefaultInstanceGroupManagersRestStub::PatchPerInstanceConfigs( Options const& options, google::cloud::cpp::compute::instance_group_managers::v1:: PatchPerInstanceConfigsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_group_managers_patch_per_instance_configs_req_resource(), @@ -661,8 +744,7 @@ DefaultInstanceGroupManagersRestStub::PatchPerInstanceConfigs( request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "patchPerInstanceConfigs"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -677,6 +759,10 @@ DefaultInstanceGroupManagersRestStub::AsyncRecreateInstances( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -689,8 +775,7 @@ DefaultInstanceGroupManagersRestStub::AsyncRecreateInstances( "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "recreateInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -709,6 +794,10 @@ DefaultInstanceGroupManagersRestStub::RecreateInstances( Options const& options, google::cloud::cpp::compute::instance_group_managers::v1:: RecreateInstancesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_group_managers_recreate_instances_request_resource(), @@ -718,8 +807,7 @@ DefaultInstanceGroupManagersRestStub::RecreateInstances( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "recreateInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -734,6 +822,9 @@ DefaultInstanceGroupManagersRestStub::AsyncResize( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -742,7 +833,8 @@ DefaultInstanceGroupManagersRestStub::AsyncResize( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", - request.instance_group_manager(), "/", "resize"))); + request.instance_group_manager(), "/", "resize"), + std::move(query_params))); }, std::move(p), service_, @@ -761,13 +853,17 @@ DefaultInstanceGroupManagersRestStub::Resize( Options const& options, google::cloud::cpp::compute::instance_group_managers::v1:: ResizeRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", - request.instance_group_manager(), "/", "resize")); + request.instance_group_manager(), "/", "resize"), + std::move(query_params)); } future> @@ -782,6 +878,10 @@ DefaultInstanceGroupManagersRestStub::AsyncSetInstanceTemplate( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -794,8 +894,7 @@ DefaultInstanceGroupManagersRestStub::AsyncSetInstanceTemplate( "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "setInstanceTemplate"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -814,6 +913,10 @@ DefaultInstanceGroupManagersRestStub::SetInstanceTemplate( Options const& options, google::cloud::cpp::compute::instance_group_managers::v1:: SetInstanceTemplateRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_group_managers_set_instance_template_request_resource(), @@ -824,8 +927,7 @@ DefaultInstanceGroupManagersRestStub::SetInstanceTemplate( request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "setInstanceTemplate"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -840,6 +942,10 @@ DefaultInstanceGroupManagersRestStub::AsyncSetTargetPools( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -851,8 +957,7 @@ DefaultInstanceGroupManagersRestStub::AsyncSetTargetPools( "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "setTargetPools"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -871,6 +976,10 @@ DefaultInstanceGroupManagersRestStub::SetTargetPools( Options const& options, google::cloud::cpp::compute::instance_group_managers::v1:: SetTargetPoolsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_group_managers_set_target_pools_request_resource(), @@ -880,8 +989,7 @@ DefaultInstanceGroupManagersRestStub::SetTargetPools( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "setTargetPools"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -896,6 +1004,10 @@ DefaultInstanceGroupManagersRestStub::AsyncUpdatePerInstanceConfigs( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -908,8 +1020,7 @@ DefaultInstanceGroupManagersRestStub::AsyncUpdatePerInstanceConfigs( "/", request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "updatePerInstanceConfigs"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -928,6 +1039,10 @@ DefaultInstanceGroupManagersRestStub::UpdatePerInstanceConfigs( Options const& options, google::cloud::cpp::compute::instance_group_managers::v1:: UpdatePerInstanceConfigsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request @@ -939,8 +1054,7 @@ DefaultInstanceGroupManagersRestStub::UpdatePerInstanceConfigs( request.zone(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "updatePerInstanceConfigs"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.cc b/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.cc index e380e30af91e0..a5887742625f0 100644 --- a/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.cc +++ b/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.cc @@ -57,6 +57,10 @@ DefaultInstanceGroupsRestStub::AsyncAddInstances( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -67,8 +71,7 @@ DefaultInstanceGroupsRestStub::AsyncAddInstances( "zones", "/", request.zone(), "/", "instanceGroups", "/", request.instance_group(), "/", "addInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -87,6 +90,10 @@ DefaultInstanceGroupsRestStub::AddInstances( Options const& options, google::cloud::cpp::compute::instance_groups::v1::AddInstancesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_groups_add_instances_request_resource(), false, @@ -95,8 +102,7 @@ DefaultInstanceGroupsRestStub::AddInstances( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroups", "/", request.instance_group(), "/", "addInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -105,6 +111,20 @@ DefaultInstanceGroupsRestStub::AggregatedListInstanceGroups( Options const& options, google::cloud::cpp::compute::instance_groups::v1:: AggregatedListInstanceGroupsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InstanceGroupAggregatedList>( *service_, rest_context, request, false, @@ -112,17 +132,7 @@ DefaultInstanceGroupsRestStub::AggregatedListInstanceGroups( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "instanceGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -137,6 +147,10 @@ DefaultInstanceGroupsRestStub::AsyncDeleteInstanceGroup( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -145,8 +159,7 @@ DefaultInstanceGroupsRestStub::AsyncDeleteInstanceGroup( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroups", "/", request.instance_group()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -165,6 +178,10 @@ DefaultInstanceGroupsRestStub::DeleteInstanceGroup( Options const& options, google::cloud::cpp::compute::instance_groups::v1:: DeleteInstanceGroupRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -172,8 +189,7 @@ DefaultInstanceGroupsRestStub::DeleteInstanceGroup( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroups", "/", request.instance_group()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -182,13 +198,17 @@ DefaultInstanceGroupsRestStub::GetInstanceGroup( Options const& options, google::cloud::cpp::compute::instance_groups::v1:: GetInstanceGroupRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroups", "/", - request.instance_group())); + request.instance_group()), + std::move(query_params)); } future> @@ -203,6 +223,10 @@ DefaultInstanceGroupsRestStub::AsyncInsertInstanceGroup( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.instance_group_resource(), @@ -212,8 +236,7 @@ DefaultInstanceGroupsRestStub::AsyncInsertInstanceGroup( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -232,14 +255,17 @@ DefaultInstanceGroupsRestStub::InsertInstanceGroup( Options const& options, google::cloud::cpp::compute::instance_groups::v1:: InsertInstanceGroupRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_group_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -248,19 +274,23 @@ DefaultInstanceGroupsRestStub::ListInstanceGroups( Options const& options, google::cloud::cpp::compute::instance_groups::v1:: ListInstanceGroupsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -269,6 +299,16 @@ DefaultInstanceGroupsRestStub::ListInstances( Options const& options, google::cloud::cpp::compute::instance_groups::v1:: ListInstancesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::InstanceGroupsListInstances>( *service_, rest_context, @@ -278,13 +318,7 @@ DefaultInstanceGroupsRestStub::ListInstances( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroups", "/", request.instance_group(), "/", "listInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -299,6 +333,10 @@ DefaultInstanceGroupsRestStub::AsyncRemoveInstances( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -310,8 +348,7 @@ DefaultInstanceGroupsRestStub::AsyncRemoveInstances( "zones", "/", request.zone(), "/", "instanceGroups", "/", request.instance_group(), "/", "removeInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -330,6 +367,10 @@ DefaultInstanceGroupsRestStub::RemoveInstances( Options const& options, google::cloud::cpp::compute::instance_groups::v1:: RemoveInstancesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_groups_remove_instances_request_resource(), false, @@ -338,8 +379,7 @@ DefaultInstanceGroupsRestStub::RemoveInstances( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroups", "/", request.instance_group(), "/", "removeInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -354,6 +394,10 @@ DefaultInstanceGroupsRestStub::AsyncSetNamedPorts( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -365,8 +409,7 @@ DefaultInstanceGroupsRestStub::AsyncSetNamedPorts( "zones", "/", request.zone(), "/", "instanceGroups", "/", request.instance_group(), "/", "setNamedPorts"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -385,6 +428,10 @@ DefaultInstanceGroupsRestStub::SetNamedPorts( Options const& options, google::cloud::cpp::compute::instance_groups::v1:: SetNamedPortsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_groups_set_named_ports_request_resource(), false, @@ -393,8 +440,7 @@ DefaultInstanceGroupsRestStub::SetNamedPorts( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceGroups", "/", request.instance_group(), "/", "setNamedPorts"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.cc b/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.cc index 4db0ea3724091..2e566ed03f88b 100644 --- a/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.cc +++ b/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.cc @@ -52,12 +52,16 @@ DefaultInstanceSettingsRestStub::GetInstanceSettings( Options const& options, google::cloud::cpp::compute::instance_settings::v1:: GetInstanceSettingsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", - request.zone(), "/", "instanceSettings")); + request.zone(), "/", "instanceSettings"), + std::move(query_params)); } future> @@ -72,6 +76,11 @@ DefaultInstanceSettingsRestStub::AsyncPatchInstanceSettings( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.instance_settings_resource(), @@ -81,9 +90,7 @@ DefaultInstanceSettingsRestStub::AsyncPatchInstanceSettings( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceSettings"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())}))); + std::move(query_params))); }, std::move(p), service_, @@ -102,15 +109,18 @@ DefaultInstanceSettingsRestStub::PatchInstanceSettings( Options const& options, google::cloud::cpp::compute::instance_settings::v1:: PatchInstanceSettingsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.instance_settings_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instanceSettings"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.cc b/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.cc index 20b287bb7077c..235859336948d 100644 --- a/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.cc +++ b/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.cc @@ -52,6 +52,20 @@ DefaultInstanceTemplatesRestStub::AggregatedListInstanceTemplates( Options const& options, google::cloud::cpp::compute::instance_templates::v1:: AggregatedListInstanceTemplatesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InstanceTemplateAggregatedList>( *service_, rest_context, request, false, @@ -59,17 +73,7 @@ DefaultInstanceTemplatesRestStub::AggregatedListInstanceTemplates( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "instanceTemplates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -84,6 +88,10 @@ DefaultInstanceTemplatesRestStub::AsyncDeleteInstanceTemplate( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -92,8 +100,7 @@ DefaultInstanceTemplatesRestStub::AsyncDeleteInstanceTemplate( "/", "projects", "/", request.project(), "/", "global", "/", "instanceTemplates", "/", request.instance_template()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -112,14 +119,17 @@ DefaultInstanceTemplatesRestStub::DeleteInstanceTemplate( Options const& options, google::cloud::cpp::compute::instance_templates::v1:: DeleteInstanceTemplateRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "instanceTemplates", "/", request.instance_template()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -128,12 +138,16 @@ DefaultInstanceTemplatesRestStub::GetInstanceTemplate( Options const& options, google::cloud::cpp::compute::instance_templates::v1:: GetInstanceTemplateRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "instanceTemplates", "/", request.instance_template())); + "instanceTemplates", "/", request.instance_template()), + std::move(query_params)); } StatusOr @@ -142,6 +156,12 @@ DefaultInstanceTemplatesRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::instance_templates::v1:: GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -149,9 +169,7 @@ DefaultInstanceTemplatesRestStub::GetIamPolicy( "projects", "/", request.project(), "/", "global", "/", "instanceTemplates", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } future> @@ -166,6 +184,10 @@ DefaultInstanceTemplatesRestStub::AsyncInsertInstanceTemplate( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.instance_template_resource(), @@ -174,8 +196,7 @@ DefaultInstanceTemplatesRestStub::AsyncInsertInstanceTemplate( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "instanceTemplates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -194,14 +215,17 @@ DefaultInstanceTemplatesRestStub::InsertInstanceTemplate( Options const& options, google::cloud::cpp::compute::instance_templates::v1:: InsertInstanceTemplateRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_template_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "instanceTemplates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -210,6 +234,16 @@ DefaultInstanceTemplatesRestStub::ListInstanceTemplates( Options const& options, google::cloud::cpp::compute::instance_templates::v1:: ListInstanceTemplatesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InstanceTemplateList>( *service_, rest_context, request, false, @@ -217,13 +251,7 @@ DefaultInstanceTemplatesRestStub::ListInstanceTemplates( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "instanceTemplates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -232,6 +260,9 @@ DefaultInstanceTemplatesRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::instance_templates::v1:: SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_policy_request_resource(), false, @@ -239,7 +270,8 @@ DefaultInstanceTemplatesRestStub::SetIamPolicy( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "instanceTemplates", "/", request.resource(), "/", - "setIamPolicy")); + "setIamPolicy"), + std::move(query_params)); } StatusOr @@ -248,6 +280,9 @@ DefaultInstanceTemplatesRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::instance_templates::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -256,7 +291,8 @@ DefaultInstanceTemplatesRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "instanceTemplates", "/", request.resource(), "/", - "testIamPermissions")); + "testIamPermissions"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/instances/v1/internal/instances_rest_stub.cc b/google/cloud/compute/instances/v1/internal/instances_rest_stub.cc index 74bc82514d3c0..c02ec2316e673 100644 --- a/google/cloud/compute/instances/v1/internal/instances_rest_stub.cc +++ b/google/cloud/compute/instances/v1/internal/instances_rest_stub.cc @@ -57,6 +57,12 @@ DefaultInstancesRestStub::AsyncAddAccessConfig( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"network_interface", request.network_interface()}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.access_config_resource(), @@ -66,10 +72,7 @@ DefaultInstancesRestStub::AsyncAddAccessConfig( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "addAccessConfig"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("network_interface", - request.network_interface()), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -88,6 +91,11 @@ DefaultInstancesRestStub::AddAccessConfig( Options const& options, google::cloud::cpp::compute::instances::v1::AddAccessConfigRequest const& request) { + std::vector> query_params; + query_params.push_back({"network_interface", request.network_interface()}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.access_config_resource(), false, absl::StrCat("/", "compute", "/", @@ -95,9 +103,7 @@ DefaultInstancesRestStub::AddAccessConfig( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "addAccessConfig"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("network_interface", request.network_interface()), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -112,6 +118,10 @@ DefaultInstancesRestStub::AsyncAddResourcePolicies( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -123,8 +133,7 @@ DefaultInstancesRestStub::AsyncAddResourcePolicies( "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "addResourcePolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -143,6 +152,10 @@ DefaultInstancesRestStub::AddResourcePolicies( Options const& options, google::cloud::cpp::compute::instances::v1:: AddResourcePoliciesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instances_add_resource_policies_request_resource(), false, @@ -151,8 +164,7 @@ DefaultInstancesRestStub::AddResourcePolicies( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "addResourcePolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -161,6 +173,20 @@ DefaultInstancesRestStub::AggregatedListInstances( Options const& options, google::cloud::cpp::compute::instances::v1:: AggregatedListInstancesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InstanceAggregatedList>( *service_, rest_context, request, false, @@ -168,17 +194,7 @@ DefaultInstancesRestStub::AggregatedListInstances( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "instances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -193,6 +209,12 @@ DefaultInstancesRestStub::AsyncAttachDisk( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"force_attach", (request.force_attach() ? "1" : "0")}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.attached_disk_resource(), @@ -202,10 +224,7 @@ DefaultInstancesRestStub::AsyncAttachDisk( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "attachDisk"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("force_attach", - (request.force_attach() ? "1" : "0")), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -224,6 +243,12 @@ DefaultInstancesRestStub::AttachDisk( Options const& options, google::cloud::cpp::compute::instances::v1::AttachDiskRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"force_attach", (request.force_attach() ? "1" : "0")}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.attached_disk_resource(), false, absl::StrCat("/", "compute", "/", @@ -231,9 +256,7 @@ DefaultInstancesRestStub::AttachDisk( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "attachDisk"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("force_attach", (request.force_attach() ? "1" : "0")), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -248,6 +271,10 @@ DefaultInstancesRestStub::AsyncBulkInsert( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -257,8 +284,7 @@ DefaultInstancesRestStub::AsyncBulkInsert( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", "bulkInsert"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -277,14 +303,17 @@ DefaultInstancesRestStub::BulkInsert( Options const& options, google::cloud::cpp::compute::instances::v1::BulkInsertRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.bulk_insert_instance_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", "bulkInsert"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -299,6 +328,10 @@ DefaultInstancesRestStub::AsyncDeleteInstance( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -307,8 +340,7 @@ DefaultInstancesRestStub::AsyncDeleteInstance( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -327,14 +359,17 @@ DefaultInstancesRestStub::DeleteInstance( Options const& options, google::cloud::cpp::compute::instances::v1::DeleteInstanceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -349,6 +384,9 @@ DefaultInstancesRestStub::AsyncDeleteAccessConfig( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -357,7 +395,8 @@ DefaultInstancesRestStub::AsyncDeleteAccessConfig( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", - "deleteAccessConfig"))); + "deleteAccessConfig"), + std::move(query_params))); }, std::move(p), service_, @@ -376,13 +415,17 @@ DefaultInstancesRestStub::DeleteAccessConfig( Options const& options, google::cloud::cpp::compute::instances::v1::DeleteAccessConfigRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), - "/", "deleteAccessConfig")); + "/", "deleteAccessConfig"), + std::move(query_params)); } future> @@ -397,6 +440,9 @@ DefaultInstancesRestStub::AsyncDetachDisk( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -404,7 +450,8 @@ DefaultInstancesRestStub::AsyncDetachDisk( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", - "/", request.instance(), "/", "detachDisk"))); + "/", request.instance(), "/", "detachDisk"), + std::move(query_params))); }, std::move(p), service_, @@ -423,13 +470,17 @@ DefaultInstancesRestStub::DetachDisk( Options const& options, google::cloud::cpp::compute::instances::v1::DetachDiskRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), - "/", "detachDisk")); + "/", "detachDisk"), + std::move(query_params)); } StatusOr @@ -438,12 +489,16 @@ DefaultInstancesRestStub::GetInstance( Options const& options, google::cloud::cpp::compute::instances::v1::GetInstanceRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", - request.zone(), "/", "instances", "/", request.instance())); + request.zone(), "/", "instances", "/", request.instance()), + std::move(query_params)); } StatusOr< @@ -453,6 +508,10 @@ DefaultInstancesRestStub::GetEffectiveFirewalls( Options const& options, google::cloud::cpp::compute::instances::v1:: GetEffectiveFirewallsRequest const& request) { + std::vector> query_params; + query_params.push_back({"network_interface", request.network_interface()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InstancesGetEffectiveFirewallsResponse>( *service_, rest_context, request, false, @@ -461,8 +520,7 @@ DefaultInstancesRestStub::GetEffectiveFirewalls( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "getEffectiveFirewalls"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("network_interface", request.network_interface())})); + std::move(query_params)); } StatusOr @@ -471,6 +529,11 @@ DefaultInstancesRestStub::GetGuestAttributes( Options const& options, google::cloud::cpp::compute::instances::v1::GetGuestAttributesRequest const& request) { + std::vector> query_params; + query_params.push_back({"query_path", request.query_path()}); + query_params.push_back({"variable_key", request.variable_key()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -478,9 +541,7 @@ DefaultInstancesRestStub::GetGuestAttributes( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "getGuestAttributes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("query_path", request.query_path()), - std::make_pair("variable_key", request.variable_key())})); + std::move(query_params)); } StatusOr @@ -489,6 +550,12 @@ DefaultInstancesRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::instances::v1::GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -496,9 +563,7 @@ DefaultInstancesRestStub::GetIamPolicy( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } StatusOr @@ -507,13 +572,17 @@ DefaultInstancesRestStub::GetScreenshot( Options const& options, google::cloud::cpp::compute::instances::v1::GetScreenshotRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), - "/", "screenshot")); + "/", "screenshot"), + std::move(query_params)); } StatusOr @@ -522,6 +591,11 @@ DefaultInstancesRestStub::GetSerialPortOutput( Options const& options, google::cloud::cpp::compute::instances::v1:: GetSerialPortOutputRequest const& request) { + std::vector> query_params; + query_params.push_back({"port", std::to_string(request.port())}); + query_params.push_back({"start", request.start()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -529,9 +603,7 @@ DefaultInstancesRestStub::GetSerialPortOutput( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "serialPort"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("port", std::to_string(request.port())), - std::make_pair("start", request.start())})); + std::move(query_params)); } StatusOr @@ -540,6 +612,9 @@ DefaultInstancesRestStub::GetShieldedInstanceIdentity( Options const& options, google::cloud::cpp::compute::instances::v1:: GetShieldedInstanceIdentityRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::ShieldedInstanceIdentity>( *service_, rest_context, request, false, @@ -547,7 +622,8 @@ DefaultInstancesRestStub::GetShieldedInstanceIdentity( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), - "/", "getShieldedInstanceIdentity")); + "/", "getShieldedInstanceIdentity"), + std::move(query_params)); } future> @@ -562,6 +638,14 @@ DefaultInstancesRestStub::AsyncInsertInstance( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back( + {"source_instance_template", request.source_instance_template()}); + query_params.push_back( + {"source_machine_image", request.source_machine_image()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.instance_resource(), false, @@ -569,12 +653,7 @@ DefaultInstancesRestStub::AsyncInsertInstance( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("source_instance_template", - request.source_instance_template()), - std::make_pair("source_machine_image", - request.source_machine_image())}))); + std::move(query_params))); }, std::move(p), service_, @@ -593,18 +672,21 @@ DefaultInstancesRestStub::InsertInstance( Options const& options, google::cloud::cpp::compute::instances::v1::InsertInstanceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back( + {"source_instance_template", request.source_instance_template()}); + query_params.push_back( + {"source_machine_image", request.source_machine_image()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("source_instance_template", - request.source_instance_template()), - std::make_pair("source_machine_image", - request.source_machine_image())})); + std::move(query_params)); } StatusOr @@ -613,19 +695,23 @@ DefaultInstancesRestStub::ListInstances( Options const& options, google::cloud::cpp::compute::instances::v1::ListInstancesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -634,6 +720,16 @@ DefaultInstancesRestStub::ListReferrers( Options const& options, google::cloud::cpp::compute::instances::v1::ListReferrersRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InstanceListReferrers>( *service_, rest_context, request, false, @@ -642,13 +738,7 @@ DefaultInstancesRestStub::ListReferrers( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "referrers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -663,6 +753,9 @@ DefaultInstancesRestStub::AsyncPerformMaintenance( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -671,7 +764,8 @@ DefaultInstancesRestStub::AsyncPerformMaintenance( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", - "performMaintenance"))); + "performMaintenance"), + std::move(query_params))); }, std::move(p), service_, @@ -690,13 +784,17 @@ DefaultInstancesRestStub::PerformMaintenance( Options const& options, google::cloud::cpp::compute::instances::v1::PerformMaintenanceRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), - "/", "performMaintenance")); + "/", "performMaintenance"), + std::move(query_params)); } future> @@ -711,6 +809,10 @@ DefaultInstancesRestStub::AsyncRemoveResourcePolicies( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -722,8 +824,7 @@ DefaultInstancesRestStub::AsyncRemoveResourcePolicies( "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "removeResourcePolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -742,6 +843,10 @@ DefaultInstancesRestStub::RemoveResourcePolicies( Options const& options, google::cloud::cpp::compute::instances::v1:: RemoveResourcePoliciesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instances_remove_resource_policies_request_resource(), false, @@ -750,8 +855,7 @@ DefaultInstancesRestStub::RemoveResourcePolicies( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "removeResourcePolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -765,6 +869,9 @@ DefaultInstancesRestStub::AsyncReset( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -772,7 +879,8 @@ DefaultInstancesRestStub::AsyncReset( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", - "/", request.instance(), "/", "reset"))); + "/", request.instance(), "/", "reset"), + std::move(query_params))); }, std::move(p), service_, @@ -790,13 +898,17 @@ DefaultInstancesRestStub::Reset( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::instances::v1::ResetRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), - "/", "reset")); + "/", "reset"), + std::move(query_params)); } future> @@ -810,6 +922,9 @@ DefaultInstancesRestStub::AsyncResume( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -817,7 +932,8 @@ DefaultInstancesRestStub::AsyncResume( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", - "/", request.instance(), "/", "resume"))); + "/", request.instance(), "/", "resume"), + std::move(query_params))); }, std::move(p), service_, @@ -835,13 +951,17 @@ DefaultInstancesRestStub::Resume( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::instances::v1::ResumeRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), - "/", "resume")); + "/", "resume"), + std::move(query_params)); } Status DefaultInstancesRestStub::SendDiagnosticInterrupt( @@ -849,13 +969,17 @@ Status DefaultInstancesRestStub::SendDiagnosticInterrupt( Options const& options, google::cloud::cpp::compute::instances::v1:: SendDiagnosticInterruptRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), - "/", "sendDiagnosticInterrupt")); + "/", "sendDiagnosticInterrupt"), + std::move(query_params)); } future> @@ -870,6 +994,9 @@ DefaultInstancesRestStub::AsyncSetDeletionProtection( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -878,7 +1005,8 @@ DefaultInstancesRestStub::AsyncSetDeletionProtection( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.resource(), "/", - "setDeletionProtection"))); + "setDeletionProtection"), + std::move(query_params))); }, std::move(p), service_, @@ -897,13 +1025,17 @@ DefaultInstancesRestStub::SetDeletionProtection( Options const& options, google::cloud::cpp::compute::instances::v1:: SetDeletionProtectionRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.resource(), - "/", "setDeletionProtection")); + "/", "setDeletionProtection"), + std::move(query_params)); } future> @@ -918,6 +1050,9 @@ DefaultInstancesRestStub::AsyncSetDiskAutoDelete( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -925,8 +1060,8 @@ DefaultInstancesRestStub::AsyncSetDiskAutoDelete( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", - "/", request.instance(), "/", - "setDiskAutoDelete"))); + "/", request.instance(), "/", "setDiskAutoDelete"), + std::move(query_params))); }, std::move(p), service_, @@ -945,13 +1080,17 @@ DefaultInstancesRestStub::SetDiskAutoDelete( Options const& options, google::cloud::cpp::compute::instances::v1::SetDiskAutoDeleteRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), - "/", "setDiskAutoDelete")); + "/", "setDiskAutoDelete"), + std::move(query_params)); } StatusOr @@ -960,6 +1099,9 @@ DefaultInstancesRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::instances::v1::SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.zone_set_policy_request_resource(), false, @@ -967,7 +1109,8 @@ DefaultInstancesRestStub::SetIamPolicy( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.resource(), - "/", "setIamPolicy")); + "/", "setIamPolicy"), + std::move(query_params)); } future> @@ -982,6 +1125,10 @@ DefaultInstancesRestStub::AsyncSetLabels( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -991,8 +1138,7 @@ DefaultInstancesRestStub::AsyncSetLabels( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setLabels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -1011,6 +1157,10 @@ DefaultInstancesRestStub::SetLabels( Options const& options, google::cloud::cpp::compute::instances::v1::SetLabelsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instances_set_labels_request_resource(), false, @@ -1019,8 +1169,7 @@ DefaultInstancesRestStub::SetLabels( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setLabels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -1035,6 +1184,10 @@ DefaultInstancesRestStub::AsyncSetMachineResources( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -1046,8 +1199,7 @@ DefaultInstancesRestStub::AsyncSetMachineResources( "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setMachineResources"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -1066,6 +1218,10 @@ DefaultInstancesRestStub::SetMachineResources( Options const& options, google::cloud::cpp::compute::instances::v1:: SetMachineResourcesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instances_set_machine_resources_request_resource(), false, @@ -1074,8 +1230,7 @@ DefaultInstancesRestStub::SetMachineResources( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setMachineResources"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -1090,6 +1245,10 @@ DefaultInstancesRestStub::AsyncSetMachineType( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -1099,8 +1258,7 @@ DefaultInstancesRestStub::AsyncSetMachineType( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setMachineType"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -1119,6 +1277,10 @@ DefaultInstancesRestStub::SetMachineType( Options const& options, google::cloud::cpp::compute::instances::v1::SetMachineTypeRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instances_set_machine_type_request_resource(), false, @@ -1127,8 +1289,7 @@ DefaultInstancesRestStub::SetMachineType( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setMachineType"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -1143,6 +1304,10 @@ DefaultInstancesRestStub::AsyncSetMetadata( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.metadata_resource(), false, @@ -1151,8 +1316,7 @@ DefaultInstancesRestStub::AsyncSetMetadata( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setMetadata"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -1171,6 +1335,10 @@ DefaultInstancesRestStub::SetMetadata( Options const& options, google::cloud::cpp::compute::instances::v1::SetMetadataRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.metadata_resource(), false, absl::StrCat("/", "compute", "/", @@ -1178,8 +1346,7 @@ DefaultInstancesRestStub::SetMetadata( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setMetadata"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -1194,6 +1361,10 @@ DefaultInstancesRestStub::AsyncSetMinCpuPlatform( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -1204,8 +1375,7 @@ DefaultInstancesRestStub::AsyncSetMinCpuPlatform( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setMinCpuPlatform"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -1224,6 +1394,10 @@ DefaultInstancesRestStub::SetMinCpuPlatform( Options const& options, google::cloud::cpp::compute::instances::v1::SetMinCpuPlatformRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instances_set_min_cpu_platform_request_resource(), false, @@ -1232,8 +1406,7 @@ DefaultInstancesRestStub::SetMinCpuPlatform( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setMinCpuPlatform"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -1247,6 +1420,10 @@ DefaultInstancesRestStub::AsyncSetName( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -1256,8 +1433,7 @@ DefaultInstancesRestStub::AsyncSetName( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setName"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -1275,6 +1451,10 @@ DefaultInstancesRestStub::SetName( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::instances::v1::SetNameRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instances_set_name_request_resource(), false, @@ -1283,8 +1463,7 @@ DefaultInstancesRestStub::SetName( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setName"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -1299,6 +1478,10 @@ DefaultInstancesRestStub::AsyncSetScheduling( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.scheduling_resource(), false, @@ -1307,8 +1490,7 @@ DefaultInstancesRestStub::AsyncSetScheduling( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setScheduling"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -1327,6 +1509,10 @@ DefaultInstancesRestStub::SetScheduling( Options const& options, google::cloud::cpp::compute::instances::v1::SetSchedulingRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.scheduling_resource(), false, absl::StrCat("/", "compute", "/", @@ -1334,8 +1520,7 @@ DefaultInstancesRestStub::SetScheduling( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setScheduling"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -1350,6 +1535,10 @@ DefaultInstancesRestStub::AsyncSetSecurityPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -1359,8 +1548,7 @@ DefaultInstancesRestStub::AsyncSetSecurityPolicy( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setSecurityPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -1379,6 +1567,10 @@ DefaultInstancesRestStub::SetSecurityPolicy( Options const& options, google::cloud::cpp::compute::instances::v1::SetSecurityPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instances_set_security_policy_request_resource(), false, @@ -1387,8 +1579,7 @@ DefaultInstancesRestStub::SetSecurityPolicy( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setSecurityPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -1403,6 +1594,10 @@ DefaultInstancesRestStub::AsyncSetServiceAccount( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -1412,8 +1607,7 @@ DefaultInstancesRestStub::AsyncSetServiceAccount( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setServiceAccount"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -1432,6 +1626,10 @@ DefaultInstancesRestStub::SetServiceAccount( Options const& options, google::cloud::cpp::compute::instances::v1::SetServiceAccountRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instances_set_service_account_request_resource(), false, @@ -1440,8 +1638,7 @@ DefaultInstancesRestStub::SetServiceAccount( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setServiceAccount"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -1456,6 +1653,10 @@ DefaultInstancesRestStub::AsyncSetShieldedInstanceIntegrityPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, @@ -1466,8 +1667,7 @@ DefaultInstancesRestStub::AsyncSetShieldedInstanceIntegrityPolicy( "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setShieldedInstanceIntegrityPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -1486,6 +1686,10 @@ DefaultInstancesRestStub::SetShieldedInstanceIntegrityPolicy( Options const& options, google::cloud::cpp::compute::instances::v1:: SetShieldedInstanceIntegrityPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.shielded_instance_integrity_policy_resource(), false, @@ -1494,8 +1698,7 @@ DefaultInstancesRestStub::SetShieldedInstanceIntegrityPolicy( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setShieldedInstanceIntegrityPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -1509,6 +1712,10 @@ DefaultInstancesRestStub::AsyncSetTags( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.tags_resource(), false, @@ -1517,8 +1724,7 @@ DefaultInstancesRestStub::AsyncSetTags( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setTags"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -1536,6 +1742,10 @@ DefaultInstancesRestStub::SetTags( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::instances::v1::SetTagsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.tags_resource(), false, absl::StrCat("/", "compute", "/", @@ -1543,8 +1753,7 @@ DefaultInstancesRestStub::SetTags( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "setTags"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -1559,6 +1768,9 @@ DefaultInstancesRestStub::AsyncSimulateMaintenanceEvent( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -1567,7 +1779,8 @@ DefaultInstancesRestStub::AsyncSimulateMaintenanceEvent( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", - "simulateMaintenanceEvent"))); + "simulateMaintenanceEvent"), + std::move(query_params))); }, std::move(p), service_, @@ -1586,13 +1799,17 @@ DefaultInstancesRestStub::SimulateMaintenanceEvent( Options const& options, google::cloud::cpp::compute::instances::v1:: SimulateMaintenanceEventRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), - "/", "simulateMaintenanceEvent")); + "/", "simulateMaintenanceEvent"), + std::move(query_params)); } future> @@ -1606,6 +1823,9 @@ DefaultInstancesRestStub::AsyncStart( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -1613,7 +1833,8 @@ DefaultInstancesRestStub::AsyncStart( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", - "/", request.instance(), "/", "start"))); + "/", request.instance(), "/", "start"), + std::move(query_params))); }, std::move(p), service_, @@ -1631,13 +1852,17 @@ DefaultInstancesRestStub::Start( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::instances::v1::StartRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), - "/", "start")); + "/", "start"), + std::move(query_params)); } future> @@ -1652,6 +1877,10 @@ DefaultInstancesRestStub::AsyncStartWithEncryptionKey( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -1663,8 +1892,7 @@ DefaultInstancesRestStub::AsyncStartWithEncryptionKey( "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "startWithEncryptionKey"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -1683,6 +1911,10 @@ DefaultInstancesRestStub::StartWithEncryptionKey( Options const& options, google::cloud::cpp::compute::instances::v1:: StartWithEncryptionKeyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instances_start_with_encryption_key_request_resource(), false, @@ -1691,8 +1923,7 @@ DefaultInstancesRestStub::StartWithEncryptionKey( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "startWithEncryptionKey"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -1706,6 +1937,9 @@ DefaultInstancesRestStub::AsyncStop( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -1713,7 +1947,8 @@ DefaultInstancesRestStub::AsyncStop( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", - "/", request.instance(), "/", "stop"))); + "/", request.instance(), "/", "stop"), + std::move(query_params))); }, std::move(p), service_, @@ -1731,13 +1966,17 @@ DefaultInstancesRestStub::Stop( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::instances::v1::StopRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), - "/", "stop")); + "/", "stop"), + std::move(query_params)); } future> @@ -1751,6 +1990,9 @@ DefaultInstancesRestStub::AsyncSuspend( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -1758,7 +2000,8 @@ DefaultInstancesRestStub::AsyncSuspend( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", - "/", request.instance(), "/", "suspend"))); + "/", request.instance(), "/", "suspend"), + std::move(query_params))); }, std::move(p), service_, @@ -1776,13 +2019,17 @@ DefaultInstancesRestStub::Suspend( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::instances::v1::SuspendRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), - "/", "suspend")); + "/", "suspend"), + std::move(query_params)); } StatusOr @@ -1791,6 +2038,9 @@ DefaultInstancesRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::instances::v1::TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -1799,7 +2049,8 @@ DefaultInstancesRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.resource(), - "/", "testIamPermissions")); + "/", "testIamPermissions"), + std::move(query_params)); } future> @@ -1814,6 +2065,13 @@ DefaultInstancesRestStub::AsyncUpdateInstance( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"minimal_action", request.minimal_action()}); + query_params.push_back({"most_disruptive_allowed_action", + request.most_disruptive_allowed_action()}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Put( *service, *rest_context, request.instance_resource(), false, @@ -1822,11 +2080,7 @@ DefaultInstancesRestStub::AsyncUpdateInstance( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("minimal_action", request.minimal_action()), - std::make_pair("most_disruptive_allowed_action", - request.most_disruptive_allowed_action()), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -1845,17 +2099,20 @@ DefaultInstancesRestStub::UpdateInstance( Options const& options, google::cloud::cpp::compute::instances::v1::UpdateInstanceRequest const& request) { + std::vector> query_params; + query_params.push_back({"minimal_action", request.minimal_action()}); + query_params.push_back({"most_disruptive_allowed_action", + request.most_disruptive_allowed_action()}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.instance_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("minimal_action", request.minimal_action()), - std::make_pair("most_disruptive_allowed_action", - request.most_disruptive_allowed_action()), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -1870,6 +2127,12 @@ DefaultInstancesRestStub::AsyncUpdateAccessConfig( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"network_interface", request.network_interface()}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.access_config_resource(), @@ -1880,10 +2143,7 @@ DefaultInstancesRestStub::AsyncUpdateAccessConfig( "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "updateAccessConfig"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("network_interface", - request.network_interface()), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -1902,6 +2162,11 @@ DefaultInstancesRestStub::UpdateAccessConfig( Options const& options, google::cloud::cpp::compute::instances::v1::UpdateAccessConfigRequest const& request) { + std::vector> query_params; + query_params.push_back({"network_interface", request.network_interface()}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.access_config_resource(), false, absl::StrCat("/", "compute", "/", @@ -1909,9 +2174,7 @@ DefaultInstancesRestStub::UpdateAccessConfig( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "updateAccessConfig"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("network_interface", request.network_interface()), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -1926,6 +2189,10 @@ DefaultInstancesRestStub::AsyncUpdateDisplayDevice( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.display_device_resource(), @@ -1936,8 +2203,7 @@ DefaultInstancesRestStub::AsyncUpdateDisplayDevice( "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "updateDisplayDevice"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -1956,6 +2222,10 @@ DefaultInstancesRestStub::UpdateDisplayDevice( Options const& options, google::cloud::cpp::compute::instances::v1:: UpdateDisplayDeviceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.display_device_resource(), false, absl::StrCat("/", "compute", "/", @@ -1963,8 +2233,7 @@ DefaultInstancesRestStub::UpdateDisplayDevice( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "updateDisplayDevice"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -1979,6 +2248,12 @@ DefaultInstancesRestStub::AsyncUpdateNetworkInterface( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"network_interface", request.network_interface()}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.network_interface_resource(), @@ -1989,10 +2264,7 @@ DefaultInstancesRestStub::AsyncUpdateNetworkInterface( "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "updateNetworkInterface"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("network_interface", - request.network_interface()), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -2011,6 +2283,11 @@ DefaultInstancesRestStub::UpdateNetworkInterface( Options const& options, google::cloud::cpp::compute::instances::v1:: UpdateNetworkInterfaceRequest const& request) { + std::vector> query_params; + query_params.push_back({"network_interface", request.network_interface()}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.network_interface_resource(), false, absl::StrCat("/", "compute", "/", @@ -2018,9 +2295,7 @@ DefaultInstancesRestStub::UpdateNetworkInterface( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "updateNetworkInterface"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("network_interface", request.network_interface()), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -2035,6 +2310,10 @@ DefaultInstancesRestStub::AsyncUpdateShieldedInstanceConfig( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, @@ -2045,8 +2324,7 @@ DefaultInstancesRestStub::AsyncUpdateShieldedInstanceConfig( "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "updateShieldedInstanceConfig"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -2065,6 +2343,10 @@ DefaultInstancesRestStub::UpdateShieldedInstanceConfig( Options const& options, google::cloud::cpp::compute::instances::v1:: UpdateShieldedInstanceConfigRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.shielded_instance_config_resource(), false, @@ -2073,8 +2355,7 @@ DefaultInstancesRestStub::UpdateShieldedInstanceConfig( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "instances", "/", request.instance(), "/", "updateShieldedInstanceConfig"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.cc b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.cc index 5f8242f529963..33e6922e018d1 100644 --- a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.cc +++ b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.cc @@ -53,6 +53,20 @@ DefaultInterconnectAttachmentsRestStub::AggregatedListInterconnectAttachments( Options const& options, google::cloud::cpp::compute::interconnect_attachments::v1:: AggregatedListInterconnectAttachmentsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InterconnectAttachmentAggregatedList>( *service_, rest_context, request, false, @@ -60,17 +74,7 @@ DefaultInterconnectAttachmentsRestStub::AggregatedListInterconnectAttachments( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "interconnectAttachments"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -85,6 +89,10 @@ DefaultInterconnectAttachmentsRestStub::AsyncDeleteInterconnectAttachment( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -94,8 +102,7 @@ DefaultInterconnectAttachmentsRestStub::AsyncDeleteInterconnectAttachment( "regions", "/", request.region(), "/", "interconnectAttachments", "/", request.interconnect_attachment()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -114,6 +121,10 @@ DefaultInterconnectAttachmentsRestStub::DeleteInterconnectAttachment( Options const& options, google::cloud::cpp::compute::interconnect_attachments::v1:: DeleteInterconnectAttachmentRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -121,8 +132,7 @@ DefaultInterconnectAttachmentsRestStub::DeleteInterconnectAttachment( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "interconnectAttachments", "/", request.interconnect_attachment()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -131,6 +141,9 @@ DefaultInterconnectAttachmentsRestStub::GetInterconnectAttachment( Options const& options, google::cloud::cpp::compute::interconnect_attachments::v1:: GetInterconnectAttachmentRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InterconnectAttachment>( *service_, rest_context, request, false, @@ -138,7 +151,8 @@ DefaultInterconnectAttachmentsRestStub::GetInterconnectAttachment( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "interconnectAttachments", "/", - request.interconnect_attachment())); + request.interconnect_attachment()), + std::move(query_params)); } future> @@ -153,6 +167,12 @@ DefaultInterconnectAttachmentsRestStub::AsyncInsertInterconnectAttachment( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back( + {"validate_only", (request.validate_only() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -162,10 +182,7 @@ DefaultInterconnectAttachmentsRestStub::AsyncInsertInterconnectAttachment( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "interconnectAttachments"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("validate_only", - (request.validate_only() ? "1" : "0"))}))); + std::move(query_params))); }, std::move(p), service_, @@ -184,6 +201,12 @@ DefaultInterconnectAttachmentsRestStub::InsertInterconnectAttachment( Options const& options, google::cloud::cpp::compute::interconnect_attachments::v1:: InsertInterconnectAttachmentRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back( + {"validate_only", (request.validate_only() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.interconnect_attachment_resource(), false, @@ -191,10 +214,7 @@ DefaultInterconnectAttachmentsRestStub::InsertInterconnectAttachment( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "interconnectAttachments"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("validate_only", - (request.validate_only() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -203,6 +223,16 @@ DefaultInterconnectAttachmentsRestStub::ListInterconnectAttachments( Options const& options, google::cloud::cpp::compute::interconnect_attachments::v1:: ListInterconnectAttachmentsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InterconnectAttachmentList>( *service_, rest_context, request, false, @@ -210,13 +240,7 @@ DefaultInterconnectAttachmentsRestStub::ListInterconnectAttachments( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "interconnectAttachments"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -231,6 +255,10 @@ DefaultInterconnectAttachmentsRestStub::AsyncPatchInterconnectAttachment( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, @@ -241,8 +269,7 @@ DefaultInterconnectAttachmentsRestStub::AsyncPatchInterconnectAttachment( "regions", "/", request.region(), "/", "interconnectAttachments", "/", request.interconnect_attachment()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -261,6 +288,10 @@ DefaultInterconnectAttachmentsRestStub::PatchInterconnectAttachment( Options const& options, google::cloud::cpp::compute::interconnect_attachments::v1:: PatchInterconnectAttachmentRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.interconnect_attachment_resource(), false, @@ -269,8 +300,7 @@ DefaultInterconnectAttachmentsRestStub::PatchInterconnectAttachment( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "interconnectAttachments", "/", request.interconnect_attachment()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -285,6 +315,10 @@ DefaultInterconnectAttachmentsRestStub::AsyncSetLabels( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -295,8 +329,7 @@ DefaultInterconnectAttachmentsRestStub::AsyncSetLabels( "regions", "/", request.region(), "/", "interconnectAttachments", "/", request.resource(), "/", "setLabels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -315,6 +348,10 @@ DefaultInterconnectAttachmentsRestStub::SetLabels( Options const& options, google::cloud::cpp::compute::interconnect_attachments::v1:: SetLabelsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_labels_request_resource(), false, @@ -323,8 +360,7 @@ DefaultInterconnectAttachmentsRestStub::SetLabels( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "interconnectAttachments", "/", request.resource(), "/", "setLabels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_stub.cc b/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_stub.cc index 0252ad80347c2..797d71b69e56d 100644 --- a/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_stub.cc +++ b/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_stub.cc @@ -47,6 +47,9 @@ DefaultInterconnectLocationsRestStub::GetInterconnectLocation( Options const& options, google::cloud::cpp::compute::interconnect_locations::v1:: GetInterconnectLocationRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InterconnectLocation>( *service_, rest_context, request, false, @@ -54,7 +57,8 @@ DefaultInterconnectLocationsRestStub::GetInterconnectLocation( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "interconnectLocations", "/", - request.interconnect_location())); + request.interconnect_location()), + std::move(query_params)); } StatusOr @@ -63,6 +67,16 @@ DefaultInterconnectLocationsRestStub::ListInterconnectLocations( Options const& options, google::cloud::cpp::compute::interconnect_locations::v1:: ListInterconnectLocationsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InterconnectLocationList>( *service_, rest_context, request, false, @@ -70,13 +84,7 @@ DefaultInterconnectLocationsRestStub::ListInterconnectLocations( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "interconnectLocations"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_stub.cc b/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_stub.cc index a58e2c4c2dda6..d54568ad092b1 100644 --- a/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_stub.cc +++ b/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_stub.cc @@ -48,6 +48,9 @@ DefaultInterconnectRemoteLocationsRestStub::GetInterconnectRemoteLocation( Options const& options, google::cloud::cpp::compute::interconnect_remote_locations::v1:: GetInterconnectRemoteLocationRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InterconnectRemoteLocation>( *service_, rest_context, request, false, @@ -55,7 +58,8 @@ DefaultInterconnectRemoteLocationsRestStub::GetInterconnectRemoteLocation( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "interconnectRemoteLocations", "/", - request.interconnect_remote_location())); + request.interconnect_remote_location()), + std::move(query_params)); } StatusOr @@ -64,6 +68,16 @@ DefaultInterconnectRemoteLocationsRestStub::ListInterconnectRemoteLocations( Options const& options, google::cloud::cpp::compute::interconnect_remote_locations::v1:: ListInterconnectRemoteLocationsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InterconnectRemoteLocationList>( *service_, rest_context, request, false, @@ -71,13 +85,7 @@ DefaultInterconnectRemoteLocationsRestStub::ListInterconnectRemoteLocations( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "interconnectRemoteLocations"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.cc b/google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.cc index 0c25963625cd8..7693c0a71bbf9 100644 --- a/google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.cc +++ b/google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.cc @@ -57,6 +57,10 @@ DefaultInterconnectsRestStub::AsyncDeleteInterconnect( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -65,8 +69,7 @@ DefaultInterconnectsRestStub::AsyncDeleteInterconnect( "/", "projects", "/", request.project(), "/", "global", "/", "interconnects", "/", request.interconnect()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -85,14 +88,17 @@ DefaultInterconnectsRestStub::DeleteInterconnect( Options const& options, google::cloud::cpp::compute::interconnects::v1:: DeleteInterconnectRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "interconnects", "/", request.interconnect()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -101,12 +107,16 @@ DefaultInterconnectsRestStub::GetInterconnect( Options const& options, google::cloud::cpp::compute::interconnects::v1:: GetInterconnectRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "interconnects", "/", request.interconnect())); + "interconnects", "/", request.interconnect()), + std::move(query_params)); } StatusOr @@ -115,6 +125,9 @@ DefaultInterconnectsRestStub::GetDiagnostics( Options const& options, google::cloud::cpp::compute::interconnects::v1::GetDiagnosticsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InterconnectsGetDiagnosticsResponse>( *service_, rest_context, request, false, @@ -122,7 +135,8 @@ DefaultInterconnectsRestStub::GetDiagnostics( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "interconnects", "/", request.interconnect(), "/", - "getDiagnostics")); + "getDiagnostics"), + std::move(query_params)); } StatusOr @@ -131,6 +145,9 @@ DefaultInterconnectsRestStub::GetMacsecConfig( Options const& options, google::cloud::cpp::compute::interconnects::v1:: GetMacsecConfigRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InterconnectsGetMacsecConfigResponse>( *service_, rest_context, request, false, @@ -138,7 +155,8 @@ DefaultInterconnectsRestStub::GetMacsecConfig( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "interconnects", "/", request.interconnect(), "/", - "getMacsecConfig")); + "getMacsecConfig"), + std::move(query_params)); } future> @@ -153,6 +171,10 @@ DefaultInterconnectsRestStub::AsyncInsertInterconnect( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.interconnect_resource(), false, @@ -160,8 +182,7 @@ DefaultInterconnectsRestStub::AsyncInsertInterconnect( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "interconnects"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -180,14 +201,17 @@ DefaultInterconnectsRestStub::InsertInterconnect( Options const& options, google::cloud::cpp::compute::interconnects::v1:: InsertInterconnectRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.interconnect_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "interconnects"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -196,19 +220,23 @@ DefaultInterconnectsRestStub::ListInterconnects( Options const& options, google::cloud::cpp::compute::interconnects::v1:: ListInterconnectsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "interconnects"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -223,6 +251,10 @@ DefaultInterconnectsRestStub::AsyncPatchInterconnect( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.interconnect_resource(), false, @@ -231,8 +263,7 @@ DefaultInterconnectsRestStub::AsyncPatchInterconnect( "/", "projects", "/", request.project(), "/", "global", "/", "interconnects", "/", request.interconnect()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -251,14 +282,17 @@ DefaultInterconnectsRestStub::PatchInterconnect( Options const& options, google::cloud::cpp::compute::interconnects::v1:: PatchInterconnectRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.interconnect_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "interconnects", "/", request.interconnect()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -273,6 +307,9 @@ DefaultInterconnectsRestStub::AsyncSetLabels( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -281,7 +318,8 @@ DefaultInterconnectsRestStub::AsyncSetLabels( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "interconnects", "/", - request.resource(), "/", "setLabels"))); + request.resource(), "/", "setLabels"), + std::move(query_params))); }, std::move(p), service_, @@ -300,13 +338,17 @@ DefaultInterconnectsRestStub::SetLabels( Options const& options, google::cloud::cpp::compute::interconnects::v1::SetLabelsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_labels_request_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "interconnects", "/", request.resource(), "/", "setLabels")); + "interconnects", "/", request.resource(), "/", "setLabels"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.cc b/google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.cc index f8ad38edb94a7..e7a664de1e592 100644 --- a/google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.cc +++ b/google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.cc @@ -45,12 +45,16 @@ DefaultLicenseCodesRestStub::GetLicenseCode( Options const& options, google::cloud::cpp::compute::license_codes::v1::GetLicenseCodeRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "licenseCodes", "/", request.license_code())); + "licenseCodes", "/", request.license_code()), + std::move(query_params)); } StatusOr @@ -59,6 +63,9 @@ DefaultLicenseCodesRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::license_codes::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -67,7 +74,8 @@ DefaultLicenseCodesRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "licenseCodes", "/", request.resource(), "/", - "testIamPermissions")); + "testIamPermissions"), + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/compute/licenses/v1/internal/licenses_rest_stub.cc b/google/cloud/compute/licenses/v1/internal/licenses_rest_stub.cc index 584207c675b8f..10feb136e7f8f 100644 --- a/google/cloud/compute/licenses/v1/internal/licenses_rest_stub.cc +++ b/google/cloud/compute/licenses/v1/internal/licenses_rest_stub.cc @@ -57,6 +57,10 @@ DefaultLicensesRestStub::AsyncDeleteLicense( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -64,8 +68,7 @@ DefaultLicensesRestStub::AsyncDeleteLicense( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "licenses", "/", request.license()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -84,14 +87,17 @@ DefaultLicensesRestStub::DeleteLicense( Options const& options, google::cloud::cpp::compute::licenses::v1::DeleteLicenseRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "licenses", "/", request.license()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -100,12 +106,16 @@ DefaultLicensesRestStub::GetLicense( Options const& options, google::cloud::cpp::compute::licenses::v1::GetLicenseRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "licenses", "/", request.license())); + "licenses", "/", request.license()), + std::move(query_params)); } StatusOr @@ -114,15 +124,19 @@ DefaultLicensesRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::licenses::v1::GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "licenses", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } future> @@ -137,6 +151,10 @@ DefaultLicensesRestStub::AsyncInsertLicense( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.license_resource(), false, @@ -144,8 +162,7 @@ DefaultLicensesRestStub::AsyncInsertLicense( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "licenses"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -164,14 +181,17 @@ DefaultLicensesRestStub::InsertLicense( Options const& options, google::cloud::cpp::compute::licenses::v1::InsertLicenseRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.license_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "licenses"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -180,6 +200,16 @@ DefaultLicensesRestStub::ListLicenses( Options const& options, google::cloud::cpp::compute::licenses::v1::ListLicensesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::LicensesListResponse>( *service_, rest_context, request, false, @@ -187,13 +217,7 @@ DefaultLicensesRestStub::ListLicenses( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "licenses"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -202,13 +226,17 @@ DefaultLicensesRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::licenses::v1::SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_policy_request_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "licenses", "/", request.resource(), "/", "setIamPolicy")); + "licenses", "/", request.resource(), "/", "setIamPolicy"), + std::move(query_params)); } StatusOr @@ -217,6 +245,9 @@ DefaultLicensesRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::licenses::v1::TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -225,7 +256,8 @@ DefaultLicensesRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "licenses", "/", request.resource(), "/", - "testIamPermissions")); + "testIamPermissions"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.cc b/google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.cc index 99217d67ae9cf..825e5447dedbd 100644 --- a/google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.cc +++ b/google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.cc @@ -57,6 +57,10 @@ DefaultMachineImagesRestStub::AsyncDeleteMachineImage( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -65,8 +69,7 @@ DefaultMachineImagesRestStub::AsyncDeleteMachineImage( "/", "projects", "/", request.project(), "/", "global", "/", "machineImages", "/", request.machine_image()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -85,14 +88,17 @@ DefaultMachineImagesRestStub::DeleteMachineImage( Options const& options, google::cloud::cpp::compute::machine_images::v1:: DeleteMachineImageRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "machineImages", "/", request.machine_image()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -101,12 +107,16 @@ DefaultMachineImagesRestStub::GetMachineImage( Options const& options, google::cloud::cpp::compute::machine_images::v1:: GetMachineImageRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "machineImages", "/", request.machine_image())); + "machineImages", "/", request.machine_image()), + std::move(query_params)); } StatusOr @@ -115,6 +125,12 @@ DefaultMachineImagesRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::machine_images::v1::GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -122,9 +138,7 @@ DefaultMachineImagesRestStub::GetIamPolicy( "projects", "/", request.project(), "/", "global", "/", "machineImages", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } future> @@ -139,6 +153,11 @@ DefaultMachineImagesRestStub::AsyncInsertMachineImage( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"source_instance", request.source_instance()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.machine_image_resource(), @@ -147,10 +166,7 @@ DefaultMachineImagesRestStub::AsyncInsertMachineImage( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "machineImages"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("source_instance", - request.source_instance())}))); + std::move(query_params))); }, std::move(p), service_, @@ -169,15 +185,18 @@ DefaultMachineImagesRestStub::InsertMachineImage( Options const& options, google::cloud::cpp::compute::machine_images::v1:: InsertMachineImageRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"source_instance", request.source_instance()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.machine_image_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "machineImages"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("source_instance", request.source_instance())})); + std::move(query_params)); } StatusOr @@ -186,19 +205,23 @@ DefaultMachineImagesRestStub::ListMachineImages( Options const& options, google::cloud::cpp::compute::machine_images::v1:: ListMachineImagesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "machineImages"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -207,6 +230,9 @@ DefaultMachineImagesRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::machine_images::v1::SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_policy_request_resource(), false, @@ -214,7 +240,8 @@ DefaultMachineImagesRestStub::SetIamPolicy( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "machineImages", "/", request.resource(), "/", - "setIamPolicy")); + "setIamPolicy"), + std::move(query_params)); } StatusOr @@ -223,6 +250,9 @@ DefaultMachineImagesRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::machine_images::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -231,7 +261,8 @@ DefaultMachineImagesRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "machineImages", "/", request.resource(), "/", - "testIamPermissions")); + "testIamPermissions"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.cc b/google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.cc index a48a979dd8989..426eda2a6c21a 100644 --- a/google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.cc +++ b/google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.cc @@ -45,6 +45,20 @@ DefaultMachineTypesRestStub::AggregatedListMachineTypes( Options const& options, google::cloud::cpp::compute::machine_types::v1:: AggregatedListMachineTypesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::MachineTypeAggregatedList>( *service_, rest_context, request, false, @@ -52,17 +66,7 @@ DefaultMachineTypesRestStub::AggregatedListMachineTypes( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "machineTypes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } StatusOr @@ -71,13 +75,17 @@ DefaultMachineTypesRestStub::GetMachineType( Options const& options, google::cloud::cpp::compute::machine_types::v1::GetMachineTypeRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "machineTypes", "/", - request.machine_type())); + request.machine_type()), + std::move(query_params)); } StatusOr @@ -86,19 +94,23 @@ DefaultMachineTypesRestStub::ListMachineTypes( Options const& options, google::cloud::cpp::compute::machine_types::v1:: ListMachineTypesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "machineTypes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.cc b/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.cc index 98902a818554b..89f3db97b3474 100644 --- a/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.cc +++ b/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.cc @@ -52,6 +52,20 @@ DefaultNetworkAttachmentsRestStub::AggregatedListNetworkAttachments( Options const& options, google::cloud::cpp::compute::network_attachments::v1:: AggregatedListNetworkAttachmentsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NetworkAttachmentAggregatedList>( *service_, rest_context, request, false, @@ -59,17 +73,7 @@ DefaultNetworkAttachmentsRestStub::AggregatedListNetworkAttachments( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "networkAttachments"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -84,6 +88,10 @@ DefaultNetworkAttachmentsRestStub::AsyncDeleteNetworkAttachment( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -93,8 +101,7 @@ DefaultNetworkAttachmentsRestStub::AsyncDeleteNetworkAttachment( "regions", "/", request.region(), "/", "networkAttachments", "/", request.network_attachment()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -113,6 +120,10 @@ DefaultNetworkAttachmentsRestStub::DeleteNetworkAttachment( Options const& options, google::cloud::cpp::compute::network_attachments::v1:: DeleteNetworkAttachmentRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -120,8 +131,7 @@ DefaultNetworkAttachmentsRestStub::DeleteNetworkAttachment( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkAttachments", "/", request.network_attachment()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -130,13 +140,17 @@ DefaultNetworkAttachmentsRestStub::GetNetworkAttachment( Options const& options, google::cloud::cpp::compute::network_attachments::v1:: GetNetworkAttachmentRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkAttachments", "/", - request.network_attachment())); + request.network_attachment()), + std::move(query_params)); } StatusOr @@ -145,6 +159,12 @@ DefaultNetworkAttachmentsRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::network_attachments::v1:: GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -152,9 +172,7 @@ DefaultNetworkAttachmentsRestStub::GetIamPolicy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkAttachments", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } future> @@ -169,6 +187,10 @@ DefaultNetworkAttachmentsRestStub::AsyncInsertNetworkAttachment( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.network_attachment_resource(), @@ -178,8 +200,7 @@ DefaultNetworkAttachmentsRestStub::AsyncInsertNetworkAttachment( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkAttachments"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -198,14 +219,17 @@ DefaultNetworkAttachmentsRestStub::InsertNetworkAttachment( Options const& options, google::cloud::cpp::compute::network_attachments::v1:: InsertNetworkAttachmentRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.network_attachment_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkAttachments"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -214,6 +238,16 @@ DefaultNetworkAttachmentsRestStub::ListNetworkAttachments( Options const& options, google::cloud::cpp::compute::network_attachments::v1:: ListNetworkAttachmentsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NetworkAttachmentList>( *service_, rest_context, request, false, @@ -221,13 +255,7 @@ DefaultNetworkAttachmentsRestStub::ListNetworkAttachments( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkAttachments"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -242,6 +270,10 @@ DefaultNetworkAttachmentsRestStub::AsyncPatchNetworkAttachment( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.network_attachment_resource(), @@ -252,8 +284,7 @@ DefaultNetworkAttachmentsRestStub::AsyncPatchNetworkAttachment( "regions", "/", request.region(), "/", "networkAttachments", "/", request.network_attachment()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -272,6 +303,10 @@ DefaultNetworkAttachmentsRestStub::PatchNetworkAttachment( Options const& options, google::cloud::cpp::compute::network_attachments::v1:: PatchNetworkAttachmentRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.network_attachment_resource(), false, absl::StrCat("/", "compute", "/", @@ -279,8 +314,7 @@ DefaultNetworkAttachmentsRestStub::PatchNetworkAttachment( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkAttachments", "/", request.network_attachment()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -289,6 +323,9 @@ DefaultNetworkAttachmentsRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::network_attachments::v1:: SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_policy_request_resource(), false, @@ -296,7 +333,8 @@ DefaultNetworkAttachmentsRestStub::SetIamPolicy( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkAttachments", "/", - request.resource(), "/", "setIamPolicy")); + request.resource(), "/", "setIamPolicy"), + std::move(query_params)); } StatusOr @@ -305,6 +343,9 @@ DefaultNetworkAttachmentsRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::network_attachments::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -313,7 +354,8 @@ DefaultNetworkAttachmentsRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkAttachments", "/", - request.resource(), "/", "testIamPermissions")); + request.resource(), "/", "testIamPermissions"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.cc b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.cc index fcaaf26491fa4..bcc89c26a583c 100644 --- a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.cc +++ b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.cc @@ -56,6 +56,20 @@ DefaultNetworkEdgeSecurityServicesRestStub:: Options const& options, google::cloud::cpp::compute::network_edge_security_services::v1:: AggregatedListNetworkEdgeSecurityServicesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, @@ -63,17 +77,7 @@ DefaultNetworkEdgeSecurityServicesRestStub:: rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "networkEdgeSecurityServices"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -89,6 +93,10 @@ DefaultNetworkEdgeSecurityServicesRestStub:: p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -98,8 +106,7 @@ DefaultNetworkEdgeSecurityServicesRestStub:: "regions", "/", request.region(), "/", "networkEdgeSecurityServices", "/", request.network_edge_security_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -118,6 +125,10 @@ DefaultNetworkEdgeSecurityServicesRestStub::DeleteNetworkEdgeSecurityService( Options const& options, google::cloud::cpp::compute::network_edge_security_services::v1:: DeleteNetworkEdgeSecurityServiceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -125,8 +136,7 @@ DefaultNetworkEdgeSecurityServicesRestStub::DeleteNetworkEdgeSecurityService( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkEdgeSecurityServices", "/", request.network_edge_security_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -135,6 +145,9 @@ DefaultNetworkEdgeSecurityServicesRestStub::GetNetworkEdgeSecurityService( Options const& options, google::cloud::cpp::compute::network_edge_security_services::v1:: GetNetworkEdgeSecurityServiceRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NetworkEdgeSecurityService>( *service_, rest_context, request, false, @@ -142,7 +155,8 @@ DefaultNetworkEdgeSecurityServicesRestStub::GetNetworkEdgeSecurityService( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkEdgeSecurityServices", "/", - request.network_edge_security_service())); + request.network_edge_security_service()), + std::move(query_params)); } future> @@ -158,6 +172,12 @@ DefaultNetworkEdgeSecurityServicesRestStub:: p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back( + {"validate_only", (request.validate_only() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -167,10 +187,7 @@ DefaultNetworkEdgeSecurityServicesRestStub:: "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkEdgeSecurityServices"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("validate_only", - (request.validate_only() ? "1" : "0"))}))); + std::move(query_params))); }, std::move(p), service_, @@ -189,6 +206,12 @@ DefaultNetworkEdgeSecurityServicesRestStub::InsertNetworkEdgeSecurityService( Options const& options, google::cloud::cpp::compute::network_edge_security_services::v1:: InsertNetworkEdgeSecurityServiceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back( + {"validate_only", (request.validate_only() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.network_edge_security_service_resource(), false, @@ -196,10 +219,7 @@ DefaultNetworkEdgeSecurityServicesRestStub::InsertNetworkEdgeSecurityService( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkEdgeSecurityServices"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("validate_only", - (request.validate_only() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -215,6 +235,12 @@ DefaultNetworkEdgeSecurityServicesRestStub:: p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"paths", request.paths()}); + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, @@ -225,10 +251,7 @@ DefaultNetworkEdgeSecurityServicesRestStub:: "regions", "/", request.region(), "/", "networkEdgeSecurityServices", "/", request.network_edge_security_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("paths", request.paths()), - std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())}))); + std::move(query_params))); }, std::move(p), service_, @@ -247,6 +270,12 @@ DefaultNetworkEdgeSecurityServicesRestStub::PatchNetworkEdgeSecurityService( Options const& options, google::cloud::cpp::compute::network_edge_security_services::v1:: PatchNetworkEdgeSecurityServiceRequest const& request) { + std::vector> query_params; + query_params.push_back({"paths", request.paths()}); + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.network_edge_security_service_resource(), false, @@ -255,10 +284,7 @@ DefaultNetworkEdgeSecurityServicesRestStub::PatchNetworkEdgeSecurityService( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkEdgeSecurityServices", "/", request.network_edge_security_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("paths", request.paths()), - std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.cc b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.cc index c561ec5bf24bf..499c79bbed346 100644 --- a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.cc +++ b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.cc @@ -53,6 +53,20 @@ DefaultNetworkEndpointGroupsRestStub::AggregatedListNetworkEndpointGroups( Options const& options, google::cloud::cpp::compute::network_endpoint_groups::v1:: AggregatedListNetworkEndpointGroupsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NetworkEndpointGroupAggregatedList>( *service_, rest_context, request, false, @@ -60,17 +74,7 @@ DefaultNetworkEndpointGroupsRestStub::AggregatedListNetworkEndpointGroups( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "networkEndpointGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -85,6 +89,10 @@ DefaultNetworkEndpointGroupsRestStub::AsyncAttachNetworkEndpoints( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -96,8 +104,7 @@ DefaultNetworkEndpointGroupsRestStub::AsyncAttachNetworkEndpoints( "/", request.zone(), "/", "networkEndpointGroups", "/", request.network_endpoint_group(), "/", "attachNetworkEndpoints"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -116,6 +123,10 @@ DefaultNetworkEndpointGroupsRestStub::AttachNetworkEndpoints( Options const& options, google::cloud::cpp::compute::network_endpoint_groups::v1:: AttachNetworkEndpointsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.network_endpoint_groups_attach_endpoints_request_resource(), @@ -126,8 +137,7 @@ DefaultNetworkEndpointGroupsRestStub::AttachNetworkEndpoints( request.zone(), "/", "networkEndpointGroups", "/", request.network_endpoint_group(), "/", "attachNetworkEndpoints"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -142,6 +152,10 @@ DefaultNetworkEndpointGroupsRestStub::AsyncDeleteNetworkEndpointGroup( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -151,8 +165,7 @@ DefaultNetworkEndpointGroupsRestStub::AsyncDeleteNetworkEndpointGroup( "zones", "/", request.zone(), "/", "networkEndpointGroups", "/", request.network_endpoint_group()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -171,6 +184,10 @@ DefaultNetworkEndpointGroupsRestStub::DeleteNetworkEndpointGroup( Options const& options, google::cloud::cpp::compute::network_endpoint_groups::v1:: DeleteNetworkEndpointGroupRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -178,8 +195,7 @@ DefaultNetworkEndpointGroupsRestStub::DeleteNetworkEndpointGroup( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "networkEndpointGroups", "/", request.network_endpoint_group()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -194,6 +210,10 @@ DefaultNetworkEndpointGroupsRestStub::AsyncDetachNetworkEndpoints( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -205,8 +225,7 @@ DefaultNetworkEndpointGroupsRestStub::AsyncDetachNetworkEndpoints( "/", request.zone(), "/", "networkEndpointGroups", "/", request.network_endpoint_group(), "/", "detachNetworkEndpoints"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -225,6 +244,10 @@ DefaultNetworkEndpointGroupsRestStub::DetachNetworkEndpoints( Options const& options, google::cloud::cpp::compute::network_endpoint_groups::v1:: DetachNetworkEndpointsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.network_endpoint_groups_detach_endpoints_request_resource(), @@ -235,8 +258,7 @@ DefaultNetworkEndpointGroupsRestStub::DetachNetworkEndpoints( request.zone(), "/", "networkEndpointGroups", "/", request.network_endpoint_group(), "/", "detachNetworkEndpoints"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -245,6 +267,9 @@ DefaultNetworkEndpointGroupsRestStub::GetNetworkEndpointGroup( Options const& options, google::cloud::cpp::compute::network_endpoint_groups::v1:: GetNetworkEndpointGroupRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NetworkEndpointGroup>( *service_, rest_context, request, false, @@ -252,7 +277,8 @@ DefaultNetworkEndpointGroupsRestStub::GetNetworkEndpointGroup( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "networkEndpointGroups", "/", - request.network_endpoint_group())); + request.network_endpoint_group()), + std::move(query_params)); } future> @@ -267,6 +293,10 @@ DefaultNetworkEndpointGroupsRestStub::AsyncInsertNetworkEndpointGroup( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -276,8 +306,7 @@ DefaultNetworkEndpointGroupsRestStub::AsyncInsertNetworkEndpointGroup( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "networkEndpointGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -296,14 +325,17 @@ DefaultNetworkEndpointGroupsRestStub::InsertNetworkEndpointGroup( Options const& options, google::cloud::cpp::compute::network_endpoint_groups::v1:: InsertNetworkEndpointGroupRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.network_endpoint_group_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "networkEndpointGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -312,6 +344,16 @@ DefaultNetworkEndpointGroupsRestStub::ListNetworkEndpointGroups( Options const& options, google::cloud::cpp::compute::network_endpoint_groups::v1:: ListNetworkEndpointGroupsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NetworkEndpointGroupList>( *service_, rest_context, request, false, @@ -319,13 +361,7 @@ DefaultNetworkEndpointGroupsRestStub::ListNetworkEndpointGroups( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "networkEndpointGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr< @@ -335,6 +371,16 @@ DefaultNetworkEndpointGroupsRestStub::ListNetworkEndpoints( Options const& options, google::cloud::cpp::compute::network_endpoint_groups::v1:: ListNetworkEndpointsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, @@ -345,13 +391,7 @@ DefaultNetworkEndpointGroupsRestStub::ListNetworkEndpoints( request.zone(), "/", "networkEndpointGroups", "/", request.network_endpoint_group(), "/", "listNetworkEndpoints"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -360,6 +400,9 @@ DefaultNetworkEndpointGroupsRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::network_endpoint_groups::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -368,7 +411,8 @@ DefaultNetworkEndpointGroupsRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "networkEndpointGroups", "/", - request.resource(), "/", "testIamPermissions")); + request.resource(), "/", "testIamPermissions"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.cc b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.cc index 9e8aae4fa001f..8748e0d9da568 100644 --- a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.cc +++ b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.cc @@ -59,6 +59,13 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncAddAssociation( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"replace_existing_association", + (request.replace_existing_association() ? "1" : "0")}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -68,11 +75,7 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncAddAssociation( "/", "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", "addAssociation"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair( - "replace_existing_association", - (request.replace_existing_association() ? "1" : "0")), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -91,6 +94,13 @@ DefaultNetworkFirewallPoliciesRestStub::AddAssociation( Options const& options, google::cloud::cpp::compute::network_firewall_policies::v1:: AddAssociationRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"replace_existing_association", + (request.replace_existing_association() ? "1" : "0")}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.firewall_policy_association_resource(), false, @@ -99,10 +109,7 @@ DefaultNetworkFirewallPoliciesRestStub::AddAssociation( "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", "addAssociation"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("replace_existing_association", - (request.replace_existing_association() ? "1" : "0")), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -117,6 +124,14 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncAddRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"max_priority", std::to_string(request.max_priority())}); + query_params.push_back( + {"min_priority", std::to_string(request.min_priority())}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -126,12 +141,7 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncAddRule( "/", "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", "addRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("max_priority", - std::to_string(request.max_priority())), - std::make_pair("min_priority", - std::to_string(request.min_priority())), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -150,6 +160,14 @@ DefaultNetworkFirewallPoliciesRestStub::AddRule( Options const& options, google::cloud::cpp::compute::network_firewall_policies::v1:: AddRuleRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"max_priority", std::to_string(request.max_priority())}); + query_params.push_back( + {"min_priority", std::to_string(request.min_priority())}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.firewall_policy_rule_resource(), false, absl::StrCat("/", "compute", "/", @@ -157,12 +175,7 @@ DefaultNetworkFirewallPoliciesRestStub::AddRule( "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", "addRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("max_priority", - std::to_string(request.max_priority())), - std::make_pair("min_priority", - std::to_string(request.min_priority())), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -177,6 +190,9 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncCloneRules( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -184,7 +200,8 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncCloneRules( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", - request.firewall_policy(), "/", "cloneRules"))); + request.firewall_policy(), "/", "cloneRules"), + std::move(query_params))); }, std::move(p), service_, @@ -203,13 +220,17 @@ DefaultNetworkFirewallPoliciesRestStub::CloneRules( Options const& options, google::cloud::cpp::compute::network_firewall_policies::v1:: CloneRulesRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", - "cloneRules")); + "cloneRules"), + std::move(query_params)); } future> @@ -224,6 +245,10 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncDeleteFirewallPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -232,8 +257,7 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncDeleteFirewallPolicy( "/", "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.firewall_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -252,14 +276,17 @@ DefaultNetworkFirewallPoliciesRestStub::DeleteFirewallPolicy( Options const& options, google::cloud::cpp::compute::network_firewall_policies::v1:: DeleteFirewallPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.firewall_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -268,12 +295,16 @@ DefaultNetworkFirewallPoliciesRestStub::GetFirewallPolicy( Options const& options, google::cloud::cpp::compute::network_firewall_policies::v1:: GetFirewallPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "firewallPolicies", "/", request.firewall_policy())); + "firewallPolicies", "/", request.firewall_policy()), + std::move(query_params)); } StatusOr @@ -282,6 +313,10 @@ DefaultNetworkFirewallPoliciesRestStub::GetAssociation( Options const& options, google::cloud::cpp::compute::network_firewall_policies::v1:: GetAssociationRequest const& request) { + std::vector> query_params; + query_params.push_back({"name", request.name()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::FirewallPolicyAssociation>( *service_, rest_context, request, false, @@ -290,8 +325,7 @@ DefaultNetworkFirewallPoliciesRestStub::GetAssociation( "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", "getAssociation"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("name", request.name())})); + std::move(query_params)); } StatusOr @@ -300,6 +334,12 @@ DefaultNetworkFirewallPoliciesRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::network_firewall_policies::v1:: GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -307,9 +347,7 @@ DefaultNetworkFirewallPoliciesRestStub::GetIamPolicy( "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } StatusOr @@ -318,6 +356,10 @@ DefaultNetworkFirewallPoliciesRestStub::GetRule( Options const& options, google::cloud::cpp::compute::network_firewall_policies::v1:: GetRuleRequest const& request) { + std::vector> query_params; + query_params.push_back({"priority", std::to_string(request.priority())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::FirewallPolicyRule>( *service_, rest_context, request, false, @@ -326,8 +368,7 @@ DefaultNetworkFirewallPoliciesRestStub::GetRule( "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", "getRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("priority", std::to_string(request.priority()))})); + std::move(query_params)); } future> @@ -342,6 +383,10 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncInsertFirewallPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.firewall_policy_resource(), @@ -350,8 +395,7 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncInsertFirewallPolicy( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "firewallPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -370,14 +414,17 @@ DefaultNetworkFirewallPoliciesRestStub::InsertFirewallPolicy( Options const& options, google::cloud::cpp::compute::network_firewall_policies::v1:: InsertFirewallPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.firewall_policy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "firewallPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -386,6 +433,16 @@ DefaultNetworkFirewallPoliciesRestStub::ListNetworkFirewallPolicies( Options const& options, google::cloud::cpp::compute::network_firewall_policies::v1:: ListNetworkFirewallPoliciesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::FirewallPolicyList>( *service_, rest_context, request, false, @@ -393,13 +450,7 @@ DefaultNetworkFirewallPoliciesRestStub::ListNetworkFirewallPolicies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "firewallPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -414,6 +465,10 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncPatchFirewallPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.firewall_policy_resource(), @@ -423,8 +478,7 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncPatchFirewallPolicy( "/", "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.firewall_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -443,14 +497,17 @@ DefaultNetworkFirewallPoliciesRestStub::PatchFirewallPolicy( Options const& options, google::cloud::cpp::compute::network_firewall_policies::v1:: PatchFirewallPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.firewall_policy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.firewall_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -465,6 +522,12 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncPatchRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"priority", std::to_string(request.priority())}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -474,10 +537,7 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncPatchRule( "/", "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", "patchRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("priority", - std::to_string(request.priority())), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -496,6 +556,11 @@ DefaultNetworkFirewallPoliciesRestStub::PatchRule( Options const& options, google::cloud::cpp::compute::network_firewall_policies::v1:: PatchRuleRequest const& request) { + std::vector> query_params; + query_params.push_back({"priority", std::to_string(request.priority())}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.firewall_policy_rule_resource(), false, absl::StrCat("/", "compute", "/", @@ -503,9 +568,7 @@ DefaultNetworkFirewallPoliciesRestStub::PatchRule( "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", "patchRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("priority", std::to_string(request.priority())), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -520,6 +583,9 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncRemoveAssociation( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -528,7 +594,8 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncRemoveAssociation( "/", "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", - "removeAssociation"))); + "removeAssociation"), + std::move(query_params))); }, std::move(p), service_, @@ -547,13 +614,17 @@ DefaultNetworkFirewallPoliciesRestStub::RemoveAssociation( Options const& options, google::cloud::cpp::compute::network_firewall_policies::v1:: RemoveAssociationRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", - "removeAssociation")); + "removeAssociation"), + std::move(query_params)); } future> @@ -568,6 +639,9 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncRemoveRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -575,7 +649,8 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncRemoveRule( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", - request.firewall_policy(), "/", "removeRule"))); + request.firewall_policy(), "/", "removeRule"), + std::move(query_params))); }, std::move(p), service_, @@ -594,13 +669,17 @@ DefaultNetworkFirewallPoliciesRestStub::RemoveRule( Options const& options, google::cloud::cpp::compute::network_firewall_policies::v1:: RemoveRuleRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.firewall_policy(), "/", - "removeRule")); + "removeRule"), + std::move(query_params)); } StatusOr @@ -609,6 +688,9 @@ DefaultNetworkFirewallPoliciesRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::network_firewall_policies::v1:: SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_policy_request_resource(), false, @@ -616,7 +698,8 @@ DefaultNetworkFirewallPoliciesRestStub::SetIamPolicy( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.resource(), "/", - "setIamPolicy")); + "setIamPolicy"), + std::move(query_params)); } StatusOr @@ -625,6 +708,9 @@ DefaultNetworkFirewallPoliciesRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::network_firewall_policies::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -633,7 +719,8 @@ DefaultNetworkFirewallPoliciesRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "firewallPolicies", "/", request.resource(), "/", - "testIamPermissions")); + "testIamPermissions"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/networks/v1/internal/networks_rest_stub.cc b/google/cloud/compute/networks/v1/internal/networks_rest_stub.cc index 1bc9cb4b1cb95..dd386e75ddea0 100644 --- a/google/cloud/compute/networks/v1/internal/networks_rest_stub.cc +++ b/google/cloud/compute/networks/v1/internal/networks_rest_stub.cc @@ -57,6 +57,10 @@ DefaultNetworksRestStub::AsyncAddPeering( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -66,8 +70,7 @@ DefaultNetworksRestStub::AsyncAddPeering( "/", "projects", "/", request.project(), "/", "global", "/", "networks", "/", request.network(), "/", "addPeering"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -86,6 +89,10 @@ DefaultNetworksRestStub::AddPeering( Options const& options, google::cloud::cpp::compute::networks::v1::AddPeeringRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.networks_add_peering_request_resource(), false, @@ -93,8 +100,7 @@ DefaultNetworksRestStub::AddPeering( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "networks", "/", request.network(), "/", "addPeering"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -109,6 +115,10 @@ DefaultNetworksRestStub::AsyncDeleteNetwork( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -116,8 +126,7 @@ DefaultNetworksRestStub::AsyncDeleteNetwork( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "networks", "/", request.network()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -136,14 +145,17 @@ DefaultNetworksRestStub::DeleteNetwork( Options const& options, google::cloud::cpp::compute::networks::v1::DeleteNetworkRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "networks", "/", request.network()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -152,12 +164,16 @@ DefaultNetworksRestStub::GetNetwork( Options const& options, google::cloud::cpp::compute::networks::v1::GetNetworkRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "networks", "/", request.network())); + "networks", "/", request.network()), + std::move(query_params)); } StatusOr @@ -166,6 +182,9 @@ DefaultNetworksRestStub::GetEffectiveFirewalls( Options const& options, google::cloud::cpp::compute::networks::v1:: GetEffectiveFirewallsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NetworksGetEffectiveFirewallsResponse>( *service_, rest_context, request, false, @@ -173,7 +192,8 @@ DefaultNetworksRestStub::GetEffectiveFirewalls( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "networks", "/", request.network(), "/", - "getEffectiveFirewalls")); + "getEffectiveFirewalls"), + std::move(query_params)); } future> @@ -188,6 +208,10 @@ DefaultNetworksRestStub::AsyncInsertNetwork( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.network_resource(), false, @@ -195,8 +219,7 @@ DefaultNetworksRestStub::AsyncInsertNetwork( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "networks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -215,14 +238,17 @@ DefaultNetworksRestStub::InsertNetwork( Options const& options, google::cloud::cpp::compute::networks::v1::InsertNetworkRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.network_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "networks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -231,19 +257,23 @@ DefaultNetworksRestStub::ListNetworks( Options const& options, google::cloud::cpp::compute::networks::v1::ListNetworksRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "networks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -252,6 +282,19 @@ DefaultNetworksRestStub::ListPeeringRoutes( Options const& options, google::cloud::cpp::compute::networks::v1::ListPeeringRoutesRequest const& request) { + std::vector> query_params; + query_params.push_back({"direction", request.direction()}); + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"peering_name", request.peering_name()}); + query_params.push_back({"region", request.region()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::ExchangedPeeringRoutesList>( *service_, rest_context, request, false, @@ -260,16 +303,7 @@ DefaultNetworksRestStub::ListPeeringRoutes( "projects", "/", request.project(), "/", "global", "/", "networks", "/", request.network(), "/", "listPeeringRoutes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("direction", request.direction()), - std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("peering_name", request.peering_name()), - std::make_pair("region", request.region()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -284,6 +318,10 @@ DefaultNetworksRestStub::AsyncPatchNetwork( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.network_resource(), false, @@ -291,8 +329,7 @@ DefaultNetworksRestStub::AsyncPatchNetwork( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "networks", "/", request.network()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -311,14 +348,17 @@ DefaultNetworksRestStub::PatchNetwork( Options const& options, google::cloud::cpp::compute::networks::v1::PatchNetworkRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.network_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "networks", "/", request.network()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -333,6 +373,10 @@ DefaultNetworksRestStub::AsyncRemovePeering( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -342,8 +386,7 @@ DefaultNetworksRestStub::AsyncRemovePeering( "/", "projects", "/", request.project(), "/", "global", "/", "networks", "/", request.network(), "/", "removePeering"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -362,6 +405,10 @@ DefaultNetworksRestStub::RemovePeering( Options const& options, google::cloud::cpp::compute::networks::v1::RemovePeeringRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.networks_remove_peering_request_resource(), false, @@ -369,8 +416,7 @@ DefaultNetworksRestStub::RemovePeering( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "networks", "/", request.network(), "/", "removePeering"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -385,6 +431,9 @@ DefaultNetworksRestStub::AsyncSwitchToCustomMode( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -392,7 +441,8 @@ DefaultNetworksRestStub::AsyncSwitchToCustomMode( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "networks", "/", request.network(), - "/", "switchToCustomMode"))); + "/", "switchToCustomMode"), + std::move(query_params))); }, std::move(p), service_, @@ -411,13 +461,17 @@ DefaultNetworksRestStub::SwitchToCustomMode( Options const& options, google::cloud::cpp::compute::networks::v1::SwitchToCustomModeRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "networks", "/", request.network(), "/", - "switchToCustomMode")); + "switchToCustomMode"), + std::move(query_params)); } future> @@ -432,6 +486,10 @@ DefaultNetworksRestStub::AsyncUpdatePeering( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, @@ -441,8 +499,7 @@ DefaultNetworksRestStub::AsyncUpdatePeering( "/", "projects", "/", request.project(), "/", "global", "/", "networks", "/", request.network(), "/", "updatePeering"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -461,6 +518,10 @@ DefaultNetworksRestStub::UpdatePeering( Options const& options, google::cloud::cpp::compute::networks::v1::UpdatePeeringRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.networks_update_peering_request_resource(), false, @@ -468,8 +529,7 @@ DefaultNetworksRestStub::UpdatePeering( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "networks", "/", request.network(), "/", "updatePeering"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.cc b/google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.cc index 467df6f54a687..764e2259f30fe 100644 --- a/google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.cc +++ b/google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.cc @@ -57,6 +57,10 @@ DefaultNodeGroupsRestStub::AsyncAddNodes( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -66,8 +70,7 @@ DefaultNodeGroupsRestStub::AsyncAddNodes( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups", "/", request.node_group(), "/", "addNodes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -86,6 +89,10 @@ DefaultNodeGroupsRestStub::AddNodes( Options const& options, google::cloud::cpp::compute::node_groups::v1::AddNodesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.node_groups_add_nodes_request_resource(), false, @@ -94,8 +101,7 @@ DefaultNodeGroupsRestStub::AddNodes( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups", "/", request.node_group(), "/", "addNodes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -104,6 +110,20 @@ DefaultNodeGroupsRestStub::AggregatedListNodeGroups( Options const& options, google::cloud::cpp::compute::node_groups::v1:: AggregatedListNodeGroupsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NodeGroupAggregatedList>( *service_, rest_context, request, false, @@ -111,17 +131,7 @@ DefaultNodeGroupsRestStub::AggregatedListNodeGroups( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "nodeGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -136,6 +146,10 @@ DefaultNodeGroupsRestStub::AsyncDeleteNodeGroup( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -144,8 +158,7 @@ DefaultNodeGroupsRestStub::AsyncDeleteNodeGroup( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups", "/", request.node_group()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -164,6 +177,10 @@ DefaultNodeGroupsRestStub::DeleteNodeGroup( Options const& options, google::cloud::cpp::compute::node_groups::v1::DeleteNodeGroupRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -171,8 +188,7 @@ DefaultNodeGroupsRestStub::DeleteNodeGroup( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups", "/", request.node_group()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -187,6 +203,10 @@ DefaultNodeGroupsRestStub::AsyncDeleteNodes( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -196,8 +216,7 @@ DefaultNodeGroupsRestStub::AsyncDeleteNodes( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups", "/", request.node_group(), "/", "deleteNodes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -216,6 +235,10 @@ DefaultNodeGroupsRestStub::DeleteNodes( Options const& options, google::cloud::cpp::compute::node_groups::v1::DeleteNodesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.node_groups_delete_nodes_request_resource(), false, @@ -224,8 +247,7 @@ DefaultNodeGroupsRestStub::DeleteNodes( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups", "/", request.node_group(), "/", "deleteNodes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -234,13 +256,17 @@ DefaultNodeGroupsRestStub::GetNodeGroup( Options const& options, google::cloud::cpp::compute::node_groups::v1::GetNodeGroupRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups", "/", - request.node_group())); + request.node_group()), + std::move(query_params)); } StatusOr @@ -249,6 +275,12 @@ DefaultNodeGroupsRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::node_groups::v1::GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -256,9 +288,7 @@ DefaultNodeGroupsRestStub::GetIamPolicy( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } future> @@ -273,6 +303,12 @@ DefaultNodeGroupsRestStub::AsyncInsertNodeGroup( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"initial_node_count", + std::to_string(request.initial_node_count())}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.node_group_resource(), false, @@ -280,11 +316,7 @@ DefaultNodeGroupsRestStub::AsyncInsertNodeGroup( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair( - "initial_node_count", - std::to_string(request.initial_node_count())), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -303,16 +335,19 @@ DefaultNodeGroupsRestStub::InsertNodeGroup( Options const& options, google::cloud::cpp::compute::node_groups::v1::InsertNodeGroupRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"initial_node_count", std::to_string(request.initial_node_count())}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.node_group_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("initial_node_count", - std::to_string(request.initial_node_count())), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -321,19 +356,23 @@ DefaultNodeGroupsRestStub::ListNodeGroups( Options const& options, google::cloud::cpp::compute::node_groups::v1::ListNodeGroupsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -342,6 +381,9 @@ DefaultNodeGroupsRestStub::ListNodes( Options const& options, google::cloud::cpp::compute::node_groups::v1::ListNodesRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::NodeGroupsListNodes>( *service_, rest_context, request, false, @@ -349,7 +391,8 @@ DefaultNodeGroupsRestStub::ListNodes( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups", "/", request.node_group(), - "/", "listNodes")); + "/", "listNodes"), + std::move(query_params)); } future> @@ -364,6 +407,10 @@ DefaultNodeGroupsRestStub::AsyncPatchNodeGroup( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.node_group_resource(), false, @@ -372,8 +419,7 @@ DefaultNodeGroupsRestStub::AsyncPatchNodeGroup( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups", "/", request.node_group()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -392,6 +438,10 @@ DefaultNodeGroupsRestStub::PatchNodeGroup( Options const& options, google::cloud::cpp::compute::node_groups::v1::PatchNodeGroupRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.node_group_resource(), false, absl::StrCat("/", "compute", "/", @@ -399,8 +449,7 @@ DefaultNodeGroupsRestStub::PatchNodeGroup( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups", "/", request.node_group()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -415,6 +464,10 @@ DefaultNodeGroupsRestStub::AsyncPerformMaintenance( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -426,8 +479,7 @@ DefaultNodeGroupsRestStub::AsyncPerformMaintenance( "zones", "/", request.zone(), "/", "nodeGroups", "/", request.node_group(), "/", "performMaintenance"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -446,6 +498,10 @@ DefaultNodeGroupsRestStub::PerformMaintenance( Options const& options, google::cloud::cpp::compute::node_groups::v1:: PerformMaintenanceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.node_groups_perform_maintenance_request_resource(), false, @@ -454,8 +510,7 @@ DefaultNodeGroupsRestStub::PerformMaintenance( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups", "/", request.node_group(), "/", "performMaintenance"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -464,6 +519,9 @@ DefaultNodeGroupsRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::node_groups::v1::SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.zone_set_policy_request_resource(), false, @@ -471,7 +529,8 @@ DefaultNodeGroupsRestStub::SetIamPolicy( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups", "/", request.resource(), - "/", "setIamPolicy")); + "/", "setIamPolicy"), + std::move(query_params)); } future> @@ -486,6 +545,10 @@ DefaultNodeGroupsRestStub::AsyncSetNodeTemplate( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -495,8 +558,7 @@ DefaultNodeGroupsRestStub::AsyncSetNodeTemplate( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups", "/", request.node_group(), "/", "setNodeTemplate"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -515,6 +577,10 @@ DefaultNodeGroupsRestStub::SetNodeTemplate( Options const& options, google::cloud::cpp::compute::node_groups::v1::SetNodeTemplateRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.node_groups_set_node_template_request_resource(), false, @@ -523,8 +589,7 @@ DefaultNodeGroupsRestStub::SetNodeTemplate( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups", "/", request.node_group(), "/", "setNodeTemplate"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -539,6 +604,10 @@ DefaultNodeGroupsRestStub::AsyncSimulateMaintenanceEvent( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -551,8 +620,7 @@ DefaultNodeGroupsRestStub::AsyncSimulateMaintenanceEvent( "zones", "/", request.zone(), "/", "nodeGroups", "/", request.node_group(), "/", "simulateMaintenanceEvent"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -571,6 +639,10 @@ DefaultNodeGroupsRestStub::SimulateMaintenanceEvent( Options const& options, google::cloud::cpp::compute::node_groups::v1:: SimulateMaintenanceEventRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.node_groups_simulate_maintenance_event_request_resource(), false, @@ -579,8 +651,7 @@ DefaultNodeGroupsRestStub::SimulateMaintenanceEvent( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups", "/", request.node_group(), "/", "simulateMaintenanceEvent"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -589,6 +660,9 @@ DefaultNodeGroupsRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::node_groups::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -597,7 +671,8 @@ DefaultNodeGroupsRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeGroups", "/", request.resource(), - "/", "testIamPermissions")); + "/", "testIamPermissions"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.cc b/google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.cc index 69cf1476c7748..2e433dafb9761 100644 --- a/google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.cc +++ b/google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.cc @@ -51,6 +51,20 @@ DefaultNodeTemplatesRestStub::AggregatedListNodeTemplates( Options const& options, google::cloud::cpp::compute::node_templates::v1:: AggregatedListNodeTemplatesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NodeTemplateAggregatedList>( *service_, rest_context, request, false, @@ -58,17 +72,7 @@ DefaultNodeTemplatesRestStub::AggregatedListNodeTemplates( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "nodeTemplates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -83,6 +87,10 @@ DefaultNodeTemplatesRestStub::AsyncDeleteNodeTemplate( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -91,8 +99,7 @@ DefaultNodeTemplatesRestStub::AsyncDeleteNodeTemplate( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "nodeTemplates", "/", request.node_template()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -111,6 +118,10 @@ DefaultNodeTemplatesRestStub::DeleteNodeTemplate( Options const& options, google::cloud::cpp::compute::node_templates::v1:: DeleteNodeTemplateRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -118,8 +129,7 @@ DefaultNodeTemplatesRestStub::DeleteNodeTemplate( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "nodeTemplates", "/", request.node_template()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -128,13 +138,17 @@ DefaultNodeTemplatesRestStub::GetNodeTemplate( Options const& options, google::cloud::cpp::compute::node_templates::v1:: GetNodeTemplateRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "nodeTemplates", "/", - request.node_template())); + request.node_template()), + std::move(query_params)); } StatusOr @@ -143,6 +157,12 @@ DefaultNodeTemplatesRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::node_templates::v1::GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -150,9 +170,7 @@ DefaultNodeTemplatesRestStub::GetIamPolicy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "nodeTemplates", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } future> @@ -167,6 +185,10 @@ DefaultNodeTemplatesRestStub::AsyncInsertNodeTemplate( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.node_template_resource(), @@ -176,8 +198,7 @@ DefaultNodeTemplatesRestStub::AsyncInsertNodeTemplate( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "nodeTemplates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -196,14 +217,17 @@ DefaultNodeTemplatesRestStub::InsertNodeTemplate( Options const& options, google::cloud::cpp::compute::node_templates::v1:: InsertNodeTemplateRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.node_template_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "nodeTemplates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -212,19 +236,23 @@ DefaultNodeTemplatesRestStub::ListNodeTemplates( Options const& options, google::cloud::cpp::compute::node_templates::v1:: ListNodeTemplatesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "nodeTemplates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -233,6 +261,9 @@ DefaultNodeTemplatesRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::node_templates::v1::SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_policy_request_resource(), false, @@ -240,7 +271,8 @@ DefaultNodeTemplatesRestStub::SetIamPolicy( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "nodeTemplates", "/", - request.resource(), "/", "setIamPolicy")); + request.resource(), "/", "setIamPolicy"), + std::move(query_params)); } StatusOr @@ -249,6 +281,9 @@ DefaultNodeTemplatesRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::node_templates::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -257,7 +292,8 @@ DefaultNodeTemplatesRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "nodeTemplates", "/", - request.resource(), "/", "testIamPermissions")); + request.resource(), "/", "testIamPermissions"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/node_types/v1/internal/node_types_rest_stub.cc b/google/cloud/compute/node_types/v1/internal/node_types_rest_stub.cc index 74b407fc990f1..37eef30330e9b 100644 --- a/google/cloud/compute/node_types/v1/internal/node_types_rest_stub.cc +++ b/google/cloud/compute/node_types/v1/internal/node_types_rest_stub.cc @@ -45,6 +45,20 @@ DefaultNodeTypesRestStub::AggregatedListNodeTypes( Options const& options, google::cloud::cpp::compute::node_types::v1:: AggregatedListNodeTypesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NodeTypeAggregatedList>( *service_, rest_context, request, false, @@ -52,17 +66,7 @@ DefaultNodeTypesRestStub::AggregatedListNodeTypes( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "nodeTypes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } StatusOr @@ -71,12 +75,16 @@ DefaultNodeTypesRestStub::GetNodeType( Options const& options, google::cloud::cpp::compute::node_types::v1::GetNodeTypeRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", - request.zone(), "/", "nodeTypes", "/", request.node_type())); + request.zone(), "/", "nodeTypes", "/", request.node_type()), + std::move(query_params)); } StatusOr @@ -85,19 +93,23 @@ DefaultNodeTypesRestStub::ListNodeTypes( Options const& options, google::cloud::cpp::compute::node_types::v1::ListNodeTypesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "nodeTypes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.cc b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.cc index 7766e6e8229a8..544cb01e0eab5 100644 --- a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.cc +++ b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.cc @@ -52,6 +52,20 @@ DefaultPacketMirroringsRestStub::AggregatedListPacketMirrorings( Options const& options, google::cloud::cpp::compute::packet_mirrorings::v1:: AggregatedListPacketMirroringsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::PacketMirroringAggregatedList>( *service_, rest_context, request, false, @@ -59,17 +73,7 @@ DefaultPacketMirroringsRestStub::AggregatedListPacketMirrorings( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "packetMirrorings"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -84,6 +88,10 @@ DefaultPacketMirroringsRestStub::AsyncDeletePacketMirroring( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -93,8 +101,7 @@ DefaultPacketMirroringsRestStub::AsyncDeletePacketMirroring( "regions", "/", request.region(), "/", "packetMirrorings", "/", request.packet_mirroring()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -113,6 +120,10 @@ DefaultPacketMirroringsRestStub::DeletePacketMirroring( Options const& options, google::cloud::cpp::compute::packet_mirrorings::v1:: DeletePacketMirroringRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -120,8 +131,7 @@ DefaultPacketMirroringsRestStub::DeletePacketMirroring( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "packetMirrorings", "/", request.packet_mirroring()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -130,13 +140,17 @@ DefaultPacketMirroringsRestStub::GetPacketMirroring( Options const& options, google::cloud::cpp::compute::packet_mirrorings::v1:: GetPacketMirroringRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "packetMirrorings", "/", - request.packet_mirroring())); + request.packet_mirroring()), + std::move(query_params)); } future> @@ -151,6 +165,10 @@ DefaultPacketMirroringsRestStub::AsyncInsertPacketMirroring( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.packet_mirroring_resource(), @@ -160,8 +178,7 @@ DefaultPacketMirroringsRestStub::AsyncInsertPacketMirroring( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "packetMirrorings"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -180,14 +197,17 @@ DefaultPacketMirroringsRestStub::InsertPacketMirroring( Options const& options, google::cloud::cpp::compute::packet_mirrorings::v1:: InsertPacketMirroringRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.packet_mirroring_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "packetMirrorings"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -196,6 +216,16 @@ DefaultPacketMirroringsRestStub::ListPacketMirrorings( Options const& options, google::cloud::cpp::compute::packet_mirrorings::v1:: ListPacketMirroringsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::PacketMirroringList>( *service_, rest_context, request, false, @@ -203,13 +233,7 @@ DefaultPacketMirroringsRestStub::ListPacketMirrorings( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "packetMirrorings"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -224,6 +248,10 @@ DefaultPacketMirroringsRestStub::AsyncPatchPacketMirroring( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.packet_mirroring_resource(), @@ -234,8 +262,7 @@ DefaultPacketMirroringsRestStub::AsyncPatchPacketMirroring( "regions", "/", request.region(), "/", "packetMirrorings", "/", request.packet_mirroring()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -254,6 +281,10 @@ DefaultPacketMirroringsRestStub::PatchPacketMirroring( Options const& options, google::cloud::cpp::compute::packet_mirrorings::v1:: PatchPacketMirroringRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.packet_mirroring_resource(), false, absl::StrCat("/", "compute", "/", @@ -261,8 +292,7 @@ DefaultPacketMirroringsRestStub::PatchPacketMirroring( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "packetMirrorings", "/", request.packet_mirroring()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -271,6 +301,9 @@ DefaultPacketMirroringsRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::packet_mirrorings::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -279,7 +312,8 @@ DefaultPacketMirroringsRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "packetMirrorings", "/", - request.resource(), "/", "testIamPermissions")); + request.resource(), "/", "testIamPermissions"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/projects/v1/internal/projects_rest_stub.cc b/google/cloud/compute/projects/v1/internal/projects_rest_stub.cc index 189fde19e4a8e..aaa6a2f3b3f63 100644 --- a/google/cloud/compute/projects/v1/internal/projects_rest_stub.cc +++ b/google/cloud/compute/projects/v1/internal/projects_rest_stub.cc @@ -57,13 +57,17 @@ DefaultProjectsRestStub::AsyncDisableXpnHost( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", - "disableXpnHost"))); + "disableXpnHost"), + std::move(query_params))); }, std::move(p), service_, @@ -82,11 +86,15 @@ DefaultProjectsRestStub::DisableXpnHost( Options const& options, google::cloud::cpp::compute::projects::v1::DisableXpnHostRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", - "projects", "/", request.project(), "/", "disableXpnHost")); + "projects", "/", request.project(), "/", "disableXpnHost"), + std::move(query_params)); } future> @@ -101,6 +109,10 @@ DefaultProjectsRestStub::AsyncDisableXpnResource( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -109,8 +121,7 @@ DefaultProjectsRestStub::AsyncDisableXpnResource( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "disableXpnResource"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -129,6 +140,10 @@ DefaultProjectsRestStub::DisableXpnResource( Options const& options, google::cloud::cpp::compute::projects::v1::DisableXpnResourceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.projects_disable_xpn_resource_request_resource(), false, @@ -136,8 +151,7 @@ DefaultProjectsRestStub::DisableXpnResource( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "disableXpnResource"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -152,13 +166,17 @@ DefaultProjectsRestStub::AsyncEnableXpnHost( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", - "enableXpnHost"))); + "enableXpnHost"), + std::move(query_params))); }, std::move(p), service_, @@ -177,11 +195,15 @@ DefaultProjectsRestStub::EnableXpnHost( Options const& options, google::cloud::cpp::compute::projects::v1::EnableXpnHostRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", - "projects", "/", request.project(), "/", "enableXpnHost")); + "projects", "/", request.project(), "/", "enableXpnHost"), + std::move(query_params)); } future> @@ -196,6 +218,10 @@ DefaultProjectsRestStub::AsyncEnableXpnResource( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -204,8 +230,7 @@ DefaultProjectsRestStub::AsyncEnableXpnResource( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "enableXpnResource"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -224,6 +249,10 @@ DefaultProjectsRestStub::EnableXpnResource( Options const& options, google::cloud::cpp::compute::projects::v1::EnableXpnResourceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.projects_enable_xpn_resource_request_resource(), false, @@ -231,8 +260,7 @@ DefaultProjectsRestStub::EnableXpnResource( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "enableXpnResource"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -241,11 +269,15 @@ DefaultProjectsRestStub::GetProject( Options const& options, google::cloud::cpp::compute::projects::v1::GetProjectRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", - "projects", "/", request.project())); + "projects", "/", request.project()), + std::move(query_params)); } StatusOr @@ -254,11 +286,15 @@ DefaultProjectsRestStub::GetXpnHost( Options const& options, google::cloud::cpp::compute::projects::v1::GetXpnHostRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", - "projects", "/", request.project(), "/", "getXpnHost")); + "projects", "/", request.project(), "/", "getXpnHost"), + std::move(query_params)); } StatusOr @@ -267,19 +303,23 @@ DefaultProjectsRestStub::GetXpnResources( Options const& options, google::cloud::cpp::compute::projects::v1::GetXpnResourcesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::ProjectsGetXpnResources>( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "getXpnResources"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -288,19 +328,23 @@ DefaultProjectsRestStub::ListXpnHosts( Options const& options, google::cloud::cpp::compute::projects::v1::ListXpnHostsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.projects_list_xpn_hosts_request_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "listXpnHosts"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -314,6 +358,10 @@ DefaultProjectsRestStub::AsyncMoveDisk( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.disk_move_request_resource(), @@ -322,8 +370,7 @@ DefaultProjectsRestStub::AsyncMoveDisk( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "moveDisk"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -341,13 +388,16 @@ DefaultProjectsRestStub::MoveDisk( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::projects::v1::MoveDiskRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.disk_move_request_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "moveDisk"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -362,6 +412,10 @@ DefaultProjectsRestStub::AsyncMoveInstance( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -370,8 +424,7 @@ DefaultProjectsRestStub::AsyncMoveInstance( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "moveInstance"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -390,13 +443,16 @@ DefaultProjectsRestStub::MoveInstance( Options const& options, google::cloud::cpp::compute::projects::v1::MoveInstanceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_move_request_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "moveInstance"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -411,6 +467,10 @@ DefaultProjectsRestStub::AsyncSetCloudArmorTier( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -419,8 +479,7 @@ DefaultProjectsRestStub::AsyncSetCloudArmorTier( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "setCloudArmorTier"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -439,6 +498,10 @@ DefaultProjectsRestStub::SetCloudArmorTier( Options const& options, google::cloud::cpp::compute::projects::v1::SetCloudArmorTierRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.projects_set_cloud_armor_tier_request_resource(), false, @@ -446,8 +509,7 @@ DefaultProjectsRestStub::SetCloudArmorTier( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "setCloudArmorTier"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -462,6 +524,10 @@ DefaultProjectsRestStub::AsyncSetCommonInstanceMetadata( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.metadata_resource(), false, @@ -469,8 +535,7 @@ DefaultProjectsRestStub::AsyncSetCommonInstanceMetadata( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "setCommonInstanceMetadata"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -489,14 +554,17 @@ DefaultProjectsRestStub::SetCommonInstanceMetadata( Options const& options, google::cloud::cpp::compute::projects::v1:: SetCommonInstanceMetadataRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.metadata_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "setCommonInstanceMetadata"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -511,6 +579,10 @@ DefaultProjectsRestStub::AsyncSetDefaultNetworkTier( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -520,8 +592,7 @@ DefaultProjectsRestStub::AsyncSetDefaultNetworkTier( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "setDefaultNetworkTier"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -540,6 +611,10 @@ DefaultProjectsRestStub::SetDefaultNetworkTier( Options const& options, google::cloud::cpp::compute::projects::v1:: SetDefaultNetworkTierRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.projects_set_default_network_tier_request_resource(), false, @@ -547,8 +622,7 @@ DefaultProjectsRestStub::SetDefaultNetworkTier( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "setDefaultNetworkTier"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -563,6 +637,10 @@ DefaultProjectsRestStub::AsyncSetUsageExportBucket( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -571,8 +649,7 @@ DefaultProjectsRestStub::AsyncSetUsageExportBucket( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "setUsageExportBucket"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -591,14 +668,17 @@ DefaultProjectsRestStub::SetUsageExportBucket( Options const& options, google::cloud::cpp::compute::projects::v1:: SetUsageExportBucketRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.usage_export_location_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "setUsageExportBucket"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.cc b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.cc index 57d459ab42146..900867d071d9a 100644 --- a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.cc +++ b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.cc @@ -60,6 +60,9 @@ DefaultPublicAdvertisedPrefixesRestStub::AsyncAnnounce( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -68,7 +71,8 @@ DefaultPublicAdvertisedPrefixesRestStub::AsyncAnnounce( "/", "projects", "/", request.project(), "/", "global", "/", "publicAdvertisedPrefixes", "/", request.public_advertised_prefix(), "/", - "announce"))); + "announce"), + std::move(query_params))); }, std::move(p), service_, @@ -87,13 +91,17 @@ DefaultPublicAdvertisedPrefixesRestStub::Announce( Options const& options, google::cloud::cpp::compute::public_advertised_prefixes::v1:: AnnounceRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "publicAdvertisedPrefixes", "/", - request.public_advertised_prefix(), "/", "announce")); + request.public_advertised_prefix(), "/", "announce"), + std::move(query_params)); } future> @@ -108,6 +116,10 @@ DefaultPublicAdvertisedPrefixesRestStub::AsyncDeletePublicAdvertisedPrefix( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -116,8 +128,7 @@ DefaultPublicAdvertisedPrefixesRestStub::AsyncDeletePublicAdvertisedPrefix( "/", "projects", "/", request.project(), "/", "global", "/", "publicAdvertisedPrefixes", "/", request.public_advertised_prefix()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -136,6 +147,10 @@ DefaultPublicAdvertisedPrefixesRestStub::DeletePublicAdvertisedPrefix( Options const& options, google::cloud::cpp::compute::public_advertised_prefixes::v1:: DeletePublicAdvertisedPrefixRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -143,8 +158,7 @@ DefaultPublicAdvertisedPrefixesRestStub::DeletePublicAdvertisedPrefix( "projects", "/", request.project(), "/", "global", "/", "publicAdvertisedPrefixes", "/", request.public_advertised_prefix()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -153,6 +167,9 @@ DefaultPublicAdvertisedPrefixesRestStub::GetPublicAdvertisedPrefix( Options const& options, google::cloud::cpp::compute::public_advertised_prefixes::v1:: GetPublicAdvertisedPrefixRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::PublicAdvertisedPrefix>( *service_, rest_context, request, false, @@ -160,7 +177,8 @@ DefaultPublicAdvertisedPrefixesRestStub::GetPublicAdvertisedPrefix( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "publicAdvertisedPrefixes", "/", - request.public_advertised_prefix())); + request.public_advertised_prefix()), + std::move(query_params)); } future> @@ -175,6 +193,10 @@ DefaultPublicAdvertisedPrefixesRestStub::AsyncInsertPublicAdvertisedPrefix( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -183,8 +205,7 @@ DefaultPublicAdvertisedPrefixesRestStub::AsyncInsertPublicAdvertisedPrefix( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "publicAdvertisedPrefixes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -203,6 +224,10 @@ DefaultPublicAdvertisedPrefixesRestStub::InsertPublicAdvertisedPrefix( Options const& options, google::cloud::cpp::compute::public_advertised_prefixes::v1:: InsertPublicAdvertisedPrefixRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.public_advertised_prefix_resource(), false, @@ -210,8 +235,7 @@ DefaultPublicAdvertisedPrefixesRestStub::InsertPublicAdvertisedPrefix( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "publicAdvertisedPrefixes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -220,6 +244,16 @@ DefaultPublicAdvertisedPrefixesRestStub::ListPublicAdvertisedPrefixes( Options const& options, google::cloud::cpp::compute::public_advertised_prefixes::v1:: ListPublicAdvertisedPrefixesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::PublicAdvertisedPrefixList>( *service_, rest_context, request, false, @@ -227,13 +261,7 @@ DefaultPublicAdvertisedPrefixesRestStub::ListPublicAdvertisedPrefixes( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "publicAdvertisedPrefixes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -248,6 +276,10 @@ DefaultPublicAdvertisedPrefixesRestStub::AsyncPatchPublicAdvertisedPrefix( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, @@ -257,8 +289,7 @@ DefaultPublicAdvertisedPrefixesRestStub::AsyncPatchPublicAdvertisedPrefix( "/", "projects", "/", request.project(), "/", "global", "/", "publicAdvertisedPrefixes", "/", request.public_advertised_prefix()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -277,6 +308,10 @@ DefaultPublicAdvertisedPrefixesRestStub::PatchPublicAdvertisedPrefix( Options const& options, google::cloud::cpp::compute::public_advertised_prefixes::v1:: PatchPublicAdvertisedPrefixRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.public_advertised_prefix_resource(), false, @@ -285,8 +320,7 @@ DefaultPublicAdvertisedPrefixesRestStub::PatchPublicAdvertisedPrefix( "projects", "/", request.project(), "/", "global", "/", "publicAdvertisedPrefixes", "/", request.public_advertised_prefix()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -301,6 +335,9 @@ DefaultPublicAdvertisedPrefixesRestStub::AsyncWithdraw( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -309,7 +346,8 @@ DefaultPublicAdvertisedPrefixesRestStub::AsyncWithdraw( "/", "projects", "/", request.project(), "/", "global", "/", "publicAdvertisedPrefixes", "/", request.public_advertised_prefix(), "/", - "withdraw"))); + "withdraw"), + std::move(query_params))); }, std::move(p), service_, @@ -328,13 +366,17 @@ DefaultPublicAdvertisedPrefixesRestStub::Withdraw( Options const& options, google::cloud::cpp::compute::public_advertised_prefixes::v1:: WithdrawRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "publicAdvertisedPrefixes", "/", - request.public_advertised_prefix(), "/", "withdraw")); + request.public_advertised_prefix(), "/", "withdraw"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.cc b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.cc index 57deffc16e26b..75e18b9ef3fbd 100644 --- a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.cc +++ b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.cc @@ -53,6 +53,20 @@ DefaultPublicDelegatedPrefixesRestStub::AggregatedListPublicDelegatedPrefixes( Options const& options, google::cloud::cpp::compute::public_delegated_prefixes::v1:: AggregatedListPublicDelegatedPrefixesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::PublicDelegatedPrefixAggregatedList>( *service_, rest_context, request, false, @@ -60,17 +74,7 @@ DefaultPublicDelegatedPrefixesRestStub::AggregatedListPublicDelegatedPrefixes( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "publicDelegatedPrefixes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -85,6 +89,9 @@ DefaultPublicDelegatedPrefixesRestStub::AsyncAnnounce( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -93,7 +100,8 @@ DefaultPublicDelegatedPrefixesRestStub::AsyncAnnounce( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "publicDelegatedPrefixes", "/", - request.public_delegated_prefix(), "/", "announce"))); + request.public_delegated_prefix(), "/", "announce"), + std::move(query_params))); }, std::move(p), service_, @@ -112,13 +120,17 @@ DefaultPublicDelegatedPrefixesRestStub::Announce( Options const& options, google::cloud::cpp::compute::public_delegated_prefixes::v1:: AnnounceRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "publicDelegatedPrefixes", "/", - request.public_delegated_prefix(), "/", "announce")); + request.public_delegated_prefix(), "/", "announce"), + std::move(query_params)); } future> @@ -133,6 +145,10 @@ DefaultPublicDelegatedPrefixesRestStub::AsyncDeletePublicDelegatedPrefix( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -142,8 +158,7 @@ DefaultPublicDelegatedPrefixesRestStub::AsyncDeletePublicDelegatedPrefix( "regions", "/", request.region(), "/", "publicDelegatedPrefixes", "/", request.public_delegated_prefix()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -162,6 +177,10 @@ DefaultPublicDelegatedPrefixesRestStub::DeletePublicDelegatedPrefix( Options const& options, google::cloud::cpp::compute::public_delegated_prefixes::v1:: DeletePublicDelegatedPrefixRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -169,8 +188,7 @@ DefaultPublicDelegatedPrefixesRestStub::DeletePublicDelegatedPrefix( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "publicDelegatedPrefixes", "/", request.public_delegated_prefix()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -179,6 +197,9 @@ DefaultPublicDelegatedPrefixesRestStub::GetPublicDelegatedPrefix( Options const& options, google::cloud::cpp::compute::public_delegated_prefixes::v1:: GetPublicDelegatedPrefixRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::PublicDelegatedPrefix>( *service_, rest_context, request, false, @@ -186,7 +207,8 @@ DefaultPublicDelegatedPrefixesRestStub::GetPublicDelegatedPrefix( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "publicDelegatedPrefixes", "/", - request.public_delegated_prefix())); + request.public_delegated_prefix()), + std::move(query_params)); } future> @@ -201,6 +223,10 @@ DefaultPublicDelegatedPrefixesRestStub::AsyncInsertPublicDelegatedPrefix( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -210,8 +236,7 @@ DefaultPublicDelegatedPrefixesRestStub::AsyncInsertPublicDelegatedPrefix( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "publicDelegatedPrefixes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -230,6 +255,10 @@ DefaultPublicDelegatedPrefixesRestStub::InsertPublicDelegatedPrefix( Options const& options, google::cloud::cpp::compute::public_delegated_prefixes::v1:: InsertPublicDelegatedPrefixRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.public_delegated_prefix_resource(), false, @@ -237,8 +266,7 @@ DefaultPublicDelegatedPrefixesRestStub::InsertPublicDelegatedPrefix( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "publicDelegatedPrefixes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -247,6 +275,16 @@ DefaultPublicDelegatedPrefixesRestStub::ListPublicDelegatedPrefixes( Options const& options, google::cloud::cpp::compute::public_delegated_prefixes::v1:: ListPublicDelegatedPrefixesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::PublicDelegatedPrefixList>( *service_, rest_context, request, false, @@ -254,13 +292,7 @@ DefaultPublicDelegatedPrefixesRestStub::ListPublicDelegatedPrefixes( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "publicDelegatedPrefixes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -275,6 +307,10 @@ DefaultPublicDelegatedPrefixesRestStub::AsyncPatchPublicDelegatedPrefix( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, @@ -285,8 +321,7 @@ DefaultPublicDelegatedPrefixesRestStub::AsyncPatchPublicDelegatedPrefix( "regions", "/", request.region(), "/", "publicDelegatedPrefixes", "/", request.public_delegated_prefix()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -305,6 +340,10 @@ DefaultPublicDelegatedPrefixesRestStub::PatchPublicDelegatedPrefix( Options const& options, google::cloud::cpp::compute::public_delegated_prefixes::v1:: PatchPublicDelegatedPrefixRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.public_delegated_prefix_resource(), false, @@ -313,8 +352,7 @@ DefaultPublicDelegatedPrefixesRestStub::PatchPublicDelegatedPrefix( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "publicDelegatedPrefixes", "/", request.public_delegated_prefix()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -329,6 +367,9 @@ DefaultPublicDelegatedPrefixesRestStub::AsyncWithdraw( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -337,7 +378,8 @@ DefaultPublicDelegatedPrefixesRestStub::AsyncWithdraw( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "publicDelegatedPrefixes", "/", - request.public_delegated_prefix(), "/", "withdraw"))); + request.public_delegated_prefix(), "/", "withdraw"), + std::move(query_params))); }, std::move(p), service_, @@ -356,13 +398,17 @@ DefaultPublicDelegatedPrefixesRestStub::Withdraw( Options const& options, google::cloud::cpp::compute::public_delegated_prefixes::v1:: WithdrawRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "publicDelegatedPrefixes", "/", - request.public_delegated_prefix(), "/", "withdraw")); + request.public_delegated_prefix(), "/", "withdraw"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.cc b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.cc index e3519b94a22e4..f193ec21555fc 100644 --- a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.cc +++ b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.cc @@ -58,6 +58,10 @@ DefaultRegionAutoscalersRestStub::AsyncDeleteAutoscaler( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -66,8 +70,7 @@ DefaultRegionAutoscalersRestStub::AsyncDeleteAutoscaler( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "autoscalers", "/", request.autoscaler()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -86,6 +89,10 @@ DefaultRegionAutoscalersRestStub::DeleteAutoscaler( Options const& options, google::cloud::cpp::compute::region_autoscalers::v1:: DeleteAutoscalerRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -93,8 +100,7 @@ DefaultRegionAutoscalersRestStub::DeleteAutoscaler( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "autoscalers", "/", request.autoscaler()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -103,13 +109,17 @@ DefaultRegionAutoscalersRestStub::GetAutoscaler( Options const& options, google::cloud::cpp::compute::region_autoscalers::v1:: GetAutoscalerRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "autoscalers", "/", - request.autoscaler())); + request.autoscaler()), + std::move(query_params)); } future> @@ -124,6 +134,10 @@ DefaultRegionAutoscalersRestStub::AsyncInsertAutoscaler( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.autoscaler_resource(), false, @@ -132,8 +146,7 @@ DefaultRegionAutoscalersRestStub::AsyncInsertAutoscaler( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "autoscalers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -152,14 +165,17 @@ DefaultRegionAutoscalersRestStub::InsertAutoscaler( Options const& options, google::cloud::cpp::compute::region_autoscalers::v1:: InsertAutoscalerRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.autoscaler_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "autoscalers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -168,6 +184,16 @@ DefaultRegionAutoscalersRestStub::ListRegionAutoscalers( Options const& options, google::cloud::cpp::compute::region_autoscalers::v1:: ListRegionAutoscalersRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::RegionAutoscalerList>( *service_, rest_context, request, false, @@ -175,13 +201,7 @@ DefaultRegionAutoscalersRestStub::ListRegionAutoscalers( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "autoscalers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -196,6 +216,11 @@ DefaultRegionAutoscalersRestStub::AsyncPatchAutoscaler( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"autoscaler", request.autoscaler()}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.autoscaler_resource(), false, @@ -204,9 +229,7 @@ DefaultRegionAutoscalersRestStub::AsyncPatchAutoscaler( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "autoscalers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("autoscaler", request.autoscaler()), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -225,15 +248,18 @@ DefaultRegionAutoscalersRestStub::PatchAutoscaler( Options const& options, google::cloud::cpp::compute::region_autoscalers::v1:: PatchAutoscalerRequest const& request) { + std::vector> query_params; + query_params.push_back({"autoscaler", request.autoscaler()}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.autoscaler_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "autoscalers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("autoscaler", request.autoscaler()), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -248,6 +274,11 @@ DefaultRegionAutoscalersRestStub::AsyncUpdateAutoscaler( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"autoscaler", request.autoscaler()}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Put( *service, *rest_context, request.autoscaler_resource(), false, @@ -256,9 +287,7 @@ DefaultRegionAutoscalersRestStub::AsyncUpdateAutoscaler( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "autoscalers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("autoscaler", request.autoscaler()), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -277,15 +306,18 @@ DefaultRegionAutoscalersRestStub::UpdateAutoscaler( Options const& options, google::cloud::cpp::compute::region_autoscalers::v1:: UpdateAutoscalerRequest const& request) { + std::vector> query_params; + query_params.push_back({"autoscaler", request.autoscaler()}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.autoscaler_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "autoscalers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("autoscaler", request.autoscaler()), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.cc b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.cc index 5d244e255a815..4b4f4f8c1cf6f 100644 --- a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.cc +++ b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.cc @@ -59,6 +59,10 @@ DefaultRegionBackendServicesRestStub::AsyncDeleteBackendService( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -67,8 +71,7 @@ DefaultRegionBackendServicesRestStub::AsyncDeleteBackendService( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "backendServices", "/", request.backend_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -87,6 +90,10 @@ DefaultRegionBackendServicesRestStub::DeleteBackendService( Options const& options, google::cloud::cpp::compute::region_backend_services::v1:: DeleteBackendServiceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -94,8 +101,7 @@ DefaultRegionBackendServicesRestStub::DeleteBackendService( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "backendServices", "/", request.backend_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -104,13 +110,17 @@ DefaultRegionBackendServicesRestStub::GetBackendService( Options const& options, google::cloud::cpp::compute::region_backend_services::v1:: GetBackendServiceRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "backendServices", "/", - request.backend_service())); + request.backend_service()), + std::move(query_params)); } StatusOr @@ -119,6 +129,9 @@ DefaultRegionBackendServicesRestStub::GetHealth( Options const& options, google::cloud::cpp::compute::region_backend_services::v1:: GetHealthRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::BackendServiceGroupHealth>( *service_, rest_context, request.resource_group_reference_resource(), @@ -127,7 +140,8 @@ DefaultRegionBackendServicesRestStub::GetHealth( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "backendServices", "/", - request.backend_service(), "/", "getHealth")); + request.backend_service(), "/", "getHealth"), + std::move(query_params)); } StatusOr @@ -136,6 +150,12 @@ DefaultRegionBackendServicesRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::region_backend_services::v1:: GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -143,9 +163,7 @@ DefaultRegionBackendServicesRestStub::GetIamPolicy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "backendServices", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } future> @@ -160,6 +178,10 @@ DefaultRegionBackendServicesRestStub::AsyncInsertBackendService( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.backend_service_resource(), @@ -169,8 +191,7 @@ DefaultRegionBackendServicesRestStub::AsyncInsertBackendService( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "backendServices"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -189,14 +210,17 @@ DefaultRegionBackendServicesRestStub::InsertBackendService( Options const& options, google::cloud::cpp::compute::region_backend_services::v1:: InsertBackendServiceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.backend_service_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "backendServices"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -205,6 +229,16 @@ DefaultRegionBackendServicesRestStub::ListRegionBackendServices( Options const& options, google::cloud::cpp::compute::region_backend_services::v1:: ListRegionBackendServicesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::BackendServiceList>( *service_, rest_context, request, false, @@ -212,13 +246,7 @@ DefaultRegionBackendServicesRestStub::ListRegionBackendServices( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "backendServices"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -227,6 +255,16 @@ DefaultRegionBackendServicesRestStub::ListUsable( Options const& options, google::cloud::cpp::compute::region_backend_services::v1:: ListUsableRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::BackendServiceListUsable>( *service_, rest_context, request, false, @@ -234,13 +272,7 @@ DefaultRegionBackendServicesRestStub::ListUsable( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "backendServices", "/", "listUsable"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -255,6 +287,10 @@ DefaultRegionBackendServicesRestStub::AsyncPatchBackendService( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.backend_service_resource(), @@ -264,8 +300,7 @@ DefaultRegionBackendServicesRestStub::AsyncPatchBackendService( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "backendServices", "/", request.backend_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -284,6 +319,10 @@ DefaultRegionBackendServicesRestStub::PatchBackendService( Options const& options, google::cloud::cpp::compute::region_backend_services::v1:: PatchBackendServiceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.backend_service_resource(), false, absl::StrCat("/", "compute", "/", @@ -291,8 +330,7 @@ DefaultRegionBackendServicesRestStub::PatchBackendService( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "backendServices", "/", request.backend_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -301,6 +339,9 @@ DefaultRegionBackendServicesRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::region_backend_services::v1:: SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_policy_request_resource(), false, @@ -308,7 +349,8 @@ DefaultRegionBackendServicesRestStub::SetIamPolicy( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "backendServices", "/", - request.resource(), "/", "setIamPolicy")); + request.resource(), "/", "setIamPolicy"), + std::move(query_params)); } future> @@ -323,6 +365,10 @@ DefaultRegionBackendServicesRestStub::AsyncSetSecurityPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -333,8 +379,7 @@ DefaultRegionBackendServicesRestStub::AsyncSetSecurityPolicy( "regions", "/", request.region(), "/", "backendServices", "/", request.backend_service(), "/", "setSecurityPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -353,6 +398,10 @@ DefaultRegionBackendServicesRestStub::SetSecurityPolicy( Options const& options, google::cloud::cpp::compute::region_backend_services::v1:: SetSecurityPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.security_policy_reference_resource(), false, @@ -361,8 +410,7 @@ DefaultRegionBackendServicesRestStub::SetSecurityPolicy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "backendServices", "/", request.backend_service(), "/", "setSecurityPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -371,6 +419,9 @@ DefaultRegionBackendServicesRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::region_backend_services::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -379,7 +430,8 @@ DefaultRegionBackendServicesRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "backendServices", "/", - request.resource(), "/", "testIamPermissions")); + request.resource(), "/", "testIamPermissions"), + std::move(query_params)); } future> @@ -394,6 +446,10 @@ DefaultRegionBackendServicesRestStub::AsyncUpdateBackendService( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Put( *service, *rest_context, request.backend_service_resource(), @@ -403,8 +459,7 @@ DefaultRegionBackendServicesRestStub::AsyncUpdateBackendService( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "backendServices", "/", request.backend_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -423,6 +478,10 @@ DefaultRegionBackendServicesRestStub::UpdateBackendService( Options const& options, google::cloud::cpp::compute::region_backend_services::v1:: UpdateBackendServiceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.backend_service_resource(), false, absl::StrCat("/", "compute", "/", @@ -430,8 +489,7 @@ DefaultRegionBackendServicesRestStub::UpdateBackendService( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "backendServices", "/", request.backend_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.cc b/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.cc index 2a9095173a0fe..e21b405b36640 100644 --- a/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.cc +++ b/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.cc @@ -52,6 +52,20 @@ DefaultRegionCommitmentsRestStub::AggregatedListRegionCommitments( Options const& options, google::cloud::cpp::compute::region_commitments::v1:: AggregatedListRegionCommitmentsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::CommitmentAggregatedList>( *service_, rest_context, request, false, @@ -59,17 +73,7 @@ DefaultRegionCommitmentsRestStub::AggregatedListRegionCommitments( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "commitments"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } StatusOr @@ -78,13 +82,17 @@ DefaultRegionCommitmentsRestStub::GetCommitment( Options const& options, google::cloud::cpp::compute::region_commitments::v1:: GetCommitmentRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "commitments", "/", - request.commitment())); + request.commitment()), + std::move(query_params)); } future> @@ -99,6 +107,10 @@ DefaultRegionCommitmentsRestStub::AsyncInsertCommitment( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.commitment_resource(), false, @@ -107,8 +119,7 @@ DefaultRegionCommitmentsRestStub::AsyncInsertCommitment( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "commitments"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -127,14 +138,17 @@ DefaultRegionCommitmentsRestStub::InsertCommitment( Options const& options, google::cloud::cpp::compute::region_commitments::v1:: InsertCommitmentRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.commitment_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "commitments"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -143,19 +157,23 @@ DefaultRegionCommitmentsRestStub::ListRegionCommitments( Options const& options, google::cloud::cpp::compute::region_commitments::v1:: ListRegionCommitmentsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "commitments"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -170,6 +188,12 @@ DefaultRegionCommitmentsRestStub::AsyncUpdateCommitment( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"paths", request.paths()}); + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.commitment_resource(), false, @@ -178,10 +202,7 @@ DefaultRegionCommitmentsRestStub::AsyncUpdateCommitment( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "commitments", "/", request.commitment()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("paths", request.paths()), - std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())}))); + std::move(query_params))); }, std::move(p), service_, @@ -200,6 +221,12 @@ DefaultRegionCommitmentsRestStub::UpdateCommitment( Options const& options, google::cloud::cpp::compute::region_commitments::v1:: UpdateCommitmentRequest const& request) { + std::vector> query_params; + query_params.push_back({"paths", request.paths()}); + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.commitment_resource(), false, absl::StrCat("/", "compute", "/", @@ -207,10 +234,7 @@ DefaultRegionCommitmentsRestStub::UpdateCommitment( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "commitments", "/", request.commitment()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("paths", request.paths()), - std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.cc b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.cc index a8c956c1fd68a..1fbd65c55258e 100644 --- a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.cc +++ b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.cc @@ -45,13 +45,17 @@ DefaultRegionDiskTypesRestStub::GetDiskType( Options const& options, google::cloud::cpp::compute::region_disk_types::v1:: GetDiskTypeRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "diskTypes", "/", - request.disk_type())); + request.disk_type()), + std::move(query_params)); } StatusOr @@ -60,6 +64,16 @@ DefaultRegionDiskTypesRestStub::ListRegionDiskTypes( Options const& options, google::cloud::cpp::compute::region_disk_types::v1:: ListRegionDiskTypesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::RegionDiskTypeList>( *service_, rest_context, request, false, @@ -67,13 +81,7 @@ DefaultRegionDiskTypesRestStub::ListRegionDiskTypes( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "diskTypes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.cc b/google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.cc index 4e0792f9e98c6..9db0f33b376e3 100644 --- a/google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.cc +++ b/google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.cc @@ -57,6 +57,10 @@ DefaultRegionDisksRestStub::AsyncAddResourcePolicies( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -67,8 +71,7 @@ DefaultRegionDisksRestStub::AsyncAddResourcePolicies( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.disk(), "/", "addResourcePolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -87,6 +90,10 @@ DefaultRegionDisksRestStub::AddResourcePolicies( Options const& options, google::cloud::cpp::compute::region_disks::v1:: AddResourcePoliciesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_disks_add_resource_policies_request_resource(), false, @@ -95,8 +102,7 @@ DefaultRegionDisksRestStub::AddResourcePolicies( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.disk(), "/", "addResourcePolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -111,6 +117,10 @@ DefaultRegionDisksRestStub::AsyncBulkInsert( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.bulk_insert_disk_resource(), @@ -120,8 +130,7 @@ DefaultRegionDisksRestStub::AsyncBulkInsert( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", "bulkInsert"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -140,14 +149,17 @@ DefaultRegionDisksRestStub::BulkInsert( Options const& options, google::cloud::cpp::compute::region_disks::v1::BulkInsertRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.bulk_insert_disk_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", "bulkInsert"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -162,6 +174,10 @@ DefaultRegionDisksRestStub::AsyncCreateSnapshot( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.snapshot_resource(), false, @@ -170,8 +186,7 @@ DefaultRegionDisksRestStub::AsyncCreateSnapshot( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.disk(), "/", "createSnapshot"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -190,6 +205,10 @@ DefaultRegionDisksRestStub::CreateSnapshot( Options const& options, google::cloud::cpp::compute::region_disks::v1::CreateSnapshotRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.snapshot_resource(), false, absl::StrCat("/", "compute", "/", @@ -197,8 +216,7 @@ DefaultRegionDisksRestStub::CreateSnapshot( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.disk(), "/", "createSnapshot"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -213,6 +231,10 @@ DefaultRegionDisksRestStub::AsyncDeleteDisk( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -221,8 +243,7 @@ DefaultRegionDisksRestStub::AsyncDeleteDisk( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.disk()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -241,14 +262,17 @@ DefaultRegionDisksRestStub::DeleteDisk( Options const& options, google::cloud::cpp::compute::region_disks::v1::DeleteDiskRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.disk()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -257,12 +281,16 @@ DefaultRegionDisksRestStub::GetDisk( Options const& options, google::cloud::cpp::compute::region_disks::v1::GetDiskRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", - request.region(), "/", "disks", "/", request.disk())); + request.region(), "/", "disks", "/", request.disk()), + std::move(query_params)); } StatusOr @@ -271,6 +299,12 @@ DefaultRegionDisksRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::region_disks::v1::GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -278,9 +312,7 @@ DefaultRegionDisksRestStub::GetIamPolicy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } future> @@ -295,6 +327,11 @@ DefaultRegionDisksRestStub::AsyncInsertDisk( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"source_image", request.source_image()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.disk_resource(), false, @@ -302,9 +339,7 @@ DefaultRegionDisksRestStub::AsyncInsertDisk( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("source_image", request.source_image())}))); + std::move(query_params))); }, std::move(p), service_, @@ -323,15 +358,18 @@ DefaultRegionDisksRestStub::InsertDisk( Options const& options, google::cloud::cpp::compute::region_disks::v1::InsertDiskRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"source_image", request.source_image()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.disk_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("source_image", request.source_image())})); + std::move(query_params)); } StatusOr @@ -340,19 +378,23 @@ DefaultRegionDisksRestStub::ListRegionDisks( Options const& options, google::cloud::cpp::compute::region_disks::v1::ListRegionDisksRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -367,6 +409,10 @@ DefaultRegionDisksRestStub::AsyncRemoveResourcePolicies( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -379,8 +425,7 @@ DefaultRegionDisksRestStub::AsyncRemoveResourcePolicies( "regions", "/", request.region(), "/", "disks", "/", request.disk(), "/", "removeResourcePolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -399,6 +444,10 @@ DefaultRegionDisksRestStub::RemoveResourcePolicies( Options const& options, google::cloud::cpp::compute::region_disks::v1:: RemoveResourcePoliciesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_disks_remove_resource_policies_request_resource(), false, @@ -407,8 +456,7 @@ DefaultRegionDisksRestStub::RemoveResourcePolicies( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.disk(), "/", "removeResourcePolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -423,6 +471,10 @@ DefaultRegionDisksRestStub::AsyncResize( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -432,8 +484,7 @@ DefaultRegionDisksRestStub::AsyncResize( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.disk(), "/", "resize"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -452,6 +503,10 @@ DefaultRegionDisksRestStub::Resize( Options const& options, google::cloud::cpp::compute::region_disks::v1::ResizeRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_disks_resize_request_resource(), false, @@ -460,8 +515,7 @@ DefaultRegionDisksRestStub::Resize( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.disk(), "/", "resize"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -470,6 +524,9 @@ DefaultRegionDisksRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::region_disks::v1::SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_policy_request_resource(), false, @@ -477,7 +534,8 @@ DefaultRegionDisksRestStub::SetIamPolicy( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.resource(), "/", - "setIamPolicy")); + "setIamPolicy"), + std::move(query_params)); } future> @@ -492,6 +550,10 @@ DefaultRegionDisksRestStub::AsyncSetLabels( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -501,8 +563,7 @@ DefaultRegionDisksRestStub::AsyncSetLabels( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.resource(), "/", "setLabels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -521,6 +582,10 @@ DefaultRegionDisksRestStub::SetLabels( Options const& options, google::cloud::cpp::compute::region_disks::v1::SetLabelsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_labels_request_resource(), false, @@ -529,8 +594,7 @@ DefaultRegionDisksRestStub::SetLabels( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.resource(), "/", "setLabels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -545,6 +609,10 @@ DefaultRegionDisksRestStub::AsyncStartAsyncReplication( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -555,8 +623,7 @@ DefaultRegionDisksRestStub::AsyncStartAsyncReplication( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.disk(), "/", "startAsyncReplication"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -575,6 +642,10 @@ DefaultRegionDisksRestStub::StartAsyncReplication( Options const& options, google::cloud::cpp::compute::region_disks::v1:: StartAsyncReplicationRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_disks_start_async_replication_request_resource(), false, @@ -583,8 +654,7 @@ DefaultRegionDisksRestStub::StartAsyncReplication( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.disk(), "/", "startAsyncReplication"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -599,6 +669,9 @@ DefaultRegionDisksRestStub::AsyncStopAsyncReplication( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -606,8 +679,8 @@ DefaultRegionDisksRestStub::AsyncStopAsyncReplication( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", - "/", request.disk(), "/", - "stopAsyncReplication"))); + "/", request.disk(), "/", "stopAsyncReplication"), + std::move(query_params))); }, std::move(p), service_, @@ -626,13 +699,17 @@ DefaultRegionDisksRestStub::StopAsyncReplication( Options const& options, google::cloud::cpp::compute::region_disks::v1:: StopAsyncReplicationRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.disk(), "/", - "stopAsyncReplication")); + "stopAsyncReplication"), + std::move(query_params)); } future> @@ -647,6 +724,10 @@ DefaultRegionDisksRestStub::AsyncStopGroupAsyncReplication( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -656,8 +737,7 @@ DefaultRegionDisksRestStub::AsyncStopGroupAsyncReplication( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", "stopGroupAsyncReplication"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -676,6 +756,10 @@ DefaultRegionDisksRestStub::StopGroupAsyncReplication( Options const& options, google::cloud::cpp::compute::region_disks::v1:: StopGroupAsyncReplicationRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.disks_stop_group_async_replication_resource(), false, @@ -684,8 +768,7 @@ DefaultRegionDisksRestStub::StopGroupAsyncReplication( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", "stopGroupAsyncReplication"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -694,6 +777,9 @@ DefaultRegionDisksRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::region_disks::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -702,7 +788,8 @@ DefaultRegionDisksRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.resource(), "/", - "testIamPermissions")); + "testIamPermissions"), + std::move(query_params)); } future> @@ -717,6 +804,12 @@ DefaultRegionDisksRestStub::AsyncUpdateDisk( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"paths", request.paths()}); + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.disk_resource(), false, @@ -725,10 +818,7 @@ DefaultRegionDisksRestStub::AsyncUpdateDisk( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.disk()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("paths", request.paths()), - std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())}))); + std::move(query_params))); }, std::move(p), service_, @@ -747,16 +837,19 @@ DefaultRegionDisksRestStub::UpdateDisk( Options const& options, google::cloud::cpp::compute::region_disks::v1::UpdateDiskRequest const& request) { + std::vector> query_params; + query_params.push_back({"paths", request.paths()}); + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.disk_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "disks", "/", request.disk()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("paths", request.paths()), - std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.cc b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.cc index 22dcbc2b7bf14..98c83ceb32a51 100644 --- a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.cc +++ b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.cc @@ -60,6 +60,10 @@ DefaultRegionHealthCheckServicesRestStub::AsyncDeleteHealthCheckService( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -69,8 +73,7 @@ DefaultRegionHealthCheckServicesRestStub::AsyncDeleteHealthCheckService( "regions", "/", request.region(), "/", "healthCheckServices", "/", request.health_check_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -89,6 +92,10 @@ DefaultRegionHealthCheckServicesRestStub::DeleteHealthCheckService( Options const& options, google::cloud::cpp::compute::region_health_check_services::v1:: DeleteHealthCheckServiceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -96,8 +103,7 @@ DefaultRegionHealthCheckServicesRestStub::DeleteHealthCheckService( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "healthCheckServices", "/", request.health_check_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -106,6 +112,9 @@ DefaultRegionHealthCheckServicesRestStub::GetHealthCheckService( Options const& options, google::cloud::cpp::compute::region_health_check_services::v1:: GetHealthCheckServiceRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::HealthCheckService>( *service_, rest_context, request, false, @@ -113,7 +122,8 @@ DefaultRegionHealthCheckServicesRestStub::GetHealthCheckService( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "healthCheckServices", "/", - request.health_check_service())); + request.health_check_service()), + std::move(query_params)); } future> @@ -128,6 +138,10 @@ DefaultRegionHealthCheckServicesRestStub::AsyncInsertHealthCheckService( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -137,8 +151,7 @@ DefaultRegionHealthCheckServicesRestStub::AsyncInsertHealthCheckService( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "healthCheckServices"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -157,14 +170,17 @@ DefaultRegionHealthCheckServicesRestStub::InsertHealthCheckService( Options const& options, google::cloud::cpp::compute::region_health_check_services::v1:: InsertHealthCheckServiceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.health_check_service_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "healthCheckServices"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -173,6 +189,16 @@ DefaultRegionHealthCheckServicesRestStub::ListRegionHealthCheckServices( Options const& options, google::cloud::cpp::compute::region_health_check_services::v1:: ListRegionHealthCheckServicesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::HealthCheckServicesList>( *service_, rest_context, request, false, @@ -180,13 +206,7 @@ DefaultRegionHealthCheckServicesRestStub::ListRegionHealthCheckServices( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "healthCheckServices"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -201,6 +221,10 @@ DefaultRegionHealthCheckServicesRestStub::AsyncPatchHealthCheckService( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, @@ -211,8 +235,7 @@ DefaultRegionHealthCheckServicesRestStub::AsyncPatchHealthCheckService( "regions", "/", request.region(), "/", "healthCheckServices", "/", request.health_check_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -231,6 +254,10 @@ DefaultRegionHealthCheckServicesRestStub::PatchHealthCheckService( Options const& options, google::cloud::cpp::compute::region_health_check_services::v1:: PatchHealthCheckServiceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.health_check_service_resource(), false, absl::StrCat("/", "compute", "/", @@ -238,8 +265,7 @@ DefaultRegionHealthCheckServicesRestStub::PatchHealthCheckService( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "healthCheckServices", "/", request.health_check_service()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.cc b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.cc index df9c5a53fb5a5..b5b56f16f88e7 100644 --- a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.cc +++ b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.cc @@ -59,6 +59,10 @@ DefaultRegionHealthChecksRestStub::AsyncDeleteHealthCheck( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -67,8 +71,7 @@ DefaultRegionHealthChecksRestStub::AsyncDeleteHealthCheck( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "healthChecks", "/", request.health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -87,6 +90,10 @@ DefaultRegionHealthChecksRestStub::DeleteHealthCheck( Options const& options, google::cloud::cpp::compute::region_health_checks::v1:: DeleteHealthCheckRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -94,8 +101,7 @@ DefaultRegionHealthChecksRestStub::DeleteHealthCheck( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "healthChecks", "/", request.health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -104,13 +110,17 @@ DefaultRegionHealthChecksRestStub::GetHealthCheck( Options const& options, google::cloud::cpp::compute::region_health_checks::v1:: GetHealthCheckRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "healthChecks", "/", - request.health_check())); + request.health_check()), + std::move(query_params)); } future> @@ -125,6 +135,10 @@ DefaultRegionHealthChecksRestStub::AsyncInsertHealthCheck( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.health_check_resource(), false, @@ -133,8 +147,7 @@ DefaultRegionHealthChecksRestStub::AsyncInsertHealthCheck( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "healthChecks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -153,14 +166,17 @@ DefaultRegionHealthChecksRestStub::InsertHealthCheck( Options const& options, google::cloud::cpp::compute::region_health_checks::v1:: InsertHealthCheckRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.health_check_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "healthChecks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -169,19 +185,23 @@ DefaultRegionHealthChecksRestStub::ListRegionHealthChecks( Options const& options, google::cloud::cpp::compute::region_health_checks::v1:: ListRegionHealthChecksRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "healthChecks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -196,6 +216,10 @@ DefaultRegionHealthChecksRestStub::AsyncPatchHealthCheck( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.health_check_resource(), false, @@ -204,8 +228,7 @@ DefaultRegionHealthChecksRestStub::AsyncPatchHealthCheck( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "healthChecks", "/", request.health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -224,6 +247,10 @@ DefaultRegionHealthChecksRestStub::PatchHealthCheck( Options const& options, google::cloud::cpp::compute::region_health_checks::v1:: PatchHealthCheckRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.health_check_resource(), false, absl::StrCat("/", "compute", "/", @@ -231,8 +258,7 @@ DefaultRegionHealthChecksRestStub::PatchHealthCheck( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "healthChecks", "/", request.health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -247,6 +273,10 @@ DefaultRegionHealthChecksRestStub::AsyncUpdateHealthCheck( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Put( *service, *rest_context, request.health_check_resource(), false, @@ -255,8 +285,7 @@ DefaultRegionHealthChecksRestStub::AsyncUpdateHealthCheck( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "healthChecks", "/", request.health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -275,6 +304,10 @@ DefaultRegionHealthChecksRestStub::UpdateHealthCheck( Options const& options, google::cloud::cpp::compute::region_health_checks::v1:: UpdateHealthCheckRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.health_check_resource(), false, absl::StrCat("/", "compute", "/", @@ -282,8 +315,7 @@ DefaultRegionHealthChecksRestStub::UpdateHealthCheck( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "healthChecks", "/", request.health_check()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.cc b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.cc index 653546d04f578..034b9e17cf9b9 100644 --- a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.cc +++ b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.cc @@ -60,6 +60,10 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncAbandonInstances( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -72,8 +76,7 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncAbandonInstances( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "abandonInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -92,6 +95,10 @@ DefaultRegionInstanceGroupManagersRestStub::AbandonInstances( Options const& options, google::cloud::cpp::compute::region_instance_group_managers::v1:: AbandonInstancesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request @@ -102,8 +109,7 @@ DefaultRegionInstanceGroupManagersRestStub::AbandonInstances( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "abandonInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -118,6 +124,9 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncApplyUpdatesToInstances( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -130,7 +139,8 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncApplyUpdatesToInstances( "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", - "applyUpdatesToInstances"))); + "applyUpdatesToInstances"), + std::move(query_params))); }, std::move(p), service_, @@ -149,6 +159,9 @@ DefaultRegionInstanceGroupManagersRestStub::ApplyUpdatesToInstances( Options const& options, google::cloud::cpp::compute::region_instance_group_managers::v1:: ApplyUpdatesToInstancesRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_instance_group_managers_apply_updates_request_resource(), @@ -158,7 +171,8 @@ DefaultRegionInstanceGroupManagersRestStub::ApplyUpdatesToInstances( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", - "applyUpdatesToInstances")); + "applyUpdatesToInstances"), + std::move(query_params)); } future> @@ -173,6 +187,10 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncCreateInstances( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -185,8 +203,7 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncCreateInstances( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "createInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -205,6 +222,10 @@ DefaultRegionInstanceGroupManagersRestStub::CreateInstances( Options const& options, google::cloud::cpp::compute::region_instance_group_managers::v1:: CreateInstancesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request @@ -215,8 +236,7 @@ DefaultRegionInstanceGroupManagersRestStub::CreateInstances( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "createInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -231,6 +251,10 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncDeleteInstanceGroupManager( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -240,8 +264,7 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncDeleteInstanceGroupManager( "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -260,6 +283,10 @@ DefaultRegionInstanceGroupManagersRestStub::DeleteInstanceGroupManager( Options const& options, google::cloud::cpp::compute::region_instance_group_managers::v1:: DeleteInstanceGroupManagerRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -267,8 +294,7 @@ DefaultRegionInstanceGroupManagersRestStub::DeleteInstanceGroupManager( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -283,6 +309,10 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncDeleteInstances( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -295,8 +325,7 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncDeleteInstances( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "deleteInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -315,6 +344,10 @@ DefaultRegionInstanceGroupManagersRestStub::DeleteInstances( Options const& options, google::cloud::cpp::compute::region_instance_group_managers::v1:: DeleteInstancesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request @@ -325,8 +358,7 @@ DefaultRegionInstanceGroupManagersRestStub::DeleteInstances( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "deleteInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -341,6 +373,9 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncDeletePerInstanceConfigs( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -353,7 +388,8 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncDeletePerInstanceConfigs( "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", - "deletePerInstanceConfigs"))); + "deletePerInstanceConfigs"), + std::move(query_params))); }, std::move(p), service_, @@ -372,6 +408,9 @@ DefaultRegionInstanceGroupManagersRestStub::DeletePerInstanceConfigs( Options const& options, google::cloud::cpp::compute::region_instance_group_managers::v1:: DeletePerInstanceConfigsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request @@ -382,7 +421,8 @@ DefaultRegionInstanceGroupManagersRestStub::DeletePerInstanceConfigs( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", - "deletePerInstanceConfigs")); + "deletePerInstanceConfigs"), + std::move(query_params)); } StatusOr @@ -391,6 +431,9 @@ DefaultRegionInstanceGroupManagersRestStub::GetInstanceGroupManager( Options const& options, google::cloud::cpp::compute::region_instance_group_managers::v1:: GetInstanceGroupManagerRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InstanceGroupManager>( *service_, rest_context, request, false, @@ -398,7 +441,8 @@ DefaultRegionInstanceGroupManagersRestStub::GetInstanceGroupManager( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", - request.instance_group_manager())); + request.instance_group_manager()), + std::move(query_params)); } future> @@ -413,6 +457,10 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncInsertInstanceGroupManager( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -422,8 +470,7 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncInsertInstanceGroupManager( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -442,14 +489,17 @@ DefaultRegionInstanceGroupManagersRestStub::InsertInstanceGroupManager( Options const& options, google::cloud::cpp::compute::region_instance_group_managers::v1:: InsertInstanceGroupManagerRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_group_manager_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -458,6 +508,16 @@ DefaultRegionInstanceGroupManagersRestStub::ListRegionInstanceGroupManagers( Options const& options, google::cloud::cpp::compute::region_instance_group_managers::v1:: ListRegionInstanceGroupManagersRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::RegionInstanceGroupManagerList>( *service_, rest_context, request, false, @@ -465,13 +525,7 @@ DefaultRegionInstanceGroupManagersRestStub::ListRegionInstanceGroupManagers( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, @@ -489,13 +553,7 @@ DefaultRegionInstanceGroupManagersRestStub::ListErrors( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "listErrors"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1:: RegionInstanceGroupManagersListInstancesResponse>( @@ -514,7 +575,8 @@ DefaultRegionInstanceGroupManagersRestStub::ListManagedInstances( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", - "listManagedInstances")); + "listManagedInstances"), + std::move(query_params)); } StatusOr> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1:: RegionInstanceGroupManagersListInstanceConfigsResp>( @@ -533,7 +598,8 @@ DefaultRegionInstanceGroupManagersRestStub::ListPerInstanceConfigs( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", - "listPerInstanceConfigs")); + "listPerInstanceConfigs"), + std::move(query_params)); } future> @@ -548,6 +614,10 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncPatchInstanceGroupManager( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, @@ -558,8 +628,7 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncPatchInstanceGroupManager( "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -578,6 +647,10 @@ DefaultRegionInstanceGroupManagersRestStub::PatchInstanceGroupManager( Options const& options, google::cloud::cpp::compute::region_instance_group_managers::v1:: PatchInstanceGroupManagerRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.instance_group_manager_resource(), false, absl::StrCat("/", "compute", "/", @@ -585,8 +658,7 @@ DefaultRegionInstanceGroupManagersRestStub::PatchInstanceGroupManager( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -601,6 +673,10 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncPatchPerInstanceConfigs( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -614,8 +690,7 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncPatchPerInstanceConfigs( "instanceGroupManagers", "/", request.instance_group_manager(), "/", "patchPerInstanceConfigs"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -634,6 +709,10 @@ DefaultRegionInstanceGroupManagersRestStub::PatchPerInstanceConfigs( Options const& options, google::cloud::cpp::compute::region_instance_group_managers::v1:: PatchPerInstanceConfigsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request @@ -645,8 +724,7 @@ DefaultRegionInstanceGroupManagersRestStub::PatchPerInstanceConfigs( request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "patchPerInstanceConfigs"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -661,6 +739,10 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncRecreateInstances( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -673,8 +755,7 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncRecreateInstances( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "recreateInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -693,6 +774,10 @@ DefaultRegionInstanceGroupManagersRestStub::RecreateInstances( Options const& options, google::cloud::cpp::compute::region_instance_group_managers::v1:: RecreateInstancesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_instance_group_managers_recreate_request_resource(), false, @@ -701,8 +786,7 @@ DefaultRegionInstanceGroupManagersRestStub::RecreateInstances( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "recreateInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -717,6 +801,9 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncResize( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -725,7 +812,8 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncResize( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", - request.instance_group_manager(), "/", "resize"))); + request.instance_group_manager(), "/", "resize"), + std::move(query_params))); }, std::move(p), service_, @@ -744,13 +832,17 @@ DefaultRegionInstanceGroupManagersRestStub::Resize( Options const& options, google::cloud::cpp::compute::region_instance_group_managers::v1:: ResizeRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", - request.instance_group_manager(), "/", "resize")); + request.instance_group_manager(), "/", "resize"), + std::move(query_params)); } future> @@ -765,6 +857,10 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncSetInstanceTemplate( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -777,8 +873,7 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncSetInstanceTemplate( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "setInstanceTemplate"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -797,6 +892,10 @@ DefaultRegionInstanceGroupManagersRestStub::SetInstanceTemplate( Options const& options, google::cloud::cpp::compute::region_instance_group_managers::v1:: SetInstanceTemplateRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_instance_group_managers_set_template_request_resource(), @@ -807,8 +906,7 @@ DefaultRegionInstanceGroupManagersRestStub::SetInstanceTemplate( request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "setInstanceTemplate"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -823,6 +921,10 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncSetTargetPools( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -835,8 +937,7 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncSetTargetPools( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "setTargetPools"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -855,6 +956,10 @@ DefaultRegionInstanceGroupManagersRestStub::SetTargetPools( Options const& options, google::cloud::cpp::compute::region_instance_group_managers::v1:: SetTargetPoolsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request @@ -865,8 +970,7 @@ DefaultRegionInstanceGroupManagersRestStub::SetTargetPools( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "setTargetPools"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -881,6 +985,10 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncUpdatePerInstanceConfigs( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -894,8 +1002,7 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncUpdatePerInstanceConfigs( "instanceGroupManagers", "/", request.instance_group_manager(), "/", "updatePerInstanceConfigs"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -914,6 +1021,10 @@ DefaultRegionInstanceGroupManagersRestStub::UpdatePerInstanceConfigs( Options const& options, google::cloud::cpp::compute::region_instance_group_managers::v1:: UpdatePerInstanceConfigsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request @@ -925,8 +1036,7 @@ DefaultRegionInstanceGroupManagersRestStub::UpdatePerInstanceConfigs( request.region(), "/", "instanceGroupManagers", "/", request.instance_group_manager(), "/", "updatePerInstanceConfigs"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.cc b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.cc index a636511c831f8..cd571439bca8f 100644 --- a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.cc +++ b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.cc @@ -53,13 +53,17 @@ DefaultRegionInstanceGroupsRestStub::GetInstanceGroup( Options const& options, google::cloud::cpp::compute::region_instance_groups::v1:: GetInstanceGroupRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroups", "/", - request.instance_group())); + request.instance_group()), + std::move(query_params)); } StatusOr @@ -68,6 +72,16 @@ DefaultRegionInstanceGroupsRestStub::ListRegionInstanceGroups( Options const& options, google::cloud::cpp::compute::region_instance_groups::v1:: ListRegionInstanceGroupsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::RegionInstanceGroupList>( *service_, rest_context, request, false, @@ -75,13 +89,7 @@ DefaultRegionInstanceGroupsRestStub::ListRegionInstanceGroups( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -90,6 +98,16 @@ DefaultRegionInstanceGroupsRestStub::ListInstances( Options const& options, google::cloud::cpp::compute::region_instance_groups::v1:: ListInstancesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::RegionInstanceGroupsListInstances>( *service_, rest_context, @@ -99,13 +117,7 @@ DefaultRegionInstanceGroupsRestStub::ListInstances( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroups", "/", request.instance_group(), "/", "listInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -120,6 +132,10 @@ DefaultRegionInstanceGroupsRestStub::AsyncSetNamedPorts( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -132,8 +148,7 @@ DefaultRegionInstanceGroupsRestStub::AsyncSetNamedPorts( "regions", "/", request.region(), "/", "instanceGroups", "/", request.instance_group(), "/", "setNamedPorts"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -152,6 +167,10 @@ DefaultRegionInstanceGroupsRestStub::SetNamedPorts( Options const& options, google::cloud::cpp::compute::region_instance_groups::v1:: SetNamedPortsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_instance_groups_set_named_ports_request_resource(), false, @@ -160,8 +179,7 @@ DefaultRegionInstanceGroupsRestStub::SetNamedPorts( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceGroups", "/", request.instance_group(), "/", "setNamedPorts"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.cc b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.cc index ce7beee39aa78..c9d1f408fd638 100644 --- a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.cc +++ b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.cc @@ -59,6 +59,10 @@ DefaultRegionInstanceTemplatesRestStub::AsyncDeleteInstanceTemplate( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -68,8 +72,7 @@ DefaultRegionInstanceTemplatesRestStub::AsyncDeleteInstanceTemplate( "regions", "/", request.region(), "/", "instanceTemplates", "/", request.instance_template()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -88,6 +91,10 @@ DefaultRegionInstanceTemplatesRestStub::DeleteInstanceTemplate( Options const& options, google::cloud::cpp::compute::region_instance_templates::v1:: DeleteInstanceTemplateRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -95,8 +102,7 @@ DefaultRegionInstanceTemplatesRestStub::DeleteInstanceTemplate( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceTemplates", "/", request.instance_template()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -105,13 +111,17 @@ DefaultRegionInstanceTemplatesRestStub::GetInstanceTemplate( Options const& options, google::cloud::cpp::compute::region_instance_templates::v1:: GetInstanceTemplateRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceTemplates", "/", - request.instance_template())); + request.instance_template()), + std::move(query_params)); } future> @@ -126,6 +136,10 @@ DefaultRegionInstanceTemplatesRestStub::AsyncInsertInstanceTemplate( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.instance_template_resource(), @@ -135,8 +149,7 @@ DefaultRegionInstanceTemplatesRestStub::AsyncInsertInstanceTemplate( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceTemplates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -155,14 +168,17 @@ DefaultRegionInstanceTemplatesRestStub::InsertInstanceTemplate( Options const& options, google::cloud::cpp::compute::region_instance_templates::v1:: InsertInstanceTemplateRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_template_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceTemplates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -171,6 +187,16 @@ DefaultRegionInstanceTemplatesRestStub::ListRegionInstanceTemplates( Options const& options, google::cloud::cpp::compute::region_instance_templates::v1:: ListRegionInstanceTemplatesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InstanceTemplateList>( *service_, rest_context, request, false, @@ -178,13 +204,7 @@ DefaultRegionInstanceTemplatesRestStub::ListRegionInstanceTemplates( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instanceTemplates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_instances/v1/internal/region_instances_rest_stub.cc b/google/cloud/compute/region_instances/v1/internal/region_instances_rest_stub.cc index db3b232adf77f..1b1348fff5a94 100644 --- a/google/cloud/compute/region_instances/v1/internal/region_instances_rest_stub.cc +++ b/google/cloud/compute/region_instances/v1/internal/region_instances_rest_stub.cc @@ -57,6 +57,10 @@ DefaultRegionInstancesRestStub::AsyncBulkInsert( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -66,8 +70,7 @@ DefaultRegionInstancesRestStub::AsyncBulkInsert( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instances", "/", "bulkInsert"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -86,14 +89,17 @@ DefaultRegionInstancesRestStub::BulkInsert( Options const& options, google::cloud::cpp::compute::region_instances::v1::BulkInsertRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.bulk_insert_instance_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "instances", "/", "bulkInsert"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.cc b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.cc index 0071eb9febcdd..400a30c23fc79 100644 --- a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.cc +++ b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.cc @@ -60,6 +60,10 @@ DefaultRegionNetworkEndpointGroupsRestStub::AsyncAttachNetworkEndpoints( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -73,8 +77,7 @@ DefaultRegionNetworkEndpointGroupsRestStub::AsyncAttachNetworkEndpoints( "networkEndpointGroups", "/", request.network_endpoint_group(), "/", "attachNetworkEndpoints"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -93,6 +96,10 @@ DefaultRegionNetworkEndpointGroupsRestStub::AttachNetworkEndpoints( Options const& options, google::cloud::cpp::compute::region_network_endpoint_groups::v1:: AttachNetworkEndpointsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request @@ -104,8 +111,7 @@ DefaultRegionNetworkEndpointGroupsRestStub::AttachNetworkEndpoints( request.region(), "/", "networkEndpointGroups", "/", request.network_endpoint_group(), "/", "attachNetworkEndpoints"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -120,6 +126,10 @@ DefaultRegionNetworkEndpointGroupsRestStub::AsyncDeleteNetworkEndpointGroup( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -129,8 +139,7 @@ DefaultRegionNetworkEndpointGroupsRestStub::AsyncDeleteNetworkEndpointGroup( "regions", "/", request.region(), "/", "networkEndpointGroups", "/", request.network_endpoint_group()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -149,6 +158,10 @@ DefaultRegionNetworkEndpointGroupsRestStub::DeleteNetworkEndpointGroup( Options const& options, google::cloud::cpp::compute::region_network_endpoint_groups::v1:: DeleteNetworkEndpointGroupRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -156,8 +169,7 @@ DefaultRegionNetworkEndpointGroupsRestStub::DeleteNetworkEndpointGroup( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkEndpointGroups", "/", request.network_endpoint_group()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -172,6 +184,10 @@ DefaultRegionNetworkEndpointGroupsRestStub::AsyncDetachNetworkEndpoints( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -185,8 +201,7 @@ DefaultRegionNetworkEndpointGroupsRestStub::AsyncDetachNetworkEndpoints( "networkEndpointGroups", "/", request.network_endpoint_group(), "/", "detachNetworkEndpoints"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -205,6 +220,10 @@ DefaultRegionNetworkEndpointGroupsRestStub::DetachNetworkEndpoints( Options const& options, google::cloud::cpp::compute::region_network_endpoint_groups::v1:: DetachNetworkEndpointsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request @@ -216,8 +235,7 @@ DefaultRegionNetworkEndpointGroupsRestStub::DetachNetworkEndpoints( request.region(), "/", "networkEndpointGroups", "/", request.network_endpoint_group(), "/", "detachNetworkEndpoints"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -226,6 +244,9 @@ DefaultRegionNetworkEndpointGroupsRestStub::GetNetworkEndpointGroup( Options const& options, google::cloud::cpp::compute::region_network_endpoint_groups::v1:: GetNetworkEndpointGroupRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NetworkEndpointGroup>( *service_, rest_context, request, false, @@ -233,7 +254,8 @@ DefaultRegionNetworkEndpointGroupsRestStub::GetNetworkEndpointGroup( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkEndpointGroups", "/", - request.network_endpoint_group())); + request.network_endpoint_group()), + std::move(query_params)); } future> @@ -248,6 +270,10 @@ DefaultRegionNetworkEndpointGroupsRestStub::AsyncInsertNetworkEndpointGroup( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -257,8 +283,7 @@ DefaultRegionNetworkEndpointGroupsRestStub::AsyncInsertNetworkEndpointGroup( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkEndpointGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -277,14 +302,17 @@ DefaultRegionNetworkEndpointGroupsRestStub::InsertNetworkEndpointGroup( Options const& options, google::cloud::cpp::compute::region_network_endpoint_groups::v1:: InsertNetworkEndpointGroupRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.network_endpoint_group_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkEndpointGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -293,6 +321,16 @@ DefaultRegionNetworkEndpointGroupsRestStub::ListRegionNetworkEndpointGroups( Options const& options, google::cloud::cpp::compute::region_network_endpoint_groups::v1:: ListRegionNetworkEndpointGroupsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NetworkEndpointGroupList>( *service_, rest_context, request, false, @@ -300,13 +338,7 @@ DefaultRegionNetworkEndpointGroupsRestStub::ListRegionNetworkEndpointGroups( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkEndpointGroups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr< @@ -316,6 +348,9 @@ DefaultRegionNetworkEndpointGroupsRestStub::ListNetworkEndpoints( Options const& options, google::cloud::cpp::compute::region_network_endpoint_groups::v1:: ListNetworkEndpointsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, @@ -324,7 +359,8 @@ DefaultRegionNetworkEndpointGroupsRestStub::ListNetworkEndpoints( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "networkEndpointGroups", "/", request.network_endpoint_group(), "/", - "listNetworkEndpoints")); + "listNetworkEndpoints"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.cc b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.cc index b703468f3fc65..024c9222504cf 100644 --- a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.cc +++ b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.cc @@ -60,6 +60,13 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncAddAssociation( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"replace_existing_association", + (request.replace_existing_association() ? "1" : "0")}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -70,11 +77,7 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncAddAssociation( "regions", "/", request.region(), "/", "firewallPolicies", "/", request.firewall_policy(), "/", "addAssociation"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair( - "replace_existing_association", - (request.replace_existing_association() ? "1" : "0")), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -93,6 +96,13 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AddAssociation( Options const& options, google::cloud::cpp::compute::region_network_firewall_policies::v1:: AddAssociationRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"replace_existing_association", + (request.replace_existing_association() ? "1" : "0")}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.firewall_policy_association_resource(), false, @@ -101,10 +111,7 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AddAssociation( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies", "/", request.firewall_policy(), "/", "addAssociation"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("replace_existing_association", - (request.replace_existing_association() ? "1" : "0")), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -119,6 +126,14 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncAddRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"max_priority", std::to_string(request.max_priority())}); + query_params.push_back( + {"min_priority", std::to_string(request.min_priority())}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -129,12 +144,7 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncAddRule( "regions", "/", request.region(), "/", "firewallPolicies", "/", request.firewall_policy(), "/", "addRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("max_priority", - std::to_string(request.max_priority())), - std::make_pair("min_priority", - std::to_string(request.min_priority())), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -153,6 +163,14 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AddRule( Options const& options, google::cloud::cpp::compute::region_network_firewall_policies::v1:: AddRuleRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"max_priority", std::to_string(request.max_priority())}); + query_params.push_back( + {"min_priority", std::to_string(request.min_priority())}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.firewall_policy_rule_resource(), false, absl::StrCat("/", "compute", "/", @@ -160,12 +178,7 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AddRule( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies", "/", request.firewall_policy(), "/", "addRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("max_priority", - std::to_string(request.max_priority())), - std::make_pair("min_priority", - std::to_string(request.min_priority())), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -180,6 +193,9 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncCloneRules( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -188,7 +204,8 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncCloneRules( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies", "/", request.firewall_policy(), - "/", "cloneRules"))); + "/", "cloneRules"), + std::move(query_params))); }, std::move(p), service_, @@ -207,13 +224,17 @@ DefaultRegionNetworkFirewallPoliciesRestStub::CloneRules( Options const& options, google::cloud::cpp::compute::region_network_firewall_policies::v1:: CloneRulesRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies", "/", - request.firewall_policy(), "/", "cloneRules")); + request.firewall_policy(), "/", "cloneRules"), + std::move(query_params)); } future> @@ -228,6 +249,10 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncDeleteFirewallPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -237,8 +262,7 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncDeleteFirewallPolicy( "regions", "/", request.region(), "/", "firewallPolicies", "/", request.firewall_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -257,6 +281,10 @@ DefaultRegionNetworkFirewallPoliciesRestStub::DeleteFirewallPolicy( Options const& options, google::cloud::cpp::compute::region_network_firewall_policies::v1:: DeleteFirewallPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -264,8 +292,7 @@ DefaultRegionNetworkFirewallPoliciesRestStub::DeleteFirewallPolicy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies", "/", request.firewall_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -274,13 +301,17 @@ DefaultRegionNetworkFirewallPoliciesRestStub::GetFirewallPolicy( Options const& options, google::cloud::cpp::compute::region_network_firewall_policies::v1:: GetFirewallPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies", "/", - request.firewall_policy())); + request.firewall_policy()), + std::move(query_params)); } StatusOr @@ -289,6 +320,10 @@ DefaultRegionNetworkFirewallPoliciesRestStub::GetAssociation( Options const& options, google::cloud::cpp::compute::region_network_firewall_policies::v1:: GetAssociationRequest const& request) { + std::vector> query_params; + query_params.push_back({"name", request.name()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::FirewallPolicyAssociation>( *service_, rest_context, request, false, @@ -297,8 +332,7 @@ DefaultRegionNetworkFirewallPoliciesRestStub::GetAssociation( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies", "/", request.firewall_policy(), "/", "getAssociation"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("name", request.name())})); + std::move(query_params)); } StatusOr> query_params; + query_params.push_back({"network", request.network()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1:: RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse>( @@ -317,8 +355,7 @@ DefaultRegionNetworkFirewallPoliciesRestStub::GetEffectiveFirewalls( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies", "/", "getEffectiveFirewalls"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("network", request.network())})); + std::move(query_params)); } StatusOr @@ -327,6 +364,12 @@ DefaultRegionNetworkFirewallPoliciesRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::region_network_firewall_policies::v1:: GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -334,9 +377,7 @@ DefaultRegionNetworkFirewallPoliciesRestStub::GetIamPolicy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } StatusOr @@ -345,6 +386,10 @@ DefaultRegionNetworkFirewallPoliciesRestStub::GetRule( Options const& options, google::cloud::cpp::compute::region_network_firewall_policies::v1:: GetRuleRequest const& request) { + std::vector> query_params; + query_params.push_back({"priority", std::to_string(request.priority())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::FirewallPolicyRule>( *service_, rest_context, request, false, @@ -353,8 +398,7 @@ DefaultRegionNetworkFirewallPoliciesRestStub::GetRule( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies", "/", request.firewall_policy(), "/", "getRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("priority", std::to_string(request.priority()))})); + std::move(query_params)); } future> @@ -369,6 +413,10 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncInsertFirewallPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.firewall_policy_resource(), @@ -378,8 +426,7 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncInsertFirewallPolicy( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -398,14 +445,17 @@ DefaultRegionNetworkFirewallPoliciesRestStub::InsertFirewallPolicy( Options const& options, google::cloud::cpp::compute::region_network_firewall_policies::v1:: InsertFirewallPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.firewall_policy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -414,6 +464,16 @@ DefaultRegionNetworkFirewallPoliciesRestStub::ListRegionNetworkFirewallPolicies( Options const& options, google::cloud::cpp::compute::region_network_firewall_policies::v1:: ListRegionNetworkFirewallPoliciesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::FirewallPolicyList>( *service_, rest_context, request, false, @@ -421,13 +481,7 @@ DefaultRegionNetworkFirewallPoliciesRestStub::ListRegionNetworkFirewallPolicies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -442,6 +496,10 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncPatchFirewallPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.firewall_policy_resource(), @@ -452,8 +510,7 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncPatchFirewallPolicy( "regions", "/", request.region(), "/", "firewallPolicies", "/", request.firewall_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -472,6 +529,10 @@ DefaultRegionNetworkFirewallPoliciesRestStub::PatchFirewallPolicy( Options const& options, google::cloud::cpp::compute::region_network_firewall_policies::v1:: PatchFirewallPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.firewall_policy_resource(), false, absl::StrCat("/", "compute", "/", @@ -479,8 +540,7 @@ DefaultRegionNetworkFirewallPoliciesRestStub::PatchFirewallPolicy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies", "/", request.firewall_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -495,6 +555,12 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncPatchRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"priority", std::to_string(request.priority())}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -505,10 +571,7 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncPatchRule( "regions", "/", request.region(), "/", "firewallPolicies", "/", request.firewall_policy(), "/", "patchRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("priority", - std::to_string(request.priority())), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -527,6 +590,11 @@ DefaultRegionNetworkFirewallPoliciesRestStub::PatchRule( Options const& options, google::cloud::cpp::compute::region_network_firewall_policies::v1:: PatchRuleRequest const& request) { + std::vector> query_params; + query_params.push_back({"priority", std::to_string(request.priority())}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.firewall_policy_rule_resource(), false, absl::StrCat("/", "compute", "/", @@ -534,9 +602,7 @@ DefaultRegionNetworkFirewallPoliciesRestStub::PatchRule( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies", "/", request.firewall_policy(), "/", "patchRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("priority", std::to_string(request.priority())), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -551,6 +617,9 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncRemoveAssociation( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -559,7 +628,8 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncRemoveAssociation( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies", "/", request.firewall_policy(), - "/", "removeAssociation"))); + "/", "removeAssociation"), + std::move(query_params))); }, std::move(p), service_, @@ -578,13 +648,17 @@ DefaultRegionNetworkFirewallPoliciesRestStub::RemoveAssociation( Options const& options, google::cloud::cpp::compute::region_network_firewall_policies::v1:: RemoveAssociationRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies", "/", - request.firewall_policy(), "/", "removeAssociation")); + request.firewall_policy(), "/", "removeAssociation"), + std::move(query_params)); } future> @@ -599,6 +673,9 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncRemoveRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -607,7 +684,8 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncRemoveRule( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies", "/", request.firewall_policy(), - "/", "removeRule"))); + "/", "removeRule"), + std::move(query_params))); }, std::move(p), service_, @@ -626,13 +704,17 @@ DefaultRegionNetworkFirewallPoliciesRestStub::RemoveRule( Options const& options, google::cloud::cpp::compute::region_network_firewall_policies::v1:: RemoveRuleRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies", "/", - request.firewall_policy(), "/", "removeRule")); + request.firewall_policy(), "/", "removeRule"), + std::move(query_params)); } StatusOr @@ -641,6 +723,9 @@ DefaultRegionNetworkFirewallPoliciesRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::region_network_firewall_policies::v1:: SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_policy_request_resource(), false, @@ -648,7 +733,8 @@ DefaultRegionNetworkFirewallPoliciesRestStub::SetIamPolicy( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies", "/", - request.resource(), "/", "setIamPolicy")); + request.resource(), "/", "setIamPolicy"), + std::move(query_params)); } StatusOr @@ -657,6 +743,9 @@ DefaultRegionNetworkFirewallPoliciesRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::region_network_firewall_policies::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -665,7 +754,8 @@ DefaultRegionNetworkFirewallPoliciesRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "firewallPolicies", "/", - request.resource(), "/", "testIamPermissions")); + request.resource(), "/", "testIamPermissions"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.cc b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.cc index e249f853a67e6..2f1502b23439c 100644 --- a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.cc +++ b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.cc @@ -60,6 +60,10 @@ DefaultRegionNotificationEndpointsRestStub::AsyncDeleteNotificationEndpoint( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -69,8 +73,7 @@ DefaultRegionNotificationEndpointsRestStub::AsyncDeleteNotificationEndpoint( "regions", "/", request.region(), "/", "notificationEndpoints", "/", request.notification_endpoint()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -89,6 +92,10 @@ DefaultRegionNotificationEndpointsRestStub::DeleteNotificationEndpoint( Options const& options, google::cloud::cpp::compute::region_notification_endpoints::v1:: DeleteNotificationEndpointRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -96,8 +103,7 @@ DefaultRegionNotificationEndpointsRestStub::DeleteNotificationEndpoint( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "notificationEndpoints", "/", request.notification_endpoint()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -106,6 +112,9 @@ DefaultRegionNotificationEndpointsRestStub::GetNotificationEndpoint( Options const& options, google::cloud::cpp::compute::region_notification_endpoints::v1:: GetNotificationEndpointRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NotificationEndpoint>( *service_, rest_context, request, false, @@ -113,7 +122,8 @@ DefaultRegionNotificationEndpointsRestStub::GetNotificationEndpoint( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "notificationEndpoints", "/", - request.notification_endpoint())); + request.notification_endpoint()), + std::move(query_params)); } future> @@ -128,6 +138,10 @@ DefaultRegionNotificationEndpointsRestStub::AsyncInsertNotificationEndpoint( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -137,8 +151,7 @@ DefaultRegionNotificationEndpointsRestStub::AsyncInsertNotificationEndpoint( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "notificationEndpoints"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -157,14 +170,17 @@ DefaultRegionNotificationEndpointsRestStub::InsertNotificationEndpoint( Options const& options, google::cloud::cpp::compute::region_notification_endpoints::v1:: InsertNotificationEndpointRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.notification_endpoint_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "notificationEndpoints"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -173,6 +189,16 @@ DefaultRegionNotificationEndpointsRestStub::ListRegionNotificationEndpoints( Options const& options, google::cloud::cpp::compute::region_notification_endpoints::v1:: ListRegionNotificationEndpointsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NotificationEndpointList>( *service_, rest_context, request, false, @@ -180,13 +206,7 @@ DefaultRegionNotificationEndpointsRestStub::ListRegionNotificationEndpoints( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "notificationEndpoints"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_operations/v1/internal/region_operations_rest_stub.cc b/google/cloud/compute/region_operations/v1/internal/region_operations_rest_stub.cc index cbc655f3e3a40..8ed4d82d1f56d 100644 --- a/google/cloud/compute/region_operations/v1/internal/region_operations_rest_stub.cc +++ b/google/cloud/compute/region_operations/v1/internal/region_operations_rest_stub.cc @@ -45,13 +45,17 @@ Status DefaultRegionOperationsRestStub::DeleteOperation( Options const& options, google::cloud::cpp::compute::region_operations::v1:: DeleteOperationRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "operations", "/", - request.operation())); + request.operation()), + std::move(query_params)); } StatusOr @@ -60,13 +64,17 @@ DefaultRegionOperationsRestStub::GetOperation( Options const& options, google::cloud::cpp::compute::region_operations::v1:: GetOperationRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "operations", "/", - request.operation())); + request.operation()), + std::move(query_params)); } StatusOr @@ -75,19 +83,23 @@ DefaultRegionOperationsRestStub::ListRegionOperations( Options const& options, google::cloud::cpp::compute::region_operations::v1:: ListRegionOperationsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "operations"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -96,13 +108,17 @@ DefaultRegionOperationsRestStub::Wait( Options const& options, google::cloud::cpp::compute::region_operations::v1::WaitRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "operations", "/", - request.operation(), "/", "wait")); + request.operation(), "/", "wait"), + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.cc b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.cc index 25c8df397cbe9..1fb324623d87c 100644 --- a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.cc +++ b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.cc @@ -59,6 +59,11 @@ DefaultRegionSecurityPoliciesRestStub::AsyncAddRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"validate_only", (request.validate_only() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -69,8 +74,7 @@ DefaultRegionSecurityPoliciesRestStub::AsyncAddRule( "regions", "/", request.region(), "/", "securityPolicies", "/", request.security_policy(), "/", "addRule"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "validate_only", (request.validate_only() ? "1" : "0"))}))); + std::move(query_params))); }, std::move(p), service_, @@ -89,6 +93,11 @@ DefaultRegionSecurityPoliciesRestStub::AddRule( Options const& options, google::cloud::cpp::compute::region_security_policies::v1:: AddRuleRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"validate_only", (request.validate_only() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.security_policy_rule_resource(), false, absl::StrCat("/", "compute", "/", @@ -96,8 +105,7 @@ DefaultRegionSecurityPoliciesRestStub::AddRule( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "securityPolicies", "/", request.security_policy(), "/", "addRule"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "validate_only", (request.validate_only() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -112,6 +120,10 @@ DefaultRegionSecurityPoliciesRestStub::AsyncDeleteSecurityPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -121,8 +133,7 @@ DefaultRegionSecurityPoliciesRestStub::AsyncDeleteSecurityPolicy( "regions", "/", request.region(), "/", "securityPolicies", "/", request.security_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -141,6 +152,10 @@ DefaultRegionSecurityPoliciesRestStub::DeleteSecurityPolicy( Options const& options, google::cloud::cpp::compute::region_security_policies::v1:: DeleteSecurityPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -148,8 +163,7 @@ DefaultRegionSecurityPoliciesRestStub::DeleteSecurityPolicy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "securityPolicies", "/", request.security_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -158,13 +172,17 @@ DefaultRegionSecurityPoliciesRestStub::GetSecurityPolicy( Options const& options, google::cloud::cpp::compute::region_security_policies::v1:: GetSecurityPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "securityPolicies", "/", - request.security_policy())); + request.security_policy()), + std::move(query_params)); } StatusOr @@ -173,6 +191,10 @@ DefaultRegionSecurityPoliciesRestStub::GetRule( Options const& options, google::cloud::cpp::compute::region_security_policies::v1:: GetRuleRequest const& request) { + std::vector> query_params; + query_params.push_back({"priority", std::to_string(request.priority())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::SecurityPolicyRule>( *service_, rest_context, request, false, @@ -181,8 +203,7 @@ DefaultRegionSecurityPoliciesRestStub::GetRule( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "securityPolicies", "/", request.security_policy(), "/", "getRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("priority", std::to_string(request.priority()))})); + std::move(query_params)); } future> @@ -197,6 +218,12 @@ DefaultRegionSecurityPoliciesRestStub::AsyncInsertSecurityPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back( + {"validate_only", (request.validate_only() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.security_policy_resource(), @@ -206,10 +233,7 @@ DefaultRegionSecurityPoliciesRestStub::AsyncInsertSecurityPolicy( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "securityPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("validate_only", - (request.validate_only() ? "1" : "0"))}))); + std::move(query_params))); }, std::move(p), service_, @@ -228,16 +252,19 @@ DefaultRegionSecurityPoliciesRestStub::InsertSecurityPolicy( Options const& options, google::cloud::cpp::compute::region_security_policies::v1:: InsertSecurityPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back( + {"validate_only", (request.validate_only() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.security_policy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "securityPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("validate_only", - (request.validate_only() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -246,6 +273,16 @@ DefaultRegionSecurityPoliciesRestStub::ListRegionSecurityPolicies( Options const& options, google::cloud::cpp::compute::region_security_policies::v1:: ListRegionSecurityPoliciesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::SecurityPolicyList>( *service_, rest_context, request, false, @@ -253,13 +290,7 @@ DefaultRegionSecurityPoliciesRestStub::ListRegionSecurityPolicies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "securityPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -274,6 +305,11 @@ DefaultRegionSecurityPoliciesRestStub::AsyncPatchSecurityPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.security_policy_resource(), @@ -284,9 +320,7 @@ DefaultRegionSecurityPoliciesRestStub::AsyncPatchSecurityPolicy( "regions", "/", request.region(), "/", "securityPolicies", "/", request.security_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())}))); + std::move(query_params))); }, std::move(p), service_, @@ -305,6 +339,11 @@ DefaultRegionSecurityPoliciesRestStub::PatchSecurityPolicy( Options const& options, google::cloud::cpp::compute::region_security_policies::v1:: PatchSecurityPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.security_policy_resource(), false, absl::StrCat("/", "compute", "/", @@ -312,9 +351,7 @@ DefaultRegionSecurityPoliciesRestStub::PatchSecurityPolicy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "securityPolicies", "/", request.security_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())})); + std::move(query_params)); } future> @@ -329,6 +366,14 @@ DefaultRegionSecurityPoliciesRestStub::AsyncPatchRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"priority", std::to_string(request.priority())}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params.push_back( + {"validate_only", (request.validate_only() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -339,12 +384,7 @@ DefaultRegionSecurityPoliciesRestStub::AsyncPatchRule( "regions", "/", request.region(), "/", "securityPolicies", "/", request.security_policy(), "/", "patchRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("priority", - std::to_string(request.priority())), - std::make_pair("update_mask", request.update_mask()), - std::make_pair("validate_only", - (request.validate_only() ? "1" : "0"))}))); + std::move(query_params))); }, std::move(p), service_, @@ -363,6 +403,13 @@ DefaultRegionSecurityPoliciesRestStub::PatchRule( Options const& options, google::cloud::cpp::compute::region_security_policies::v1:: PatchRuleRequest const& request) { + std::vector> query_params; + query_params.push_back({"priority", std::to_string(request.priority())}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params.push_back( + {"validate_only", (request.validate_only() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.security_policy_rule_resource(), false, absl::StrCat("/", "compute", "/", @@ -370,11 +417,7 @@ DefaultRegionSecurityPoliciesRestStub::PatchRule( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "securityPolicies", "/", request.security_policy(), "/", "patchRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("priority", std::to_string(request.priority())), - std::make_pair("update_mask", request.update_mask()), - std::make_pair("validate_only", - (request.validate_only() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -389,6 +432,9 @@ DefaultRegionSecurityPoliciesRestStub::AsyncRemoveRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -397,7 +443,8 @@ DefaultRegionSecurityPoliciesRestStub::AsyncRemoveRule( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "securityPolicies", "/", request.security_policy(), - "/", "removeRule"))); + "/", "removeRule"), + std::move(query_params))); }, std::move(p), service_, @@ -416,13 +463,17 @@ DefaultRegionSecurityPoliciesRestStub::RemoveRule( Options const& options, google::cloud::cpp::compute::region_security_policies::v1:: RemoveRuleRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "securityPolicies", "/", - request.security_policy(), "/", "removeRule")); + request.security_policy(), "/", "removeRule"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.cc b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.cc index 15adab06e7a46..1428c8695133a 100644 --- a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.cc +++ b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.cc @@ -59,6 +59,10 @@ DefaultRegionSslCertificatesRestStub::AsyncDeleteSslCertificate( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -67,8 +71,7 @@ DefaultRegionSslCertificatesRestStub::AsyncDeleteSslCertificate( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "sslCertificates", "/", request.ssl_certificate()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -87,6 +90,10 @@ DefaultRegionSslCertificatesRestStub::DeleteSslCertificate( Options const& options, google::cloud::cpp::compute::region_ssl_certificates::v1:: DeleteSslCertificateRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -94,8 +101,7 @@ DefaultRegionSslCertificatesRestStub::DeleteSslCertificate( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "sslCertificates", "/", request.ssl_certificate()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -104,13 +110,17 @@ DefaultRegionSslCertificatesRestStub::GetSslCertificate( Options const& options, google::cloud::cpp::compute::region_ssl_certificates::v1:: GetSslCertificateRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "sslCertificates", "/", - request.ssl_certificate())); + request.ssl_certificate()), + std::move(query_params)); } future> @@ -125,6 +135,10 @@ DefaultRegionSslCertificatesRestStub::AsyncInsertSslCertificate( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.ssl_certificate_resource(), @@ -134,8 +148,7 @@ DefaultRegionSslCertificatesRestStub::AsyncInsertSslCertificate( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "sslCertificates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -154,14 +167,17 @@ DefaultRegionSslCertificatesRestStub::InsertSslCertificate( Options const& options, google::cloud::cpp::compute::region_ssl_certificates::v1:: InsertSslCertificateRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.ssl_certificate_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "sslCertificates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -170,6 +186,16 @@ DefaultRegionSslCertificatesRestStub::ListRegionSslCertificates( Options const& options, google::cloud::cpp::compute::region_ssl_certificates::v1:: ListRegionSslCertificatesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::SslCertificateList>( *service_, rest_context, request, false, @@ -177,13 +203,7 @@ DefaultRegionSslCertificatesRestStub::ListRegionSslCertificates( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "sslCertificates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.cc b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.cc index 771eeffa33410..bd38782de573e 100644 --- a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.cc +++ b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.cc @@ -58,6 +58,10 @@ DefaultRegionSslPoliciesRestStub::AsyncDeleteSslPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -66,8 +70,7 @@ DefaultRegionSslPoliciesRestStub::AsyncDeleteSslPolicy( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "sslPolicies", "/", request.ssl_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -86,6 +89,10 @@ DefaultRegionSslPoliciesRestStub::DeleteSslPolicy( Options const& options, google::cloud::cpp::compute::region_ssl_policies::v1:: DeleteSslPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -93,8 +100,7 @@ DefaultRegionSslPoliciesRestStub::DeleteSslPolicy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "sslPolicies", "/", request.ssl_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -103,13 +109,17 @@ DefaultRegionSslPoliciesRestStub::GetSslPolicy( Options const& options, google::cloud::cpp::compute::region_ssl_policies::v1:: GetSslPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "sslPolicies", "/", - request.ssl_policy())); + request.ssl_policy()), + std::move(query_params)); } future> @@ -124,6 +134,10 @@ DefaultRegionSslPoliciesRestStub::AsyncInsertSslPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.ssl_policy_resource(), false, @@ -132,8 +146,7 @@ DefaultRegionSslPoliciesRestStub::AsyncInsertSslPolicy( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "sslPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -152,14 +165,17 @@ DefaultRegionSslPoliciesRestStub::InsertSslPolicy( Options const& options, google::cloud::cpp::compute::region_ssl_policies::v1:: InsertSslPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.ssl_policy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "sslPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -168,19 +184,23 @@ DefaultRegionSslPoliciesRestStub::ListRegionSslPolicies( Options const& options, google::cloud::cpp::compute::region_ssl_policies::v1:: ListRegionSslPoliciesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "sslPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr< @@ -190,6 +210,16 @@ DefaultRegionSslPoliciesRestStub::ListAvailableFeatures( Options const& options, google::cloud::cpp::compute::region_ssl_policies::v1:: ListAvailableFeaturesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, @@ -198,13 +228,7 @@ DefaultRegionSslPoliciesRestStub::ListAvailableFeatures( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "sslPolicies", "/", "listAvailableFeatures"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -219,6 +243,10 @@ DefaultRegionSslPoliciesRestStub::AsyncPatchSslPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.ssl_policy_resource(), false, @@ -227,8 +255,7 @@ DefaultRegionSslPoliciesRestStub::AsyncPatchSslPolicy( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "sslPolicies", "/", request.ssl_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -247,6 +274,10 @@ DefaultRegionSslPoliciesRestStub::PatchSslPolicy( Options const& options, google::cloud::cpp::compute::region_ssl_policies::v1:: PatchSslPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.ssl_policy_resource(), false, absl::StrCat("/", "compute", "/", @@ -254,8 +285,7 @@ DefaultRegionSslPoliciesRestStub::PatchSslPolicy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "sslPolicies", "/", request.ssl_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.cc b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.cc index c668554838ee3..71c38b8eba7b4 100644 --- a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.cc +++ b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.cc @@ -59,6 +59,10 @@ DefaultRegionTargetHttpProxiesRestStub::AsyncDeleteTargetHttpProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -68,8 +72,7 @@ DefaultRegionTargetHttpProxiesRestStub::AsyncDeleteTargetHttpProxy( "regions", "/", request.region(), "/", "targetHttpProxies", "/", request.target_http_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -88,6 +91,10 @@ DefaultRegionTargetHttpProxiesRestStub::DeleteTargetHttpProxy( Options const& options, google::cloud::cpp::compute::region_target_http_proxies::v1:: DeleteTargetHttpProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -95,8 +102,7 @@ DefaultRegionTargetHttpProxiesRestStub::DeleteTargetHttpProxy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetHttpProxies", "/", request.target_http_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -105,13 +111,17 @@ DefaultRegionTargetHttpProxiesRestStub::GetTargetHttpProxy( Options const& options, google::cloud::cpp::compute::region_target_http_proxies::v1:: GetTargetHttpProxyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetHttpProxies", "/", - request.target_http_proxy())); + request.target_http_proxy()), + std::move(query_params)); } future> @@ -126,6 +136,10 @@ DefaultRegionTargetHttpProxiesRestStub::AsyncInsertTargetHttpProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.target_http_proxy_resource(), @@ -135,8 +149,7 @@ DefaultRegionTargetHttpProxiesRestStub::AsyncInsertTargetHttpProxy( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetHttpProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -155,14 +168,17 @@ DefaultRegionTargetHttpProxiesRestStub::InsertTargetHttpProxy( Options const& options, google::cloud::cpp::compute::region_target_http_proxies::v1:: InsertTargetHttpProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_http_proxy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetHttpProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -171,6 +187,16 @@ DefaultRegionTargetHttpProxiesRestStub::ListRegionTargetHttpProxies( Options const& options, google::cloud::cpp::compute::region_target_http_proxies::v1:: ListRegionTargetHttpProxiesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::TargetHttpProxyList>( *service_, rest_context, request, false, @@ -178,13 +204,7 @@ DefaultRegionTargetHttpProxiesRestStub::ListRegionTargetHttpProxies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetHttpProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -199,6 +219,10 @@ DefaultRegionTargetHttpProxiesRestStub::AsyncSetUrlMap( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.url_map_reference_resource(), @@ -209,8 +233,7 @@ DefaultRegionTargetHttpProxiesRestStub::AsyncSetUrlMap( "regions", "/", request.region(), "/", "targetHttpProxies", "/", request.target_http_proxy(), "/", "setUrlMap"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -229,6 +252,10 @@ DefaultRegionTargetHttpProxiesRestStub::SetUrlMap( Options const& options, google::cloud::cpp::compute::region_target_http_proxies::v1:: SetUrlMapRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.url_map_reference_resource(), false, absl::StrCat("/", "compute", "/", @@ -236,8 +263,7 @@ DefaultRegionTargetHttpProxiesRestStub::SetUrlMap( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetHttpProxies", "/", request.target_http_proxy(), "/", "setUrlMap"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.cc b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.cc index 12cc5fdb37e27..d36aa2b2375d4 100644 --- a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.cc +++ b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.cc @@ -60,6 +60,10 @@ DefaultRegionTargetHttpsProxiesRestStub::AsyncDeleteTargetHttpsProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -69,8 +73,7 @@ DefaultRegionTargetHttpsProxiesRestStub::AsyncDeleteTargetHttpsProxy( "regions", "/", request.region(), "/", "targetHttpsProxies", "/", request.target_https_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -89,6 +92,10 @@ DefaultRegionTargetHttpsProxiesRestStub::DeleteTargetHttpsProxy( Options const& options, google::cloud::cpp::compute::region_target_https_proxies::v1:: DeleteTargetHttpsProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -96,8 +103,7 @@ DefaultRegionTargetHttpsProxiesRestStub::DeleteTargetHttpsProxy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetHttpsProxies", "/", request.target_https_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -106,13 +112,17 @@ DefaultRegionTargetHttpsProxiesRestStub::GetTargetHttpsProxy( Options const& options, google::cloud::cpp::compute::region_target_https_proxies::v1:: GetTargetHttpsProxyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetHttpsProxies", "/", - request.target_https_proxy())); + request.target_https_proxy()), + std::move(query_params)); } future> @@ -127,6 +137,10 @@ DefaultRegionTargetHttpsProxiesRestStub::AsyncInsertTargetHttpsProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.target_https_proxy_resource(), @@ -136,8 +150,7 @@ DefaultRegionTargetHttpsProxiesRestStub::AsyncInsertTargetHttpsProxy( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetHttpsProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -156,14 +169,17 @@ DefaultRegionTargetHttpsProxiesRestStub::InsertTargetHttpsProxy( Options const& options, google::cloud::cpp::compute::region_target_https_proxies::v1:: InsertTargetHttpsProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_https_proxy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetHttpsProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -172,6 +188,16 @@ DefaultRegionTargetHttpsProxiesRestStub::ListRegionTargetHttpsProxies( Options const& options, google::cloud::cpp::compute::region_target_https_proxies::v1:: ListRegionTargetHttpsProxiesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::TargetHttpsProxyList>( *service_, rest_context, request, false, @@ -179,13 +205,7 @@ DefaultRegionTargetHttpsProxiesRestStub::ListRegionTargetHttpsProxies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetHttpsProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -200,6 +220,10 @@ DefaultRegionTargetHttpsProxiesRestStub::AsyncPatchTargetHttpsProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.target_https_proxy_resource(), @@ -210,8 +234,7 @@ DefaultRegionTargetHttpsProxiesRestStub::AsyncPatchTargetHttpsProxy( "regions", "/", request.region(), "/", "targetHttpsProxies", "/", request.target_https_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -230,6 +253,10 @@ DefaultRegionTargetHttpsProxiesRestStub::PatchTargetHttpsProxy( Options const& options, google::cloud::cpp::compute::region_target_https_proxies::v1:: PatchTargetHttpsProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.target_https_proxy_resource(), false, absl::StrCat("/", "compute", "/", @@ -237,8 +264,7 @@ DefaultRegionTargetHttpsProxiesRestStub::PatchTargetHttpsProxy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetHttpsProxies", "/", request.target_https_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -253,6 +279,10 @@ DefaultRegionTargetHttpsProxiesRestStub::AsyncSetSslCertificates( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -265,8 +295,7 @@ DefaultRegionTargetHttpsProxiesRestStub::AsyncSetSslCertificates( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetHttpsProxies", "/", request.target_https_proxy(), "/", "setSslCertificates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -285,6 +314,10 @@ DefaultRegionTargetHttpsProxiesRestStub::SetSslCertificates( Options const& options, google::cloud::cpp::compute::region_target_https_proxies::v1:: SetSslCertificatesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request @@ -295,8 +328,7 @@ DefaultRegionTargetHttpsProxiesRestStub::SetSslCertificates( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetHttpsProxies", "/", request.target_https_proxy(), "/", "setSslCertificates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -311,6 +343,10 @@ DefaultRegionTargetHttpsProxiesRestStub::AsyncSetUrlMap( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.url_map_reference_resource(), @@ -321,8 +357,7 @@ DefaultRegionTargetHttpsProxiesRestStub::AsyncSetUrlMap( "regions", "/", request.region(), "/", "targetHttpsProxies", "/", request.target_https_proxy(), "/", "setUrlMap"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -341,6 +376,10 @@ DefaultRegionTargetHttpsProxiesRestStub::SetUrlMap( Options const& options, google::cloud::cpp::compute::region_target_https_proxies::v1:: SetUrlMapRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.url_map_reference_resource(), false, absl::StrCat("/", "compute", "/", @@ -348,8 +387,7 @@ DefaultRegionTargetHttpsProxiesRestStub::SetUrlMap( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetHttpsProxies", "/", request.target_https_proxy(), "/", "setUrlMap"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.cc b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.cc index 8186f7caf214d..f49732696a11a 100644 --- a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.cc +++ b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.cc @@ -59,6 +59,10 @@ DefaultRegionTargetTcpProxiesRestStub::AsyncDeleteTargetTcpProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -68,8 +72,7 @@ DefaultRegionTargetTcpProxiesRestStub::AsyncDeleteTargetTcpProxy( "regions", "/", request.region(), "/", "targetTcpProxies", "/", request.target_tcp_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -88,6 +91,10 @@ DefaultRegionTargetTcpProxiesRestStub::DeleteTargetTcpProxy( Options const& options, google::cloud::cpp::compute::region_target_tcp_proxies::v1:: DeleteTargetTcpProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -95,8 +102,7 @@ DefaultRegionTargetTcpProxiesRestStub::DeleteTargetTcpProxy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetTcpProxies", "/", request.target_tcp_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -105,13 +111,17 @@ DefaultRegionTargetTcpProxiesRestStub::GetTargetTcpProxy( Options const& options, google::cloud::cpp::compute::region_target_tcp_proxies::v1:: GetTargetTcpProxyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetTcpProxies", "/", - request.target_tcp_proxy())); + request.target_tcp_proxy()), + std::move(query_params)); } future> @@ -126,6 +136,10 @@ DefaultRegionTargetTcpProxiesRestStub::AsyncInsertTargetTcpProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.target_tcp_proxy_resource(), @@ -135,8 +149,7 @@ DefaultRegionTargetTcpProxiesRestStub::AsyncInsertTargetTcpProxy( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetTcpProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -155,14 +168,17 @@ DefaultRegionTargetTcpProxiesRestStub::InsertTargetTcpProxy( Options const& options, google::cloud::cpp::compute::region_target_tcp_proxies::v1:: InsertTargetTcpProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_tcp_proxy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetTcpProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -171,6 +187,16 @@ DefaultRegionTargetTcpProxiesRestStub::ListRegionTargetTcpProxies( Options const& options, google::cloud::cpp::compute::region_target_tcp_proxies::v1:: ListRegionTargetTcpProxiesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::TargetTcpProxyList>( *service_, rest_context, request, false, @@ -178,13 +204,7 @@ DefaultRegionTargetTcpProxiesRestStub::ListRegionTargetTcpProxies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetTcpProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.cc b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.cc index 02a7b7b434198..3013d4dfdeca4 100644 --- a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.cc +++ b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.cc @@ -57,6 +57,10 @@ DefaultRegionUrlMapsRestStub::AsyncDeleteUrlMap( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -65,8 +69,7 @@ DefaultRegionUrlMapsRestStub::AsyncDeleteUrlMap( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "urlMaps", "/", request.url_map()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -85,14 +88,17 @@ DefaultRegionUrlMapsRestStub::DeleteUrlMap( Options const& options, google::cloud::cpp::compute::region_url_maps::v1::DeleteUrlMapRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "urlMaps", "/", request.url_map()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -101,12 +107,16 @@ DefaultRegionUrlMapsRestStub::GetUrlMap( Options const& options, google::cloud::cpp::compute::region_url_maps::v1::GetUrlMapRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", - request.region(), "/", "urlMaps", "/", request.url_map())); + request.region(), "/", "urlMaps", "/", request.url_map()), + std::move(query_params)); } future> @@ -121,6 +131,10 @@ DefaultRegionUrlMapsRestStub::AsyncInsertUrlMap( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.url_map_resource(), false, @@ -128,8 +142,7 @@ DefaultRegionUrlMapsRestStub::AsyncInsertUrlMap( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "urlMaps"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -148,14 +161,17 @@ DefaultRegionUrlMapsRestStub::InsertUrlMap( Options const& options, google::cloud::cpp::compute::region_url_maps::v1::InsertUrlMapRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.url_map_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "urlMaps"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -164,19 +180,23 @@ DefaultRegionUrlMapsRestStub::ListRegionUrlMaps( Options const& options, google::cloud::cpp::compute::region_url_maps::v1:: ListRegionUrlMapsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "urlMaps"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -191,6 +211,10 @@ DefaultRegionUrlMapsRestStub::AsyncPatchUrlMap( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.url_map_resource(), false, @@ -199,8 +223,7 @@ DefaultRegionUrlMapsRestStub::AsyncPatchUrlMap( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "urlMaps", "/", request.url_map()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -219,14 +242,17 @@ DefaultRegionUrlMapsRestStub::PatchUrlMap( Options const& options, google::cloud::cpp::compute::region_url_maps::v1::PatchUrlMapRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.url_map_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "urlMaps", "/", request.url_map()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -241,6 +267,10 @@ DefaultRegionUrlMapsRestStub::AsyncUpdateUrlMap( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Put( *service, *rest_context, request.url_map_resource(), false, @@ -249,8 +279,7 @@ DefaultRegionUrlMapsRestStub::AsyncUpdateUrlMap( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "urlMaps", "/", request.url_map()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -269,14 +298,17 @@ DefaultRegionUrlMapsRestStub::UpdateUrlMap( Options const& options, google::cloud::cpp::compute::region_url_maps::v1::UpdateUrlMapRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.url_map_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "urlMaps", "/", request.url_map()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -285,6 +317,9 @@ DefaultRegionUrlMapsRestStub::Validate( Options const& options, google::cloud::cpp::compute::region_url_maps::v1::ValidateRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::UrlMapsValidateResponse>( *service_, rest_context, @@ -293,7 +328,8 @@ DefaultRegionUrlMapsRestStub::Validate( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "urlMaps", "/", request.url_map(), - "/", "validate")); + "/", "validate"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/region_zones/v1/internal/region_zones_rest_stub.cc b/google/cloud/compute/region_zones/v1/internal/region_zones_rest_stub.cc index 9a1e705b7bdbc..d75d70d7f2a9c 100644 --- a/google/cloud/compute/region_zones/v1/internal/region_zones_rest_stub.cc +++ b/google/cloud/compute/region_zones/v1/internal/region_zones_rest_stub.cc @@ -45,19 +45,23 @@ DefaultRegionZonesRestStub::ListRegionZones( Options const& options, google::cloud::cpp::compute::region_zones::v1::ListRegionZonesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "zones"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/compute/regions/v1/internal/regions_rest_stub.cc b/google/cloud/compute/regions/v1/internal/regions_rest_stub.cc index 0aa972fac3728..8ba241f4d720e 100644 --- a/google/cloud/compute/regions/v1/internal/regions_rest_stub.cc +++ b/google/cloud/compute/regions/v1/internal/regions_rest_stub.cc @@ -44,12 +44,16 @@ DefaultRegionsRestStub::GetRegion( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::regions::v1::GetRegionRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", - request.region())); + request.region()), + std::move(query_params)); } StatusOr @@ -58,18 +62,22 @@ DefaultRegionsRestStub::ListRegions( Options const& options, google::cloud::cpp::compute::regions::v1::ListRegionsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/compute/reservations/v1/internal/reservations_rest_stub.cc b/google/cloud/compute/reservations/v1/internal/reservations_rest_stub.cc index a85014817840c..6180d7fb67f11 100644 --- a/google/cloud/compute/reservations/v1/internal/reservations_rest_stub.cc +++ b/google/cloud/compute/reservations/v1/internal/reservations_rest_stub.cc @@ -51,6 +51,20 @@ DefaultReservationsRestStub::AggregatedListReservations( Options const& options, google::cloud::cpp::compute::reservations::v1:: AggregatedListReservationsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::ReservationAggregatedList>( *service_, rest_context, request, false, @@ -58,17 +72,7 @@ DefaultReservationsRestStub::AggregatedListReservations( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "reservations"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -83,6 +87,10 @@ DefaultReservationsRestStub::AsyncDeleteReservation( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -91,8 +99,7 @@ DefaultReservationsRestStub::AsyncDeleteReservation( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "reservations", "/", request.reservation()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -111,6 +118,10 @@ DefaultReservationsRestStub::DeleteReservation( Options const& options, google::cloud::cpp::compute::reservations::v1:: DeleteReservationRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -118,8 +129,7 @@ DefaultReservationsRestStub::DeleteReservation( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "reservations", "/", request.reservation()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -128,13 +138,17 @@ DefaultReservationsRestStub::GetReservation( Options const& options, google::cloud::cpp::compute::reservations::v1::GetReservationRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "reservations", "/", - request.reservation())); + request.reservation()), + std::move(query_params)); } StatusOr @@ -143,6 +157,12 @@ DefaultReservationsRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::reservations::v1::GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -150,9 +170,7 @@ DefaultReservationsRestStub::GetIamPolicy( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "reservations", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } future> @@ -167,6 +185,10 @@ DefaultReservationsRestStub::AsyncInsertReservation( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.reservation_resource(), false, @@ -174,8 +196,7 @@ DefaultReservationsRestStub::AsyncInsertReservation( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "reservations"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -194,14 +215,17 @@ DefaultReservationsRestStub::InsertReservation( Options const& options, google::cloud::cpp::compute::reservations::v1:: InsertReservationRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.reservation_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "reservations"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -210,19 +234,23 @@ DefaultReservationsRestStub::ListReservations( Options const& options, google::cloud::cpp::compute::reservations::v1:: ListReservationsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "reservations"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -237,6 +265,10 @@ DefaultReservationsRestStub::AsyncResize( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -246,8 +278,7 @@ DefaultReservationsRestStub::AsyncResize( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "reservations", "/", request.reservation(), "/", "resize"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -266,6 +297,10 @@ DefaultReservationsRestStub::Resize( Options const& options, google::cloud::cpp::compute::reservations::v1::ResizeRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.reservations_resize_request_resource(), false, @@ -274,8 +309,7 @@ DefaultReservationsRestStub::Resize( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "reservations", "/", request.reservation(), "/", "resize"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -284,6 +318,9 @@ DefaultReservationsRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::reservations::v1::SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.zone_set_policy_request_resource(), false, @@ -291,7 +328,8 @@ DefaultReservationsRestStub::SetIamPolicy( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "reservations", "/", request.resource(), - "/", "setIamPolicy")); + "/", "setIamPolicy"), + std::move(query_params)); } StatusOr @@ -300,6 +338,9 @@ DefaultReservationsRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::reservations::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -308,7 +349,8 @@ DefaultReservationsRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "reservations", "/", request.resource(), - "/", "testIamPermissions")); + "/", "testIamPermissions"), + std::move(query_params)); } future> @@ -323,6 +365,12 @@ DefaultReservationsRestStub::AsyncUpdateReservation( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"paths", request.paths()}); + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.reservation_resource(), false, @@ -331,10 +379,7 @@ DefaultReservationsRestStub::AsyncUpdateReservation( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "reservations", "/", request.reservation()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("paths", request.paths()), - std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())}))); + std::move(query_params))); }, std::move(p), service_, @@ -353,6 +398,12 @@ DefaultReservationsRestStub::UpdateReservation( Options const& options, google::cloud::cpp::compute::reservations::v1:: UpdateReservationRequest const& request) { + std::vector> query_params; + query_params.push_back({"paths", request.paths()}); + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.reservation_resource(), false, absl::StrCat("/", "compute", "/", @@ -360,10 +411,7 @@ DefaultReservationsRestStub::UpdateReservation( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "reservations", "/", request.reservation()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("paths", request.paths()), - std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.cc b/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.cc index adf6a8b547e54..c5a59f6200d45 100644 --- a/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.cc +++ b/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.cc @@ -52,6 +52,20 @@ DefaultResourcePoliciesRestStub::AggregatedListResourcePolicies( Options const& options, google::cloud::cpp::compute::resource_policies::v1:: AggregatedListResourcePoliciesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::ResourcePolicyAggregatedList>( *service_, rest_context, request, false, @@ -59,17 +73,7 @@ DefaultResourcePoliciesRestStub::AggregatedListResourcePolicies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "resourcePolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -84,6 +88,10 @@ DefaultResourcePoliciesRestStub::AsyncDeleteResourcePolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -93,8 +101,7 @@ DefaultResourcePoliciesRestStub::AsyncDeleteResourcePolicy( "regions", "/", request.region(), "/", "resourcePolicies", "/", request.resource_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -113,6 +120,10 @@ DefaultResourcePoliciesRestStub::DeleteResourcePolicy( Options const& options, google::cloud::cpp::compute::resource_policies::v1:: DeleteResourcePolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -120,8 +131,7 @@ DefaultResourcePoliciesRestStub::DeleteResourcePolicy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "resourcePolicies", "/", request.resource_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -130,13 +140,17 @@ DefaultResourcePoliciesRestStub::GetResourcePolicy( Options const& options, google::cloud::cpp::compute::resource_policies::v1:: GetResourcePolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "resourcePolicies", "/", - request.resource_policy())); + request.resource_policy()), + std::move(query_params)); } StatusOr @@ -145,6 +159,12 @@ DefaultResourcePoliciesRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::resource_policies::v1:: GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -152,9 +172,7 @@ DefaultResourcePoliciesRestStub::GetIamPolicy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "resourcePolicies", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } future> @@ -169,6 +187,10 @@ DefaultResourcePoliciesRestStub::AsyncInsertResourcePolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.resource_policy_resource(), @@ -178,8 +200,7 @@ DefaultResourcePoliciesRestStub::AsyncInsertResourcePolicy( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "resourcePolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -198,14 +219,17 @@ DefaultResourcePoliciesRestStub::InsertResourcePolicy( Options const& options, google::cloud::cpp::compute::resource_policies::v1:: InsertResourcePolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.resource_policy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "resourcePolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -214,6 +238,16 @@ DefaultResourcePoliciesRestStub::ListResourcePolicies( Options const& options, google::cloud::cpp::compute::resource_policies::v1:: ListResourcePoliciesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::ResourcePolicyList>( *service_, rest_context, request, false, @@ -221,13 +255,7 @@ DefaultResourcePoliciesRestStub::ListResourcePolicies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "resourcePolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -242,6 +270,11 @@ DefaultResourcePoliciesRestStub::AsyncPatchResourcePolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.resource_policy_resource(), @@ -252,9 +285,7 @@ DefaultResourcePoliciesRestStub::AsyncPatchResourcePolicy( "regions", "/", request.region(), "/", "resourcePolicies", "/", request.resource_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())}))); + std::move(query_params))); }, std::move(p), service_, @@ -273,6 +304,11 @@ DefaultResourcePoliciesRestStub::PatchResourcePolicy( Options const& options, google::cloud::cpp::compute::resource_policies::v1:: PatchResourcePolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.resource_policy_resource(), false, absl::StrCat("/", "compute", "/", @@ -280,9 +316,7 @@ DefaultResourcePoliciesRestStub::PatchResourcePolicy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "resourcePolicies", "/", request.resource_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())})); + std::move(query_params)); } StatusOr @@ -291,6 +325,9 @@ DefaultResourcePoliciesRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::resource_policies::v1:: SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_policy_request_resource(), false, @@ -298,7 +335,8 @@ DefaultResourcePoliciesRestStub::SetIamPolicy( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "resourcePolicies", "/", - request.resource(), "/", "setIamPolicy")); + request.resource(), "/", "setIamPolicy"), + std::move(query_params)); } StatusOr @@ -307,6 +345,9 @@ DefaultResourcePoliciesRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::resource_policies::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -315,7 +356,8 @@ DefaultResourcePoliciesRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "resourcePolicies", "/", - request.resource(), "/", "testIamPermissions")); + request.resource(), "/", "testIamPermissions"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/routers/v1/internal/routers_rest_stub.cc b/google/cloud/compute/routers/v1/internal/routers_rest_stub.cc index 850a49ab558fc..984a468952ccf 100644 --- a/google/cloud/compute/routers/v1/internal/routers_rest_stub.cc +++ b/google/cloud/compute/routers/v1/internal/routers_rest_stub.cc @@ -51,6 +51,20 @@ DefaultRoutersRestStub::AggregatedListRouters( Options const& options, google::cloud::cpp::compute::routers::v1:: AggregatedListRoutersRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::RouterAggregatedList>( *service_, rest_context, request, false, @@ -58,17 +72,7 @@ DefaultRoutersRestStub::AggregatedListRouters( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "routers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -83,6 +87,10 @@ DefaultRoutersRestStub::AsyncDeleteRouter( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -91,8 +99,7 @@ DefaultRoutersRestStub::AsyncDeleteRouter( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "routers", "/", request.router()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -111,14 +118,17 @@ DefaultRoutersRestStub::DeleteRouter( Options const& options, google::cloud::cpp::compute::routers::v1::DeleteRouterRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "routers", "/", request.router()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -126,12 +136,16 @@ DefaultRoutersRestStub::GetRouter( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::routers::v1::GetRouterRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", - request.region(), "/", "routers", "/", request.router())); + request.region(), "/", "routers", "/", request.router()), + std::move(query_params)); } StatusOr @@ -140,6 +154,10 @@ DefaultRoutersRestStub::GetNatIpInfo( Options const& options, google::cloud::cpp::compute::routers::v1::GetNatIpInfoRequest const& request) { + std::vector> query_params; + query_params.push_back({"nat_name", request.nat_name()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -147,8 +165,7 @@ DefaultRoutersRestStub::GetNatIpInfo( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "routers", "/", request.router(), "/", "getNatIpInfo"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("nat_name", request.nat_name())})); + std::move(query_params)); } StatusOr @@ -157,6 +174,17 @@ DefaultRoutersRestStub::GetNatMappingInfo( Options const& options, google::cloud::cpp::compute::routers::v1::GetNatMappingInfoRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"nat_name", request.nat_name()}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::VmEndpointNatMappingsList>( *service_, rest_context, request, false, @@ -165,14 +193,7 @@ DefaultRoutersRestStub::GetNatMappingInfo( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "routers", "/", request.router(), "/", "getNatMappingInfo"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("nat_name", request.nat_name()), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -181,6 +202,9 @@ DefaultRoutersRestStub::GetRouterStatus( Options const& options, google::cloud::cpp::compute::routers::v1::GetRouterStatusRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::RouterStatusResponse>( *service_, rest_context, request, false, @@ -188,7 +212,8 @@ DefaultRoutersRestStub::GetRouterStatus( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "routers", "/", request.router(), "/", - "getRouterStatus")); + "getRouterStatus"), + std::move(query_params)); } future> @@ -203,6 +228,10 @@ DefaultRoutersRestStub::AsyncInsertRouter( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.router_resource(), false, @@ -210,8 +239,7 @@ DefaultRoutersRestStub::AsyncInsertRouter( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "routers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -230,14 +258,17 @@ DefaultRoutersRestStub::InsertRouter( Options const& options, google::cloud::cpp::compute::routers::v1::InsertRouterRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.router_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "routers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -246,19 +277,23 @@ DefaultRoutersRestStub::ListRouters( Options const& options, google::cloud::cpp::compute::routers::v1::ListRoutersRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "routers"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -273,6 +308,10 @@ DefaultRoutersRestStub::AsyncPatchRouter( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.router_resource(), false, @@ -281,8 +320,7 @@ DefaultRoutersRestStub::AsyncPatchRouter( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "routers", "/", request.router()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -301,14 +339,17 @@ DefaultRoutersRestStub::PatchRouter( Options const& options, google::cloud::cpp::compute::routers::v1::PatchRouterRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.router_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "routers", "/", request.router()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -316,6 +357,9 @@ DefaultRoutersRestStub::Preview( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::routers::v1::PreviewRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::RoutersPreviewResponse>( *service_, rest_context, request.router_resource(), false, @@ -323,7 +367,8 @@ DefaultRoutersRestStub::Preview( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "routers", "/", request.router(), "/", - "preview")); + "preview"), + std::move(query_params)); } future> @@ -338,6 +383,10 @@ DefaultRoutersRestStub::AsyncUpdateRouter( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Put( *service, *rest_context, request.router_resource(), false, @@ -346,8 +395,7 @@ DefaultRoutersRestStub::AsyncUpdateRouter( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "routers", "/", request.router()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -366,14 +414,17 @@ DefaultRoutersRestStub::UpdateRouter( Options const& options, google::cloud::cpp::compute::routers::v1::UpdateRouterRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.router_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "routers", "/", request.router()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/routes/v1/internal/routes_rest_stub.cc b/google/cloud/compute/routes/v1/internal/routes_rest_stub.cc index e4377e0ee8f59..3df4c92f681d6 100644 --- a/google/cloud/compute/routes/v1/internal/routes_rest_stub.cc +++ b/google/cloud/compute/routes/v1/internal/routes_rest_stub.cc @@ -57,6 +57,10 @@ DefaultRoutesRestStub::AsyncDeleteRoute( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -64,8 +68,7 @@ DefaultRoutesRestStub::AsyncDeleteRoute( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "routes", "/", request.route()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -84,14 +87,17 @@ DefaultRoutesRestStub::DeleteRoute( Options const& options, google::cloud::cpp::compute::routes::v1::DeleteRouteRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "routes", "/", request.route()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -99,12 +105,16 @@ DefaultRoutesRestStub::GetRoute( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::routes::v1::GetRouteRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "routes", "/", request.route())); + "routes", "/", request.route()), + std::move(query_params)); } future> @@ -119,6 +129,10 @@ DefaultRoutesRestStub::AsyncInsertRoute( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.route_resource(), false, @@ -126,8 +140,7 @@ DefaultRoutesRestStub::AsyncInsertRoute( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "routes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -146,14 +159,17 @@ DefaultRoutesRestStub::InsertRoute( Options const& options, google::cloud::cpp::compute::routes::v1::InsertRouteRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.route_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "routes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -161,19 +177,23 @@ DefaultRoutesRestStub::ListRoutes( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::routes::v1::ListRoutesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "routes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.cc b/google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.cc index 07208346d804a..a08b0b3126da2 100644 --- a/google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.cc +++ b/google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.cc @@ -58,6 +58,11 @@ DefaultSecurityPoliciesRestStub::AsyncAddRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"validate_only", (request.validate_only() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -67,8 +72,7 @@ DefaultSecurityPoliciesRestStub::AsyncAddRule( "/", "projects", "/", request.project(), "/", "global", "/", "securityPolicies", "/", request.security_policy(), "/", "addRule"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "validate_only", (request.validate_only() ? "1" : "0"))}))); + std::move(query_params))); }, std::move(p), service_, @@ -87,6 +91,11 @@ DefaultSecurityPoliciesRestStub::AddRule( Options const& options, google::cloud::cpp::compute::security_policies::v1::AddRuleRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"validate_only", (request.validate_only() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.security_policy_rule_resource(), false, absl::StrCat("/", "compute", "/", @@ -94,8 +103,7 @@ DefaultSecurityPoliciesRestStub::AddRule( "projects", "/", request.project(), "/", "global", "/", "securityPolicies", "/", request.security_policy(), "/", "addRule"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "validate_only", (request.validate_only() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -104,6 +112,20 @@ DefaultSecurityPoliciesRestStub::AggregatedListSecurityPolicies( Options const& options, google::cloud::cpp::compute::security_policies::v1:: AggregatedListSecurityPoliciesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::SecurityPoliciesAggregatedList>( *service_, rest_context, request, false, @@ -111,17 +133,7 @@ DefaultSecurityPoliciesRestStub::AggregatedListSecurityPolicies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "securityPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -136,6 +148,10 @@ DefaultSecurityPoliciesRestStub::AsyncDeleteSecurityPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -144,8 +160,7 @@ DefaultSecurityPoliciesRestStub::AsyncDeleteSecurityPolicy( "/", "projects", "/", request.project(), "/", "global", "/", "securityPolicies", "/", request.security_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -164,14 +179,17 @@ DefaultSecurityPoliciesRestStub::DeleteSecurityPolicy( Options const& options, google::cloud::cpp::compute::security_policies::v1:: DeleteSecurityPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "securityPolicies", "/", request.security_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -180,12 +198,16 @@ DefaultSecurityPoliciesRestStub::GetSecurityPolicy( Options const& options, google::cloud::cpp::compute::security_policies::v1:: GetSecurityPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "securityPolicies", "/", request.security_policy())); + "securityPolicies", "/", request.security_policy()), + std::move(query_params)); } StatusOr @@ -194,6 +216,10 @@ DefaultSecurityPoliciesRestStub::GetRule( Options const& options, google::cloud::cpp::compute::security_policies::v1::GetRuleRequest const& request) { + std::vector> query_params; + query_params.push_back({"priority", std::to_string(request.priority())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::SecurityPolicyRule>( *service_, rest_context, request, false, @@ -202,8 +228,7 @@ DefaultSecurityPoliciesRestStub::GetRule( "projects", "/", request.project(), "/", "global", "/", "securityPolicies", "/", request.security_policy(), "/", "getRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("priority", std::to_string(request.priority()))})); + std::move(query_params)); } future> @@ -218,6 +243,12 @@ DefaultSecurityPoliciesRestStub::AsyncInsertSecurityPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back( + {"validate_only", (request.validate_only() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.security_policy_resource(), @@ -226,10 +257,7 @@ DefaultSecurityPoliciesRestStub::AsyncInsertSecurityPolicy( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "securityPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("validate_only", - (request.validate_only() ? "1" : "0"))}))); + std::move(query_params))); }, std::move(p), service_, @@ -248,16 +276,19 @@ DefaultSecurityPoliciesRestStub::InsertSecurityPolicy( Options const& options, google::cloud::cpp::compute::security_policies::v1:: InsertSecurityPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back( + {"validate_only", (request.validate_only() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.security_policy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "securityPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("validate_only", - (request.validate_only() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -266,6 +297,16 @@ DefaultSecurityPoliciesRestStub::ListSecurityPolicies( Options const& options, google::cloud::cpp::compute::security_policies::v1:: ListSecurityPoliciesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::SecurityPolicyList>( *service_, rest_context, request, false, @@ -273,13 +314,7 @@ DefaultSecurityPoliciesRestStub::ListSecurityPolicies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "securityPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1:: SecurityPoliciesListPreconfiguredExpressionSetsResponse>( @@ -297,13 +342,7 @@ DefaultSecurityPoliciesRestStub::ListPreconfiguredExpressionSets( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "securityPolicies", "/", "listPreconfiguredExpressionSets"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -318,6 +357,11 @@ DefaultSecurityPoliciesRestStub::AsyncPatchSecurityPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.security_policy_resource(), @@ -327,9 +371,7 @@ DefaultSecurityPoliciesRestStub::AsyncPatchSecurityPolicy( "/", "projects", "/", request.project(), "/", "global", "/", "securityPolicies", "/", request.security_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())}))); + std::move(query_params))); }, std::move(p), service_, @@ -348,15 +390,18 @@ DefaultSecurityPoliciesRestStub::PatchSecurityPolicy( Options const& options, google::cloud::cpp::compute::security_policies::v1:: PatchSecurityPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.security_policy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "securityPolicies", "/", request.security_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())})); + std::move(query_params)); } future> @@ -371,6 +416,14 @@ DefaultSecurityPoliciesRestStub::AsyncPatchRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"priority", std::to_string(request.priority())}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params.push_back( + {"validate_only", (request.validate_only() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -380,12 +433,7 @@ DefaultSecurityPoliciesRestStub::AsyncPatchRule( "/", "projects", "/", request.project(), "/", "global", "/", "securityPolicies", "/", request.security_policy(), "/", "patchRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("priority", - std::to_string(request.priority())), - std::make_pair("update_mask", request.update_mask()), - std::make_pair("validate_only", - (request.validate_only() ? "1" : "0"))}))); + std::move(query_params))); }, std::move(p), service_, @@ -404,6 +452,13 @@ DefaultSecurityPoliciesRestStub::PatchRule( Options const& options, google::cloud::cpp::compute::security_policies::v1::PatchRuleRequest const& request) { + std::vector> query_params; + query_params.push_back({"priority", std::to_string(request.priority())}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params.push_back( + {"validate_only", (request.validate_only() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.security_policy_rule_resource(), false, absl::StrCat("/", "compute", "/", @@ -411,11 +466,7 @@ DefaultSecurityPoliciesRestStub::PatchRule( "projects", "/", request.project(), "/", "global", "/", "securityPolicies", "/", request.security_policy(), "/", "patchRule"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("priority", std::to_string(request.priority())), - std::make_pair("update_mask", request.update_mask()), - std::make_pair("validate_only", - (request.validate_only() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -430,6 +481,9 @@ DefaultSecurityPoliciesRestStub::AsyncRemoveRule( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -437,7 +491,8 @@ DefaultSecurityPoliciesRestStub::AsyncRemoveRule( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "securityPolicies", "/", - request.security_policy(), "/", "removeRule"))); + request.security_policy(), "/", "removeRule"), + std::move(query_params))); }, std::move(p), service_, @@ -456,13 +511,17 @@ DefaultSecurityPoliciesRestStub::RemoveRule( Options const& options, google::cloud::cpp::compute::security_policies::v1::RemoveRuleRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "securityPolicies", "/", request.security_policy(), "/", - "removeRule")); + "removeRule"), + std::move(query_params)); } future> @@ -477,6 +536,9 @@ DefaultSecurityPoliciesRestStub::AsyncSetLabels( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -485,7 +547,8 @@ DefaultSecurityPoliciesRestStub::AsyncSetLabels( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "securityPolicies", "/", - request.resource(), "/", "setLabels"))); + request.resource(), "/", "setLabels"), + std::move(query_params))); }, std::move(p), service_, @@ -504,6 +567,9 @@ DefaultSecurityPoliciesRestStub::SetLabels( Options const& options, google::cloud::cpp::compute::security_policies::v1::SetLabelsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_labels_request_resource(), false, @@ -511,7 +577,8 @@ DefaultSecurityPoliciesRestStub::SetLabels( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "securityPolicies", "/", request.resource(), "/", - "setLabels")); + "setLabels"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.cc b/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.cc index db9a7bd8f0f66..e9bbdcaaceef5 100644 --- a/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.cc +++ b/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.cc @@ -52,6 +52,20 @@ DefaultServiceAttachmentsRestStub::AggregatedListServiceAttachments( Options const& options, google::cloud::cpp::compute::service_attachments::v1:: AggregatedListServiceAttachmentsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::ServiceAttachmentAggregatedList>( *service_, rest_context, request, false, @@ -59,17 +73,7 @@ DefaultServiceAttachmentsRestStub::AggregatedListServiceAttachments( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "serviceAttachments"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -84,6 +88,10 @@ DefaultServiceAttachmentsRestStub::AsyncDeleteServiceAttachment( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -93,8 +101,7 @@ DefaultServiceAttachmentsRestStub::AsyncDeleteServiceAttachment( "regions", "/", request.region(), "/", "serviceAttachments", "/", request.service_attachment()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -113,6 +120,10 @@ DefaultServiceAttachmentsRestStub::DeleteServiceAttachment( Options const& options, google::cloud::cpp::compute::service_attachments::v1:: DeleteServiceAttachmentRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -120,8 +131,7 @@ DefaultServiceAttachmentsRestStub::DeleteServiceAttachment( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "serviceAttachments", "/", request.service_attachment()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -130,13 +140,17 @@ DefaultServiceAttachmentsRestStub::GetServiceAttachment( Options const& options, google::cloud::cpp::compute::service_attachments::v1:: GetServiceAttachmentRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "serviceAttachments", "/", - request.service_attachment())); + request.service_attachment()), + std::move(query_params)); } StatusOr @@ -145,6 +159,12 @@ DefaultServiceAttachmentsRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::service_attachments::v1:: GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -152,9 +172,7 @@ DefaultServiceAttachmentsRestStub::GetIamPolicy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "serviceAttachments", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } future> @@ -169,6 +187,10 @@ DefaultServiceAttachmentsRestStub::AsyncInsertServiceAttachment( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.service_attachment_resource(), @@ -178,8 +200,7 @@ DefaultServiceAttachmentsRestStub::AsyncInsertServiceAttachment( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "serviceAttachments"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -198,14 +219,17 @@ DefaultServiceAttachmentsRestStub::InsertServiceAttachment( Options const& options, google::cloud::cpp::compute::service_attachments::v1:: InsertServiceAttachmentRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.service_attachment_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "serviceAttachments"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -214,6 +238,16 @@ DefaultServiceAttachmentsRestStub::ListServiceAttachments( Options const& options, google::cloud::cpp::compute::service_attachments::v1:: ListServiceAttachmentsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::ServiceAttachmentList>( *service_, rest_context, request, false, @@ -221,13 +255,7 @@ DefaultServiceAttachmentsRestStub::ListServiceAttachments( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "serviceAttachments"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -242,6 +270,10 @@ DefaultServiceAttachmentsRestStub::AsyncPatchServiceAttachment( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.service_attachment_resource(), @@ -252,8 +284,7 @@ DefaultServiceAttachmentsRestStub::AsyncPatchServiceAttachment( "regions", "/", request.region(), "/", "serviceAttachments", "/", request.service_attachment()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -272,6 +303,10 @@ DefaultServiceAttachmentsRestStub::PatchServiceAttachment( Options const& options, google::cloud::cpp::compute::service_attachments::v1:: PatchServiceAttachmentRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.service_attachment_resource(), false, absl::StrCat("/", "compute", "/", @@ -279,8 +314,7 @@ DefaultServiceAttachmentsRestStub::PatchServiceAttachment( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "serviceAttachments", "/", request.service_attachment()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -289,6 +323,9 @@ DefaultServiceAttachmentsRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::service_attachments::v1:: SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_policy_request_resource(), false, @@ -296,7 +333,8 @@ DefaultServiceAttachmentsRestStub::SetIamPolicy( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "serviceAttachments", "/", - request.resource(), "/", "setIamPolicy")); + request.resource(), "/", "setIamPolicy"), + std::move(query_params)); } StatusOr @@ -305,6 +343,9 @@ DefaultServiceAttachmentsRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::service_attachments::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -313,7 +354,8 @@ DefaultServiceAttachmentsRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "serviceAttachments", "/", - request.resource(), "/", "testIamPermissions")); + request.resource(), "/", "testIamPermissions"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.cc b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.cc index 47a9af99ff2b4..d53f85609991f 100644 --- a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.cc +++ b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.cc @@ -52,12 +52,16 @@ DefaultSnapshotSettingsRestStub::GetSnapshotSettings( Options const& options, google::cloud::cpp::compute::snapshot_settings::v1:: GetSnapshotSettingsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "snapshotSettings")); + "snapshotSettings"), + std::move(query_params)); } future> @@ -72,6 +76,11 @@ DefaultSnapshotSettingsRestStub::AsyncPatchSnapshotSettings( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.snapshot_settings_resource(), @@ -80,9 +89,7 @@ DefaultSnapshotSettingsRestStub::AsyncPatchSnapshotSettings( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "snapshotSettings"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())}))); + std::move(query_params))); }, std::move(p), service_, @@ -101,15 +108,18 @@ DefaultSnapshotSettingsRestStub::PatchSnapshotSettings( Options const& options, google::cloud::cpp::compute::snapshot_settings::v1:: PatchSnapshotSettingsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.snapshot_settings_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "snapshotSettings"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.cc b/google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.cc index 9249ca8a9213e..4ec2cc0743589 100644 --- a/google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.cc +++ b/google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.cc @@ -57,6 +57,10 @@ DefaultSnapshotsRestStub::AsyncDeleteSnapshot( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -65,8 +69,7 @@ DefaultSnapshotsRestStub::AsyncDeleteSnapshot( "/", "projects", "/", request.project(), "/", "global", "/", "snapshots", "/", request.snapshot()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -85,14 +88,17 @@ DefaultSnapshotsRestStub::DeleteSnapshot( Options const& options, google::cloud::cpp::compute::snapshots::v1::DeleteSnapshotRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "snapshots", "/", request.snapshot()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -101,12 +107,16 @@ DefaultSnapshotsRestStub::GetSnapshot( Options const& options, google::cloud::cpp::compute::snapshots::v1::GetSnapshotRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "snapshots", "/", request.snapshot())); + "snapshots", "/", request.snapshot()), + std::move(query_params)); } StatusOr @@ -115,15 +125,19 @@ DefaultSnapshotsRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::snapshots::v1::GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "snapshots", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } future> @@ -138,6 +152,10 @@ DefaultSnapshotsRestStub::AsyncInsertSnapshot( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.snapshot_resource(), false, @@ -145,8 +163,7 @@ DefaultSnapshotsRestStub::AsyncInsertSnapshot( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "snapshots"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -165,14 +182,17 @@ DefaultSnapshotsRestStub::InsertSnapshot( Options const& options, google::cloud::cpp::compute::snapshots::v1::InsertSnapshotRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.snapshot_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "snapshots"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -181,19 +201,23 @@ DefaultSnapshotsRestStub::ListSnapshots( Options const& options, google::cloud::cpp::compute::snapshots::v1::ListSnapshotsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "snapshots"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -202,13 +226,17 @@ DefaultSnapshotsRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::snapshots::v1::SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_policy_request_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "snapshots", "/", request.resource(), "/", "setIamPolicy")); + "snapshots", "/", request.resource(), "/", "setIamPolicy"), + std::move(query_params)); } future> @@ -223,6 +251,9 @@ DefaultSnapshotsRestStub::AsyncSetLabels( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -231,7 +262,8 @@ DefaultSnapshotsRestStub::AsyncSetLabels( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "snapshots", "/", - request.resource(), "/", "setLabels"))); + request.resource(), "/", "setLabels"), + std::move(query_params))); }, std::move(p), service_, @@ -250,13 +282,17 @@ DefaultSnapshotsRestStub::SetLabels( Options const& options, google::cloud::cpp::compute::snapshots::v1::SetLabelsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_labels_request_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "snapshots", "/", request.resource(), "/", "setLabels")); + "snapshots", "/", request.resource(), "/", "setLabels"), + std::move(query_params)); } StatusOr @@ -265,6 +301,9 @@ DefaultSnapshotsRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::snapshots::v1::TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -273,7 +312,8 @@ DefaultSnapshotsRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "snapshots", "/", request.resource(), "/", - "testIamPermissions")); + "testIamPermissions"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.cc b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.cc index 3d08d1a9a3f50..93de7f1c28b66 100644 --- a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.cc +++ b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.cc @@ -51,6 +51,20 @@ DefaultSslCertificatesRestStub::AggregatedListSslCertificates( Options const& options, google::cloud::cpp::compute::ssl_certificates::v1:: AggregatedListSslCertificatesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::SslCertificateAggregatedList>( *service_, rest_context, request, false, @@ -58,17 +72,7 @@ DefaultSslCertificatesRestStub::AggregatedListSslCertificates( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "sslCertificates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -83,6 +87,10 @@ DefaultSslCertificatesRestStub::AsyncDeleteSslCertificate( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -91,8 +99,7 @@ DefaultSslCertificatesRestStub::AsyncDeleteSslCertificate( "/", "projects", "/", request.project(), "/", "global", "/", "sslCertificates", "/", request.ssl_certificate()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -111,14 +118,17 @@ DefaultSslCertificatesRestStub::DeleteSslCertificate( Options const& options, google::cloud::cpp::compute::ssl_certificates::v1:: DeleteSslCertificateRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "sslCertificates", "/", request.ssl_certificate()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -127,12 +137,16 @@ DefaultSslCertificatesRestStub::GetSslCertificate( Options const& options, google::cloud::cpp::compute::ssl_certificates::v1:: GetSslCertificateRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "sslCertificates", "/", request.ssl_certificate())); + "sslCertificates", "/", request.ssl_certificate()), + std::move(query_params)); } future> @@ -147,6 +161,10 @@ DefaultSslCertificatesRestStub::AsyncInsertSslCertificate( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.ssl_certificate_resource(), @@ -155,8 +173,7 @@ DefaultSslCertificatesRestStub::AsyncInsertSslCertificate( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "sslCertificates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -175,14 +192,17 @@ DefaultSslCertificatesRestStub::InsertSslCertificate( Options const& options, google::cloud::cpp::compute::ssl_certificates::v1:: InsertSslCertificateRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.ssl_certificate_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "sslCertificates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -191,6 +211,16 @@ DefaultSslCertificatesRestStub::ListSslCertificates( Options const& options, google::cloud::cpp::compute::ssl_certificates::v1:: ListSslCertificatesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::SslCertificateList>( *service_, rest_context, request, false, @@ -198,13 +228,7 @@ DefaultSslCertificatesRestStub::ListSslCertificates( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "sslCertificates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.cc b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.cc index 73890481ebcec..8608bf85b2738 100644 --- a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.cc +++ b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.cc @@ -51,6 +51,20 @@ DefaultSslPoliciesRestStub::AggregatedListSslPolicies( Options const& options, google::cloud::cpp::compute::ssl_policies::v1:: AggregatedListSslPoliciesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::SslPoliciesAggregatedList>( *service_, rest_context, request, false, @@ -58,17 +72,7 @@ DefaultSslPoliciesRestStub::AggregatedListSslPolicies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "sslPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -83,6 +87,10 @@ DefaultSslPoliciesRestStub::AsyncDeleteSslPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -91,8 +99,7 @@ DefaultSslPoliciesRestStub::AsyncDeleteSslPolicy( "/", "projects", "/", request.project(), "/", "global", "/", "sslPolicies", "/", request.ssl_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -111,14 +118,17 @@ DefaultSslPoliciesRestStub::DeleteSslPolicy( Options const& options, google::cloud::cpp::compute::ssl_policies::v1::DeleteSslPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "sslPolicies", "/", request.ssl_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -127,12 +137,16 @@ DefaultSslPoliciesRestStub::GetSslPolicy( Options const& options, google::cloud::cpp::compute::ssl_policies::v1::GetSslPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "sslPolicies", "/", request.ssl_policy())); + "sslPolicies", "/", request.ssl_policy()), + std::move(query_params)); } future> @@ -147,6 +161,10 @@ DefaultSslPoliciesRestStub::AsyncInsertSslPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.ssl_policy_resource(), false, @@ -154,8 +172,7 @@ DefaultSslPoliciesRestStub::AsyncInsertSslPolicy( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "sslPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -174,14 +191,17 @@ DefaultSslPoliciesRestStub::InsertSslPolicy( Options const& options, google::cloud::cpp::compute::ssl_policies::v1::InsertSslPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.ssl_policy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "sslPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -190,19 +210,23 @@ DefaultSslPoliciesRestStub::ListSslPolicies( Options const& options, google::cloud::cpp::compute::ssl_policies::v1::ListSslPoliciesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "sslPolicies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr< @@ -212,6 +236,16 @@ DefaultSslPoliciesRestStub::ListAvailableFeatures( Options const& options, google::cloud::cpp::compute::ssl_policies::v1:: ListAvailableFeaturesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, @@ -219,13 +253,7 @@ DefaultSslPoliciesRestStub::ListAvailableFeatures( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "sslPolicies", "/", "listAvailableFeatures"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -240,6 +268,10 @@ DefaultSslPoliciesRestStub::AsyncPatchSslPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.ssl_policy_resource(), false, @@ -248,8 +280,7 @@ DefaultSslPoliciesRestStub::AsyncPatchSslPolicy( "/", "projects", "/", request.project(), "/", "global", "/", "sslPolicies", "/", request.ssl_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -268,14 +299,17 @@ DefaultSslPoliciesRestStub::PatchSslPolicy( Options const& options, google::cloud::cpp::compute::ssl_policies::v1::PatchSslPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.ssl_policy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "sslPolicies", "/", request.ssl_policy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_stub.cc b/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_stub.cc index f0afdec6fbe06..ae0c0690de178 100644 --- a/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_stub.cc +++ b/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_stub.cc @@ -46,6 +46,20 @@ DefaultStoragePoolTypesRestStub::AggregatedListStoragePoolTypes( Options const& options, google::cloud::cpp::compute::storage_pool_types::v1:: AggregatedListStoragePoolTypesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::StoragePoolTypeAggregatedList>( *service_, rest_context, request, false, @@ -53,17 +67,7 @@ DefaultStoragePoolTypesRestStub::AggregatedListStoragePoolTypes( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "storagePoolTypes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } StatusOr @@ -72,13 +76,17 @@ DefaultStoragePoolTypesRestStub::GetStoragePoolType( Options const& options, google::cloud::cpp::compute::storage_pool_types::v1:: GetStoragePoolTypeRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "storagePoolTypes", "/", - request.storage_pool_type())); + request.storage_pool_type()), + std::move(query_params)); } StatusOr @@ -87,6 +95,16 @@ DefaultStoragePoolTypesRestStub::ListStoragePoolTypes( Options const& options, google::cloud::cpp::compute::storage_pool_types::v1:: ListStoragePoolTypesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::StoragePoolTypeList>( *service_, rest_context, request, false, @@ -94,13 +112,7 @@ DefaultStoragePoolTypesRestStub::ListStoragePoolTypes( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "storagePoolTypes"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.cc b/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.cc index ecde366f52e06..0319ad0a0938c 100644 --- a/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.cc +++ b/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.cc @@ -51,6 +51,20 @@ DefaultStoragePoolsRestStub::AggregatedListStoragePools( Options const& options, google::cloud::cpp::compute::storage_pools::v1:: AggregatedListStoragePoolsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::StoragePoolAggregatedList>( *service_, rest_context, request, false, @@ -58,17 +72,7 @@ DefaultStoragePoolsRestStub::AggregatedListStoragePools( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "storagePools"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -83,6 +87,10 @@ DefaultStoragePoolsRestStub::AsyncDeleteStoragePool( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -91,8 +99,7 @@ DefaultStoragePoolsRestStub::AsyncDeleteStoragePool( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "storagePools", "/", request.storage_pool()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -111,6 +118,10 @@ DefaultStoragePoolsRestStub::DeleteStoragePool( Options const& options, google::cloud::cpp::compute::storage_pools::v1:: DeleteStoragePoolRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -118,8 +129,7 @@ DefaultStoragePoolsRestStub::DeleteStoragePool( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "storagePools", "/", request.storage_pool()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -128,13 +138,17 @@ DefaultStoragePoolsRestStub::GetStoragePool( Options const& options, google::cloud::cpp::compute::storage_pools::v1::GetStoragePoolRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "storagePools", "/", - request.storage_pool())); + request.storage_pool()), + std::move(query_params)); } StatusOr @@ -143,6 +157,12 @@ DefaultStoragePoolsRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::storage_pools::v1::GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -150,9 +170,7 @@ DefaultStoragePoolsRestStub::GetIamPolicy( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "storagePools", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } future> @@ -167,6 +185,10 @@ DefaultStoragePoolsRestStub::AsyncInsertStoragePool( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.storage_pool_resource(), false, @@ -174,8 +196,7 @@ DefaultStoragePoolsRestStub::AsyncInsertStoragePool( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "storagePools"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -194,14 +215,17 @@ DefaultStoragePoolsRestStub::InsertStoragePool( Options const& options, google::cloud::cpp::compute::storage_pools::v1:: InsertStoragePoolRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.storage_pool_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "storagePools"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -210,19 +234,23 @@ DefaultStoragePoolsRestStub::ListStoragePools( Options const& options, google::cloud::cpp::compute::storage_pools::v1:: ListStoragePoolsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "storagePools"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -231,6 +259,16 @@ DefaultStoragePoolsRestStub::ListDisks( Options const& options, google::cloud::cpp::compute::storage_pools::v1::ListDisksRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::StoragePoolListDisks>( *service_, rest_context, request, false, @@ -239,13 +277,7 @@ DefaultStoragePoolsRestStub::ListDisks( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "storagePools", "/", request.storage_pool(), "/", "listDisks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -254,6 +286,9 @@ DefaultStoragePoolsRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::storage_pools::v1::SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.zone_set_policy_request_resource(), false, @@ -261,7 +296,8 @@ DefaultStoragePoolsRestStub::SetIamPolicy( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "storagePools", "/", request.resource(), - "/", "setIamPolicy")); + "/", "setIamPolicy"), + std::move(query_params)); } StatusOr @@ -270,6 +306,9 @@ DefaultStoragePoolsRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::storage_pools::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -278,7 +317,8 @@ DefaultStoragePoolsRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "storagePools", "/", request.resource(), - "/", "testIamPermissions")); + "/", "testIamPermissions"), + std::move(query_params)); } future> @@ -293,6 +333,11 @@ DefaultStoragePoolsRestStub::AsyncUpdateStoragePool( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.storage_pool_resource(), false, @@ -301,9 +346,7 @@ DefaultStoragePoolsRestStub::AsyncUpdateStoragePool( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "storagePools", "/", request.storage_pool()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())}))); + std::move(query_params))); }, std::move(p), service_, @@ -322,6 +365,11 @@ DefaultStoragePoolsRestStub::UpdateStoragePool( Options const& options, google::cloud::cpp::compute::storage_pools::v1:: UpdateStoragePoolRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params.push_back({"update_mask", request.update_mask()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.storage_pool_resource(), false, absl::StrCat("/", "compute", "/", @@ -329,9 +377,7 @@ DefaultStoragePoolsRestStub::UpdateStoragePool( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "storagePools", "/", request.storage_pool()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id()), - std::make_pair("update_mask", request.update_mask())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.cc b/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.cc index a01dc1393162a..1e49654b7b158 100644 --- a/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.cc +++ b/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.cc @@ -51,6 +51,20 @@ DefaultSubnetworksRestStub::AggregatedListSubnetworks( Options const& options, google::cloud::cpp::compute::subnetworks::v1:: AggregatedListSubnetworksRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::SubnetworkAggregatedList>( *service_, rest_context, request, false, @@ -58,17 +72,7 @@ DefaultSubnetworksRestStub::AggregatedListSubnetworks( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "subnetworks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -83,6 +87,10 @@ DefaultSubnetworksRestStub::AsyncDeleteSubnetwork( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -91,8 +99,7 @@ DefaultSubnetworksRestStub::AsyncDeleteSubnetwork( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "subnetworks", "/", request.subnetwork()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -111,6 +118,10 @@ DefaultSubnetworksRestStub::DeleteSubnetwork( Options const& options, google::cloud::cpp::compute::subnetworks::v1::DeleteSubnetworkRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -118,8 +129,7 @@ DefaultSubnetworksRestStub::DeleteSubnetwork( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "subnetworks", "/", request.subnetwork()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -134,6 +144,10 @@ DefaultSubnetworksRestStub::AsyncExpandIpCidrRange( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -145,8 +159,7 @@ DefaultSubnetworksRestStub::AsyncExpandIpCidrRange( "regions", "/", request.region(), "/", "subnetworks", "/", request.subnetwork(), "/", "expandIpCidrRange"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -165,6 +178,10 @@ DefaultSubnetworksRestStub::ExpandIpCidrRange( Options const& options, google::cloud::cpp::compute::subnetworks::v1:: ExpandIpCidrRangeRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.subnetworks_expand_ip_cidr_range_request_resource(), false, @@ -173,8 +190,7 @@ DefaultSubnetworksRestStub::ExpandIpCidrRange( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "subnetworks", "/", request.subnetwork(), "/", "expandIpCidrRange"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -183,13 +199,17 @@ DefaultSubnetworksRestStub::GetSubnetwork( Options const& options, google::cloud::cpp::compute::subnetworks::v1::GetSubnetworkRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "subnetworks", "/", - request.subnetwork())); + request.subnetwork()), + std::move(query_params)); } StatusOr @@ -198,6 +218,12 @@ DefaultSubnetworksRestStub::GetIamPolicy( Options const& options, google::cloud::cpp::compute::subnetworks::v1::GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"options_requested_policy_version", + std::to_string(request.options_requested_policy_version())}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -205,9 +231,7 @@ DefaultSubnetworksRestStub::GetIamPolicy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "subnetworks", "/", request.resource(), "/", "getIamPolicy"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "options_requested_policy_version", - std::to_string(request.options_requested_policy_version()))})); + std::move(query_params)); } future> @@ -222,6 +246,10 @@ DefaultSubnetworksRestStub::AsyncInsertSubnetwork( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.subnetwork_resource(), false, @@ -230,8 +258,7 @@ DefaultSubnetworksRestStub::AsyncInsertSubnetwork( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "subnetworks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -250,14 +277,17 @@ DefaultSubnetworksRestStub::InsertSubnetwork( Options const& options, google::cloud::cpp::compute::subnetworks::v1::InsertSubnetworkRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.subnetwork_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "subnetworks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -266,19 +296,23 @@ DefaultSubnetworksRestStub::ListSubnetworks( Options const& options, google::cloud::cpp::compute::subnetworks::v1::ListSubnetworksRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "subnetworks"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -287,6 +321,16 @@ DefaultSubnetworksRestStub::ListUsable( Options const& options, google::cloud::cpp::compute::subnetworks::v1::ListUsableRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::UsableSubnetworksAggregatedList>( *service_, rest_context, request, false, @@ -294,13 +338,7 @@ DefaultSubnetworksRestStub::ListUsable( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "subnetworks", "/", "listUsable"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -315,6 +353,13 @@ DefaultSubnetworksRestStub::AsyncPatchSubnetwork( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"drain_timeout_seconds", + std::to_string(request.drain_timeout_seconds())}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.subnetwork_resource(), false, @@ -323,11 +368,7 @@ DefaultSubnetworksRestStub::AsyncPatchSubnetwork( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "subnetworks", "/", request.subnetwork()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair( - "drain_timeout_seconds", - std::to_string(request.drain_timeout_seconds())), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -346,6 +387,12 @@ DefaultSubnetworksRestStub::PatchSubnetwork( Options const& options, google::cloud::cpp::compute::subnetworks::v1::PatchSubnetworkRequest const& request) { + std::vector> query_params; + query_params.push_back({"drain_timeout_seconds", + std::to_string(request.drain_timeout_seconds())}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.subnetwork_resource(), false, absl::StrCat("/", "compute", "/", @@ -353,10 +400,7 @@ DefaultSubnetworksRestStub::PatchSubnetwork( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "subnetworks", "/", request.subnetwork()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("drain_timeout_seconds", - std::to_string(request.drain_timeout_seconds())), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -365,6 +409,9 @@ DefaultSubnetworksRestStub::SetIamPolicy( Options const& options, google::cloud::cpp::compute::subnetworks::v1::SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_policy_request_resource(), false, @@ -372,7 +419,8 @@ DefaultSubnetworksRestStub::SetIamPolicy( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "subnetworks", "/", - request.resource(), "/", "setIamPolicy")); + request.resource(), "/", "setIamPolicy"), + std::move(query_params)); } future> @@ -387,6 +435,10 @@ DefaultSubnetworksRestStub::AsyncSetPrivateIpGoogleAccess( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -398,8 +450,7 @@ DefaultSubnetworksRestStub::AsyncSetPrivateIpGoogleAccess( "regions", "/", request.region(), "/", "subnetworks", "/", request.subnetwork(), "/", "setPrivateIpGoogleAccess"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -418,6 +469,10 @@ DefaultSubnetworksRestStub::SetPrivateIpGoogleAccess( Options const& options, google::cloud::cpp::compute::subnetworks::v1:: SetPrivateIpGoogleAccessRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.subnetworks_set_private_ip_google_access_request_resource(), @@ -427,8 +482,7 @@ DefaultSubnetworksRestStub::SetPrivateIpGoogleAccess( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "subnetworks", "/", request.subnetwork(), "/", "setPrivateIpGoogleAccess"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -437,6 +491,9 @@ DefaultSubnetworksRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::subnetworks::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -445,7 +502,8 @@ DefaultSubnetworksRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "subnetworks", "/", - request.resource(), "/", "testIamPermissions")); + request.resource(), "/", "testIamPermissions"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.cc b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.cc index 30af1d6975ed5..804f60c5449e7 100644 --- a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.cc +++ b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.cc @@ -58,6 +58,10 @@ DefaultTargetGrpcProxiesRestStub::AsyncDeleteTargetGrpcProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -66,8 +70,7 @@ DefaultTargetGrpcProxiesRestStub::AsyncDeleteTargetGrpcProxy( "/", "projects", "/", request.project(), "/", "global", "/", "targetGrpcProxies", "/", request.target_grpc_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -86,14 +89,17 @@ DefaultTargetGrpcProxiesRestStub::DeleteTargetGrpcProxy( Options const& options, google::cloud::cpp::compute::target_grpc_proxies::v1:: DeleteTargetGrpcProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "targetGrpcProxies", "/", request.target_grpc_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -102,12 +108,16 @@ DefaultTargetGrpcProxiesRestStub::GetTargetGrpcProxy( Options const& options, google::cloud::cpp::compute::target_grpc_proxies::v1:: GetTargetGrpcProxyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "targetGrpcProxies", "/", request.target_grpc_proxy())); + "targetGrpcProxies", "/", request.target_grpc_proxy()), + std::move(query_params)); } future> @@ -122,6 +132,10 @@ DefaultTargetGrpcProxiesRestStub::AsyncInsertTargetGrpcProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.target_grpc_proxy_resource(), @@ -130,8 +144,7 @@ DefaultTargetGrpcProxiesRestStub::AsyncInsertTargetGrpcProxy( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "targetGrpcProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -150,14 +163,17 @@ DefaultTargetGrpcProxiesRestStub::InsertTargetGrpcProxy( Options const& options, google::cloud::cpp::compute::target_grpc_proxies::v1:: InsertTargetGrpcProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_grpc_proxy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "targetGrpcProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -166,6 +182,16 @@ DefaultTargetGrpcProxiesRestStub::ListTargetGrpcProxies( Options const& options, google::cloud::cpp::compute::target_grpc_proxies::v1:: ListTargetGrpcProxiesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::TargetGrpcProxyList>( *service_, rest_context, request, false, @@ -173,13 +199,7 @@ DefaultTargetGrpcProxiesRestStub::ListTargetGrpcProxies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "targetGrpcProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -194,6 +214,10 @@ DefaultTargetGrpcProxiesRestStub::AsyncPatchTargetGrpcProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.target_grpc_proxy_resource(), @@ -203,8 +227,7 @@ DefaultTargetGrpcProxiesRestStub::AsyncPatchTargetGrpcProxy( "/", "projects", "/", request.project(), "/", "global", "/", "targetGrpcProxies", "/", request.target_grpc_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -223,14 +246,17 @@ DefaultTargetGrpcProxiesRestStub::PatchTargetGrpcProxy( Options const& options, google::cloud::cpp::compute::target_grpc_proxies::v1:: PatchTargetGrpcProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.target_grpc_proxy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "targetGrpcProxies", "/", request.target_grpc_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.cc b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.cc index 6138af104d2f5..055fc7c9c5d5c 100644 --- a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.cc +++ b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.cc @@ -52,6 +52,20 @@ DefaultTargetHttpProxiesRestStub::AggregatedListTargetHttpProxies( Options const& options, google::cloud::cpp::compute::target_http_proxies::v1:: AggregatedListTargetHttpProxiesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::TargetHttpProxyAggregatedList>( *service_, rest_context, request, false, @@ -59,17 +73,7 @@ DefaultTargetHttpProxiesRestStub::AggregatedListTargetHttpProxies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "targetHttpProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -84,6 +88,10 @@ DefaultTargetHttpProxiesRestStub::AsyncDeleteTargetHttpProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -92,8 +100,7 @@ DefaultTargetHttpProxiesRestStub::AsyncDeleteTargetHttpProxy( "/", "projects", "/", request.project(), "/", "global", "/", "targetHttpProxies", "/", request.target_http_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -112,14 +119,17 @@ DefaultTargetHttpProxiesRestStub::DeleteTargetHttpProxy( Options const& options, google::cloud::cpp::compute::target_http_proxies::v1:: DeleteTargetHttpProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "targetHttpProxies", "/", request.target_http_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -128,12 +138,16 @@ DefaultTargetHttpProxiesRestStub::GetTargetHttpProxy( Options const& options, google::cloud::cpp::compute::target_http_proxies::v1:: GetTargetHttpProxyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "targetHttpProxies", "/", request.target_http_proxy())); + "targetHttpProxies", "/", request.target_http_proxy()), + std::move(query_params)); } future> @@ -148,6 +162,10 @@ DefaultTargetHttpProxiesRestStub::AsyncInsertTargetHttpProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.target_http_proxy_resource(), @@ -156,8 +174,7 @@ DefaultTargetHttpProxiesRestStub::AsyncInsertTargetHttpProxy( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "targetHttpProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -176,14 +193,17 @@ DefaultTargetHttpProxiesRestStub::InsertTargetHttpProxy( Options const& options, google::cloud::cpp::compute::target_http_proxies::v1:: InsertTargetHttpProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_http_proxy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "targetHttpProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -192,6 +212,16 @@ DefaultTargetHttpProxiesRestStub::ListTargetHttpProxies( Options const& options, google::cloud::cpp::compute::target_http_proxies::v1:: ListTargetHttpProxiesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::TargetHttpProxyList>( *service_, rest_context, request, false, @@ -199,13 +229,7 @@ DefaultTargetHttpProxiesRestStub::ListTargetHttpProxies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "targetHttpProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -220,6 +244,10 @@ DefaultTargetHttpProxiesRestStub::AsyncPatchTargetHttpProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.target_http_proxy_resource(), @@ -229,8 +257,7 @@ DefaultTargetHttpProxiesRestStub::AsyncPatchTargetHttpProxy( "/", "projects", "/", request.project(), "/", "global", "/", "targetHttpProxies", "/", request.target_http_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -249,14 +276,17 @@ DefaultTargetHttpProxiesRestStub::PatchTargetHttpProxy( Options const& options, google::cloud::cpp::compute::target_http_proxies::v1:: PatchTargetHttpProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.target_http_proxy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "targetHttpProxies", "/", request.target_http_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -271,6 +301,10 @@ DefaultTargetHttpProxiesRestStub::AsyncSetUrlMap( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.url_map_reference_resource(), @@ -280,8 +314,7 @@ DefaultTargetHttpProxiesRestStub::AsyncSetUrlMap( "/", "projects", "/", request.project(), "/", "targetHttpProxies", "/", request.target_http_proxy(), "/", "setUrlMap"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -300,14 +333,17 @@ DefaultTargetHttpProxiesRestStub::SetUrlMap( Options const& options, google::cloud::cpp::compute::target_http_proxies::v1:: SetUrlMapRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.url_map_reference_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "targetHttpProxies", "/", request.target_http_proxy(), "/", "setUrlMap"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.cc b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.cc index 4a5a747f943fe..e48d411002d1e 100644 --- a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.cc +++ b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.cc @@ -53,6 +53,20 @@ DefaultTargetHttpsProxiesRestStub::AggregatedListTargetHttpsProxies( Options const& options, google::cloud::cpp::compute::target_https_proxies::v1:: AggregatedListTargetHttpsProxiesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::TargetHttpsProxyAggregatedList>( *service_, rest_context, request, false, @@ -60,17 +74,7 @@ DefaultTargetHttpsProxiesRestStub::AggregatedListTargetHttpsProxies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "targetHttpsProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -85,6 +89,10 @@ DefaultTargetHttpsProxiesRestStub::AsyncDeleteTargetHttpsProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -93,8 +101,7 @@ DefaultTargetHttpsProxiesRestStub::AsyncDeleteTargetHttpsProxy( "/", "projects", "/", request.project(), "/", "global", "/", "targetHttpsProxies", "/", request.target_https_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -113,14 +120,17 @@ DefaultTargetHttpsProxiesRestStub::DeleteTargetHttpsProxy( Options const& options, google::cloud::cpp::compute::target_https_proxies::v1:: DeleteTargetHttpsProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "targetHttpsProxies", "/", request.target_https_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -129,12 +139,16 @@ DefaultTargetHttpsProxiesRestStub::GetTargetHttpsProxy( Options const& options, google::cloud::cpp::compute::target_https_proxies::v1:: GetTargetHttpsProxyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "targetHttpsProxies", "/", request.target_https_proxy())); + "targetHttpsProxies", "/", request.target_https_proxy()), + std::move(query_params)); } future> @@ -149,6 +163,10 @@ DefaultTargetHttpsProxiesRestStub::AsyncInsertTargetHttpsProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.target_https_proxy_resource(), @@ -157,8 +175,7 @@ DefaultTargetHttpsProxiesRestStub::AsyncInsertTargetHttpsProxy( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "targetHttpsProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -177,14 +194,17 @@ DefaultTargetHttpsProxiesRestStub::InsertTargetHttpsProxy( Options const& options, google::cloud::cpp::compute::target_https_proxies::v1:: InsertTargetHttpsProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_https_proxy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "targetHttpsProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -193,6 +213,16 @@ DefaultTargetHttpsProxiesRestStub::ListTargetHttpsProxies( Options const& options, google::cloud::cpp::compute::target_https_proxies::v1:: ListTargetHttpsProxiesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::TargetHttpsProxyList>( *service_, rest_context, request, false, @@ -200,13 +230,7 @@ DefaultTargetHttpsProxiesRestStub::ListTargetHttpsProxies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "targetHttpsProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -221,6 +245,10 @@ DefaultTargetHttpsProxiesRestStub::AsyncPatchTargetHttpsProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.target_https_proxy_resource(), @@ -230,8 +258,7 @@ DefaultTargetHttpsProxiesRestStub::AsyncPatchTargetHttpsProxy( "/", "projects", "/", request.project(), "/", "global", "/", "targetHttpsProxies", "/", request.target_https_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -250,14 +277,17 @@ DefaultTargetHttpsProxiesRestStub::PatchTargetHttpsProxy( Options const& options, google::cloud::cpp::compute::target_https_proxies::v1:: PatchTargetHttpsProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.target_https_proxy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "targetHttpsProxies", "/", request.target_https_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -272,6 +302,10 @@ DefaultTargetHttpsProxiesRestStub::AsyncSetCertificateMap( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -283,8 +317,7 @@ DefaultTargetHttpsProxiesRestStub::AsyncSetCertificateMap( "/", "targetHttpsProxies", "/", request.target_https_proxy(), "/", "setCertificateMap"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -303,6 +336,10 @@ DefaultTargetHttpsProxiesRestStub::SetCertificateMap( Options const& options, google::cloud::cpp::compute::target_https_proxies::v1:: SetCertificateMapRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_https_proxies_set_certificate_map_request_resource(), @@ -312,8 +349,7 @@ DefaultTargetHttpsProxiesRestStub::SetCertificateMap( "projects", "/", request.project(), "/", "global", "/", "targetHttpsProxies", "/", request.target_https_proxy(), "/", "setCertificateMap"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -328,6 +364,10 @@ DefaultTargetHttpsProxiesRestStub::AsyncSetQuicOverride( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -340,8 +380,7 @@ DefaultTargetHttpsProxiesRestStub::AsyncSetQuicOverride( "global", "/", "targetHttpsProxies", "/", request.target_https_proxy(), "/", "setQuicOverride"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -360,6 +399,10 @@ DefaultTargetHttpsProxiesRestStub::SetQuicOverride( Options const& options, google::cloud::cpp::compute::target_https_proxies::v1:: SetQuicOverrideRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_https_proxies_set_quic_override_request_resource(), false, @@ -368,8 +411,7 @@ DefaultTargetHttpsProxiesRestStub::SetQuicOverride( "projects", "/", request.project(), "/", "global", "/", "targetHttpsProxies", "/", request.target_https_proxy(), "/", "setQuicOverride"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -384,6 +426,10 @@ DefaultTargetHttpsProxiesRestStub::AsyncSetSslCertificates( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -395,8 +441,7 @@ DefaultTargetHttpsProxiesRestStub::AsyncSetSslCertificates( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "targetHttpsProxies", "/", request.target_https_proxy(), "/", "setSslCertificates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -415,6 +460,10 @@ DefaultTargetHttpsProxiesRestStub::SetSslCertificates( Options const& options, google::cloud::cpp::compute::target_https_proxies::v1:: SetSslCertificatesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_https_proxies_set_ssl_certificates_request_resource(), @@ -424,8 +473,7 @@ DefaultTargetHttpsProxiesRestStub::SetSslCertificates( "projects", "/", request.project(), "/", "targetHttpsProxies", "/", request.target_https_proxy(), "/", "setSslCertificates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -440,6 +488,10 @@ DefaultTargetHttpsProxiesRestStub::AsyncSetSslPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -449,8 +501,7 @@ DefaultTargetHttpsProxiesRestStub::AsyncSetSslPolicy( "/", "projects", "/", request.project(), "/", "global", "/", "targetHttpsProxies", "/", request.target_https_proxy(), "/", "setSslPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -469,6 +520,10 @@ DefaultTargetHttpsProxiesRestStub::SetSslPolicy( Options const& options, google::cloud::cpp::compute::target_https_proxies::v1:: SetSslPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.ssl_policy_reference_resource(), false, absl::StrCat("/", "compute", "/", @@ -476,8 +531,7 @@ DefaultTargetHttpsProxiesRestStub::SetSslPolicy( "projects", "/", request.project(), "/", "global", "/", "targetHttpsProxies", "/", request.target_https_proxy(), "/", "setSslPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -492,6 +546,10 @@ DefaultTargetHttpsProxiesRestStub::AsyncSetUrlMap( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.url_map_reference_resource(), @@ -501,8 +559,7 @@ DefaultTargetHttpsProxiesRestStub::AsyncSetUrlMap( "/", "projects", "/", request.project(), "/", "targetHttpsProxies", "/", request.target_https_proxy(), "/", "setUrlMap"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -521,6 +578,10 @@ DefaultTargetHttpsProxiesRestStub::SetUrlMap( Options const& options, google::cloud::cpp::compute::target_https_proxies::v1:: SetUrlMapRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.url_map_reference_resource(), false, absl::StrCat("/", "compute", "/", @@ -528,8 +589,7 @@ DefaultTargetHttpsProxiesRestStub::SetUrlMap( "projects", "/", request.project(), "/", "targetHttpsProxies", "/", request.target_https_proxy(), "/", "setUrlMap"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.cc b/google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.cc index 4d48ed04634d3..b808595e175d8 100644 --- a/google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.cc +++ b/google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.cc @@ -51,6 +51,20 @@ DefaultTargetInstancesRestStub::AggregatedListTargetInstances( Options const& options, google::cloud::cpp::compute::target_instances::v1:: AggregatedListTargetInstancesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::TargetInstanceAggregatedList>( *service_, rest_context, request, false, @@ -58,17 +72,7 @@ DefaultTargetInstancesRestStub::AggregatedListTargetInstances( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "targetInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -83,6 +87,10 @@ DefaultTargetInstancesRestStub::AsyncDeleteTargetInstance( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -91,8 +99,7 @@ DefaultTargetInstancesRestStub::AsyncDeleteTargetInstance( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "targetInstances", "/", request.target_instance()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -111,6 +118,10 @@ DefaultTargetInstancesRestStub::DeleteTargetInstance( Options const& options, google::cloud::cpp::compute::target_instances::v1:: DeleteTargetInstanceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -118,8 +129,7 @@ DefaultTargetInstancesRestStub::DeleteTargetInstance( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "targetInstances", "/", request.target_instance()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -128,13 +138,17 @@ DefaultTargetInstancesRestStub::GetTargetInstance( Options const& options, google::cloud::cpp::compute::target_instances::v1:: GetTargetInstanceRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "targetInstances", "/", - request.target_instance())); + request.target_instance()), + std::move(query_params)); } future> @@ -149,6 +163,10 @@ DefaultTargetInstancesRestStub::AsyncInsertTargetInstance( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.target_instance_resource(), @@ -158,8 +176,7 @@ DefaultTargetInstancesRestStub::AsyncInsertTargetInstance( "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "targetInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -178,14 +195,17 @@ DefaultTargetInstancesRestStub::InsertTargetInstance( Options const& options, google::cloud::cpp::compute::target_instances::v1:: InsertTargetInstanceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_instance_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "targetInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -194,6 +214,16 @@ DefaultTargetInstancesRestStub::ListTargetInstances( Options const& options, google::cloud::cpp::compute::target_instances::v1:: ListTargetInstancesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::TargetInstanceList>( *service_, rest_context, request, false, @@ -201,13 +231,7 @@ DefaultTargetInstancesRestStub::ListTargetInstances( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "targetInstances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -222,6 +246,10 @@ DefaultTargetInstancesRestStub::AsyncSetSecurityPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -232,8 +260,7 @@ DefaultTargetInstancesRestStub::AsyncSetSecurityPolicy( "zones", "/", request.zone(), "/", "targetInstances", "/", request.target_instance(), "/", "setSecurityPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -252,6 +279,10 @@ DefaultTargetInstancesRestStub::SetSecurityPolicy( Options const& options, google::cloud::cpp::compute::target_instances::v1:: SetSecurityPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.security_policy_reference_resource(), false, @@ -260,8 +291,7 @@ DefaultTargetInstancesRestStub::SetSecurityPolicy( "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "targetInstances", "/", request.target_instance(), "/", "setSecurityPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.cc b/google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.cc index 7ab17d54ad495..dd3ace50e3dad 100644 --- a/google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.cc +++ b/google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.cc @@ -57,6 +57,10 @@ DefaultTargetPoolsRestStub::AsyncAddHealthCheck( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -67,8 +71,7 @@ DefaultTargetPoolsRestStub::AsyncAddHealthCheck( "regions", "/", request.region(), "/", "targetPools", "/", request.target_pool(), "/", "addHealthCheck"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -87,6 +90,10 @@ DefaultTargetPoolsRestStub::AddHealthCheck( Options const& options, google::cloud::cpp::compute::target_pools::v1::AddHealthCheckRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_pools_add_health_check_request_resource(), false, @@ -95,8 +102,7 @@ DefaultTargetPoolsRestStub::AddHealthCheck( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetPools", "/", request.target_pool(), "/", "addHealthCheck"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -111,6 +117,10 @@ DefaultTargetPoolsRestStub::AsyncAddInstance( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -121,8 +131,7 @@ DefaultTargetPoolsRestStub::AsyncAddInstance( "regions", "/", request.region(), "/", "targetPools", "/", request.target_pool(), "/", "addInstance"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -141,6 +150,10 @@ DefaultTargetPoolsRestStub::AddInstance( Options const& options, google::cloud::cpp::compute::target_pools::v1::AddInstanceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_pools_add_instance_request_resource(), false, @@ -149,8 +162,7 @@ DefaultTargetPoolsRestStub::AddInstance( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetPools", "/", request.target_pool(), "/", "addInstance"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -159,6 +171,20 @@ DefaultTargetPoolsRestStub::AggregatedListTargetPools( Options const& options, google::cloud::cpp::compute::target_pools::v1:: AggregatedListTargetPoolsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::TargetPoolAggregatedList>( *service_, rest_context, request, false, @@ -166,17 +192,7 @@ DefaultTargetPoolsRestStub::AggregatedListTargetPools( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "targetPools"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -191,6 +207,10 @@ DefaultTargetPoolsRestStub::AsyncDeleteTargetPool( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -199,8 +219,7 @@ DefaultTargetPoolsRestStub::AsyncDeleteTargetPool( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetPools", "/", request.target_pool()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -219,6 +238,10 @@ DefaultTargetPoolsRestStub::DeleteTargetPool( Options const& options, google::cloud::cpp::compute::target_pools::v1:: DeleteTargetPoolRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -226,8 +249,7 @@ DefaultTargetPoolsRestStub::DeleteTargetPool( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetPools", "/", request.target_pool()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -236,13 +258,17 @@ DefaultTargetPoolsRestStub::GetTargetPool( Options const& options, google::cloud::cpp::compute::target_pools::v1::GetTargetPoolRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetPools", "/", - request.target_pool())); + request.target_pool()), + std::move(query_params)); } StatusOr @@ -251,6 +277,9 @@ DefaultTargetPoolsRestStub::GetHealth( Options const& options, google::cloud::cpp::compute::target_pools::v1::GetHealthRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TargetPoolInstanceHealth>( *service_, rest_context, request.instance_reference_resource(), false, @@ -258,7 +287,8 @@ DefaultTargetPoolsRestStub::GetHealth( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetPools", "/", - request.target_pool(), "/", "getHealth")); + request.target_pool(), "/", "getHealth"), + std::move(query_params)); } future> @@ -273,6 +303,10 @@ DefaultTargetPoolsRestStub::AsyncInsertTargetPool( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.target_pool_resource(), false, @@ -281,8 +315,7 @@ DefaultTargetPoolsRestStub::AsyncInsertTargetPool( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetPools"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -301,14 +334,17 @@ DefaultTargetPoolsRestStub::InsertTargetPool( Options const& options, google::cloud::cpp::compute::target_pools::v1:: InsertTargetPoolRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_pool_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetPools"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -317,19 +353,23 @@ DefaultTargetPoolsRestStub::ListTargetPools( Options const& options, google::cloud::cpp::compute::target_pools::v1::ListTargetPoolsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetPools"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -344,6 +384,10 @@ DefaultTargetPoolsRestStub::AsyncRemoveHealthCheck( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -355,8 +399,7 @@ DefaultTargetPoolsRestStub::AsyncRemoveHealthCheck( "regions", "/", request.region(), "/", "targetPools", "/", request.target_pool(), "/", "removeHealthCheck"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -375,6 +418,10 @@ DefaultTargetPoolsRestStub::RemoveHealthCheck( Options const& options, google::cloud::cpp::compute::target_pools::v1:: RemoveHealthCheckRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_pools_remove_health_check_request_resource(), false, @@ -383,8 +430,7 @@ DefaultTargetPoolsRestStub::RemoveHealthCheck( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetPools", "/", request.target_pool(), "/", "removeHealthCheck"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -399,6 +445,10 @@ DefaultTargetPoolsRestStub::AsyncRemoveInstance( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -409,8 +459,7 @@ DefaultTargetPoolsRestStub::AsyncRemoveInstance( "regions", "/", request.region(), "/", "targetPools", "/", request.target_pool(), "/", "removeInstance"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -429,6 +478,10 @@ DefaultTargetPoolsRestStub::RemoveInstance( Options const& options, google::cloud::cpp::compute::target_pools::v1::RemoveInstanceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_pools_remove_instance_request_resource(), false, @@ -437,8 +490,7 @@ DefaultTargetPoolsRestStub::RemoveInstance( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetPools", "/", request.target_pool(), "/", "removeInstance"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -453,6 +505,12 @@ DefaultTargetPoolsRestStub::AsyncSetBackup( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back( + {"failover_ratio", std::to_string(request.failover_ratio())}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.target_reference_resource(), @@ -463,10 +521,7 @@ DefaultTargetPoolsRestStub::AsyncSetBackup( "regions", "/", request.region(), "/", "targetPools", "/", request.target_pool(), "/", "setBackup"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("failover_ratio", - std::to_string(request.failover_ratio())), - std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -485,6 +540,12 @@ DefaultTargetPoolsRestStub::SetBackup( Options const& options, google::cloud::cpp::compute::target_pools::v1::SetBackupRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"failover_ratio", std::to_string(request.failover_ratio())}); + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_reference_resource(), false, absl::StrCat("/", "compute", "/", @@ -492,10 +553,7 @@ DefaultTargetPoolsRestStub::SetBackup( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetPools", "/", request.target_pool(), "/", "setBackup"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("failover_ratio", - std::to_string(request.failover_ratio())), - std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -510,6 +568,10 @@ DefaultTargetPoolsRestStub::AsyncSetSecurityPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -520,8 +582,7 @@ DefaultTargetPoolsRestStub::AsyncSetSecurityPolicy( "regions", "/", request.region(), "/", "targetPools", "/", request.target_pool(), "/", "setSecurityPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -540,6 +601,10 @@ DefaultTargetPoolsRestStub::SetSecurityPolicy( Options const& options, google::cloud::cpp::compute::target_pools::v1:: SetSecurityPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.security_policy_reference_resource(), false, @@ -548,8 +613,7 @@ DefaultTargetPoolsRestStub::SetSecurityPolicy( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetPools", "/", request.target_pool(), "/", "setSecurityPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.cc b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.cc index ad02e55c77431..d0f88dd0e89f3 100644 --- a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.cc +++ b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.cc @@ -58,6 +58,10 @@ DefaultTargetSslProxiesRestStub::AsyncDeleteTargetSslProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -66,8 +70,7 @@ DefaultTargetSslProxiesRestStub::AsyncDeleteTargetSslProxy( "/", "projects", "/", request.project(), "/", "global", "/", "targetSslProxies", "/", request.target_ssl_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -86,14 +89,17 @@ DefaultTargetSslProxiesRestStub::DeleteTargetSslProxy( Options const& options, google::cloud::cpp::compute::target_ssl_proxies::v1:: DeleteTargetSslProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "targetSslProxies", "/", request.target_ssl_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -102,12 +108,16 @@ DefaultTargetSslProxiesRestStub::GetTargetSslProxy( Options const& options, google::cloud::cpp::compute::target_ssl_proxies::v1:: GetTargetSslProxyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "targetSslProxies", "/", request.target_ssl_proxy())); + "targetSslProxies", "/", request.target_ssl_proxy()), + std::move(query_params)); } future> @@ -122,6 +132,10 @@ DefaultTargetSslProxiesRestStub::AsyncInsertTargetSslProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.target_ssl_proxy_resource(), @@ -130,8 +144,7 @@ DefaultTargetSslProxiesRestStub::AsyncInsertTargetSslProxy( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "targetSslProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -150,14 +163,17 @@ DefaultTargetSslProxiesRestStub::InsertTargetSslProxy( Options const& options, google::cloud::cpp::compute::target_ssl_proxies::v1:: InsertTargetSslProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_ssl_proxy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "targetSslProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -166,6 +182,16 @@ DefaultTargetSslProxiesRestStub::ListTargetSslProxies( Options const& options, google::cloud::cpp::compute::target_ssl_proxies::v1:: ListTargetSslProxiesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::TargetSslProxyList>( *service_, rest_context, request, false, @@ -173,13 +199,7 @@ DefaultTargetSslProxiesRestStub::ListTargetSslProxies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "targetSslProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -194,6 +214,10 @@ DefaultTargetSslProxiesRestStub::AsyncSetBackendService( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -206,8 +230,7 @@ DefaultTargetSslProxiesRestStub::AsyncSetBackendService( "global", "/", "targetSslProxies", "/", request.target_ssl_proxy(), "/", "setBackendService"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -226,6 +249,10 @@ DefaultTargetSslProxiesRestStub::SetBackendService( Options const& options, google::cloud::cpp::compute::target_ssl_proxies::v1:: SetBackendServiceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_ssl_proxies_set_backend_service_request_resource(), false, @@ -234,8 +261,7 @@ DefaultTargetSslProxiesRestStub::SetBackendService( "projects", "/", request.project(), "/", "global", "/", "targetSslProxies", "/", request.target_ssl_proxy(), "/", "setBackendService"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -250,6 +276,10 @@ DefaultTargetSslProxiesRestStub::AsyncSetCertificateMap( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -262,8 +292,7 @@ DefaultTargetSslProxiesRestStub::AsyncSetCertificateMap( "global", "/", "targetSslProxies", "/", request.target_ssl_proxy(), "/", "setCertificateMap"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -282,6 +311,10 @@ DefaultTargetSslProxiesRestStub::SetCertificateMap( Options const& options, google::cloud::cpp::compute::target_ssl_proxies::v1:: SetCertificateMapRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_ssl_proxies_set_certificate_map_request_resource(), false, @@ -290,8 +323,7 @@ DefaultTargetSslProxiesRestStub::SetCertificateMap( "projects", "/", request.project(), "/", "global", "/", "targetSslProxies", "/", request.target_ssl_proxy(), "/", "setCertificateMap"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -306,6 +338,10 @@ DefaultTargetSslProxiesRestStub::AsyncSetProxyHeader( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -316,8 +352,7 @@ DefaultTargetSslProxiesRestStub::AsyncSetProxyHeader( "/", "projects", "/", request.project(), "/", "global", "/", "targetSslProxies", "/", request.target_ssl_proxy(), "/", "setProxyHeader"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -336,6 +371,10 @@ DefaultTargetSslProxiesRestStub::SetProxyHeader( Options const& options, google::cloud::cpp::compute::target_ssl_proxies::v1:: SetProxyHeaderRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_ssl_proxies_set_proxy_header_request_resource(), false, @@ -344,8 +383,7 @@ DefaultTargetSslProxiesRestStub::SetProxyHeader( "projects", "/", request.project(), "/", "global", "/", "targetSslProxies", "/", request.target_ssl_proxy(), "/", "setProxyHeader"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -360,6 +398,10 @@ DefaultTargetSslProxiesRestStub::AsyncSetSslCertificates( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -372,8 +414,7 @@ DefaultTargetSslProxiesRestStub::AsyncSetSslCertificates( "global", "/", "targetSslProxies", "/", request.target_ssl_proxy(), "/", "setSslCertificates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -392,6 +433,10 @@ DefaultTargetSslProxiesRestStub::SetSslCertificates( Options const& options, google::cloud::cpp::compute::target_ssl_proxies::v1:: SetSslCertificatesRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_ssl_proxies_set_ssl_certificates_request_resource(), false, @@ -400,8 +445,7 @@ DefaultTargetSslProxiesRestStub::SetSslCertificates( "projects", "/", request.project(), "/", "global", "/", "targetSslProxies", "/", request.target_ssl_proxy(), "/", "setSslCertificates"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -416,6 +460,10 @@ DefaultTargetSslProxiesRestStub::AsyncSetSslPolicy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -425,8 +473,7 @@ DefaultTargetSslProxiesRestStub::AsyncSetSslPolicy( "/", "projects", "/", request.project(), "/", "global", "/", "targetSslProxies", "/", request.target_ssl_proxy(), "/", "setSslPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -445,6 +492,10 @@ DefaultTargetSslProxiesRestStub::SetSslPolicy( Options const& options, google::cloud::cpp::compute::target_ssl_proxies::v1:: SetSslPolicyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.ssl_policy_reference_resource(), false, absl::StrCat("/", "compute", "/", @@ -452,8 +503,7 @@ DefaultTargetSslProxiesRestStub::SetSslPolicy( "projects", "/", request.project(), "/", "global", "/", "targetSslProxies", "/", request.target_ssl_proxy(), "/", "setSslPolicy"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.cc b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.cc index 204d76b3dd472..8e5d81d6d53a3 100644 --- a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.cc +++ b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.cc @@ -52,6 +52,20 @@ DefaultTargetTcpProxiesRestStub::AggregatedListTargetTcpProxies( Options const& options, google::cloud::cpp::compute::target_tcp_proxies::v1:: AggregatedListTargetTcpProxiesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::TargetTcpProxyAggregatedList>( *service_, rest_context, request, false, @@ -59,17 +73,7 @@ DefaultTargetTcpProxiesRestStub::AggregatedListTargetTcpProxies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "targetTcpProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -84,6 +88,10 @@ DefaultTargetTcpProxiesRestStub::AsyncDeleteTargetTcpProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -92,8 +100,7 @@ DefaultTargetTcpProxiesRestStub::AsyncDeleteTargetTcpProxy( "/", "projects", "/", request.project(), "/", "global", "/", "targetTcpProxies", "/", request.target_tcp_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -112,14 +119,17 @@ DefaultTargetTcpProxiesRestStub::DeleteTargetTcpProxy( Options const& options, google::cloud::cpp::compute::target_tcp_proxies::v1:: DeleteTargetTcpProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "targetTcpProxies", "/", request.target_tcp_proxy()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -128,12 +138,16 @@ DefaultTargetTcpProxiesRestStub::GetTargetTcpProxy( Options const& options, google::cloud::cpp::compute::target_tcp_proxies::v1:: GetTargetTcpProxyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "targetTcpProxies", "/", request.target_tcp_proxy())); + "targetTcpProxies", "/", request.target_tcp_proxy()), + std::move(query_params)); } future> @@ -148,6 +162,10 @@ DefaultTargetTcpProxiesRestStub::AsyncInsertTargetTcpProxy( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.target_tcp_proxy_resource(), @@ -156,8 +174,7 @@ DefaultTargetTcpProxiesRestStub::AsyncInsertTargetTcpProxy( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "targetTcpProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -176,14 +193,17 @@ DefaultTargetTcpProxiesRestStub::InsertTargetTcpProxy( Options const& options, google::cloud::cpp::compute::target_tcp_proxies::v1:: InsertTargetTcpProxyRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_tcp_proxy_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "targetTcpProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -192,6 +212,16 @@ DefaultTargetTcpProxiesRestStub::ListTargetTcpProxies( Options const& options, google::cloud::cpp::compute::target_tcp_proxies::v1:: ListTargetTcpProxiesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::TargetTcpProxyList>( *service_, rest_context, request, false, @@ -199,13 +229,7 @@ DefaultTargetTcpProxiesRestStub::ListTargetTcpProxies( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "targetTcpProxies"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -220,6 +244,10 @@ DefaultTargetTcpProxiesRestStub::AsyncSetBackendService( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -232,8 +260,7 @@ DefaultTargetTcpProxiesRestStub::AsyncSetBackendService( "global", "/", "targetTcpProxies", "/", request.target_tcp_proxy(), "/", "setBackendService"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -252,6 +279,10 @@ DefaultTargetTcpProxiesRestStub::SetBackendService( Options const& options, google::cloud::cpp::compute::target_tcp_proxies::v1:: SetBackendServiceRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_tcp_proxies_set_backend_service_request_resource(), false, @@ -260,8 +291,7 @@ DefaultTargetTcpProxiesRestStub::SetBackendService( "projects", "/", request.project(), "/", "global", "/", "targetTcpProxies", "/", request.target_tcp_proxy(), "/", "setBackendService"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -276,6 +306,10 @@ DefaultTargetTcpProxiesRestStub::AsyncSetProxyHeader( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -286,8 +320,7 @@ DefaultTargetTcpProxiesRestStub::AsyncSetProxyHeader( "/", "projects", "/", request.project(), "/", "global", "/", "targetTcpProxies", "/", request.target_tcp_proxy(), "/", "setProxyHeader"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -306,6 +339,10 @@ DefaultTargetTcpProxiesRestStub::SetProxyHeader( Options const& options, google::cloud::cpp::compute::target_tcp_proxies::v1:: SetProxyHeaderRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_tcp_proxies_set_proxy_header_request_resource(), false, @@ -314,8 +351,7 @@ DefaultTargetTcpProxiesRestStub::SetProxyHeader( "projects", "/", request.project(), "/", "global", "/", "targetTcpProxies", "/", request.target_tcp_proxy(), "/", "setProxyHeader"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.cc b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.cc index 78f25951ea01c..fca0c7ba5fc47 100644 --- a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.cc +++ b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.cc @@ -52,6 +52,20 @@ DefaultTargetVpnGatewaysRestStub::AggregatedListTargetVpnGateways( Options const& options, google::cloud::cpp::compute::target_vpn_gateways::v1:: AggregatedListTargetVpnGatewaysRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::TargetVpnGatewayAggregatedList>( *service_, rest_context, request, false, @@ -59,17 +73,7 @@ DefaultTargetVpnGatewaysRestStub::AggregatedListTargetVpnGateways( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "targetVpnGateways"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -84,6 +88,10 @@ DefaultTargetVpnGatewaysRestStub::AsyncDeleteTargetVpnGateway( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -93,8 +101,7 @@ DefaultTargetVpnGatewaysRestStub::AsyncDeleteTargetVpnGateway( "regions", "/", request.region(), "/", "targetVpnGateways", "/", request.target_vpn_gateway()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -113,6 +120,10 @@ DefaultTargetVpnGatewaysRestStub::DeleteTargetVpnGateway( Options const& options, google::cloud::cpp::compute::target_vpn_gateways::v1:: DeleteTargetVpnGatewayRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -120,8 +131,7 @@ DefaultTargetVpnGatewaysRestStub::DeleteTargetVpnGateway( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetVpnGateways", "/", request.target_vpn_gateway()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -130,13 +140,17 @@ DefaultTargetVpnGatewaysRestStub::GetTargetVpnGateway( Options const& options, google::cloud::cpp::compute::target_vpn_gateways::v1:: GetTargetVpnGatewayRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetVpnGateways", "/", - request.target_vpn_gateway())); + request.target_vpn_gateway()), + std::move(query_params)); } future> @@ -151,6 +165,10 @@ DefaultTargetVpnGatewaysRestStub::AsyncInsertTargetVpnGateway( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.target_vpn_gateway_resource(), @@ -160,8 +178,7 @@ DefaultTargetVpnGatewaysRestStub::AsyncInsertTargetVpnGateway( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetVpnGateways"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -180,14 +197,17 @@ DefaultTargetVpnGatewaysRestStub::InsertTargetVpnGateway( Options const& options, google::cloud::cpp::compute::target_vpn_gateways::v1:: InsertTargetVpnGatewayRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.target_vpn_gateway_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetVpnGateways"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -196,6 +216,16 @@ DefaultTargetVpnGatewaysRestStub::ListTargetVpnGateways( Options const& options, google::cloud::cpp::compute::target_vpn_gateways::v1:: ListTargetVpnGatewaysRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::TargetVpnGatewayList>( *service_, rest_context, request, false, @@ -203,13 +233,7 @@ DefaultTargetVpnGatewaysRestStub::ListTargetVpnGateways( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetVpnGateways"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -224,6 +248,10 @@ DefaultTargetVpnGatewaysRestStub::AsyncSetLabels( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -234,8 +262,7 @@ DefaultTargetVpnGatewaysRestStub::AsyncSetLabels( "regions", "/", request.region(), "/", "targetVpnGateways", "/", request.resource(), "/", "setLabels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -254,6 +281,10 @@ DefaultTargetVpnGatewaysRestStub::SetLabels( Options const& options, google::cloud::cpp::compute::target_vpn_gateways::v1:: SetLabelsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_labels_request_resource(), false, @@ -262,8 +293,7 @@ DefaultTargetVpnGatewaysRestStub::SetLabels( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "targetVpnGateways", "/", request.resource(), "/", "setLabels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.cc b/google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.cc index c39efbad4a1d2..6daf7de309734 100644 --- a/google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.cc +++ b/google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.cc @@ -51,6 +51,20 @@ DefaultUrlMapsRestStub::AggregatedListUrlMaps( Options const& options, google::cloud::cpp::compute::url_maps::v1:: AggregatedListUrlMapsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::UrlMapsAggregatedList>( *service_, rest_context, request, false, @@ -58,17 +72,7 @@ DefaultUrlMapsRestStub::AggregatedListUrlMaps( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "urlMaps"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -83,6 +87,10 @@ DefaultUrlMapsRestStub::AsyncDeleteUrlMap( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -90,8 +98,7 @@ DefaultUrlMapsRestStub::AsyncDeleteUrlMap( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "urlMaps", "/", request.url_map()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -110,14 +117,17 @@ DefaultUrlMapsRestStub::DeleteUrlMap( Options const& options, google::cloud::cpp::compute::url_maps::v1::DeleteUrlMapRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "urlMaps", "/", request.url_map()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -126,12 +136,16 @@ DefaultUrlMapsRestStub::GetUrlMap( Options const& options, google::cloud::cpp::compute::url_maps::v1::GetUrlMapRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "urlMaps", "/", request.url_map())); + "urlMaps", "/", request.url_map()), + std::move(query_params)); } future> @@ -146,6 +160,10 @@ DefaultUrlMapsRestStub::AsyncInsertUrlMap( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.url_map_resource(), false, @@ -153,8 +171,7 @@ DefaultUrlMapsRestStub::AsyncInsertUrlMap( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "urlMaps"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -173,14 +190,17 @@ DefaultUrlMapsRestStub::InsertUrlMap( Options const& options, google::cloud::cpp::compute::url_maps::v1::InsertUrlMapRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.url_map_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "urlMaps"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -195,6 +215,10 @@ DefaultUrlMapsRestStub::AsyncInvalidateCache( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -204,8 +228,7 @@ DefaultUrlMapsRestStub::AsyncInvalidateCache( "/", "projects", "/", request.project(), "/", "global", "/", "urlMaps", "/", request.url_map(), "/", "invalidateCache"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -224,6 +247,10 @@ DefaultUrlMapsRestStub::InvalidateCache( Options const& options, google::cloud::cpp::compute::url_maps::v1::InvalidateCacheRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.cache_invalidation_rule_resource(), false, @@ -231,8 +258,7 @@ DefaultUrlMapsRestStub::InvalidateCache( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "urlMaps", "/", request.url_map(), "/", "invalidateCache"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -241,19 +267,23 @@ DefaultUrlMapsRestStub::ListUrlMaps( Options const& options, google::cloud::cpp::compute::url_maps::v1::ListUrlMapsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "urlMaps"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -268,6 +298,10 @@ DefaultUrlMapsRestStub::AsyncPatchUrlMap( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Patch( *service, *rest_context, request.url_map_resource(), false, @@ -275,8 +309,7 @@ DefaultUrlMapsRestStub::AsyncPatchUrlMap( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "urlMaps", "/", request.url_map()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -295,14 +328,17 @@ DefaultUrlMapsRestStub::PatchUrlMap( Options const& options, google::cloud::cpp::compute::url_maps::v1::PatchUrlMapRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.url_map_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "urlMaps", "/", request.url_map()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> @@ -317,6 +353,10 @@ DefaultUrlMapsRestStub::AsyncUpdateUrlMap( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Put( *service, *rest_context, request.url_map_resource(), false, @@ -324,8 +364,7 @@ DefaultUrlMapsRestStub::AsyncUpdateUrlMap( rest_internal::DetermineApiVersion("v1", *options), "/", "projects", "/", request.project(), "/", "global", "/", "urlMaps", "/", request.url_map()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -344,14 +383,17 @@ DefaultUrlMapsRestStub::UpdateUrlMap( Options const& options, google::cloud::cpp::compute::url_maps::v1::UpdateUrlMapRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.url_map_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", "urlMaps", "/", request.url_map()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -359,6 +401,9 @@ DefaultUrlMapsRestStub::Validate( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::url_maps::v1::ValidateRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::UrlMapsValidateResponse>( *service_, rest_context, request.url_maps_validate_request_resource(), @@ -366,7 +411,8 @@ DefaultUrlMapsRestStub::Validate( absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "global", "/", - "urlMaps", "/", request.url_map(), "/", "validate")); + "urlMaps", "/", request.url_map(), "/", "validate"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.cc b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.cc index 9151385149676..daadd17a7c8ac 100644 --- a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.cc +++ b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.cc @@ -51,6 +51,20 @@ DefaultVpnGatewaysRestStub::AggregatedListVpnGateways( Options const& options, google::cloud::cpp::compute::vpn_gateways::v1:: AggregatedListVpnGatewaysRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::VpnGatewayAggregatedList>( *service_, rest_context, request, false, @@ -58,17 +72,7 @@ DefaultVpnGatewaysRestStub::AggregatedListVpnGateways( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "vpnGateways"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -83,6 +87,10 @@ DefaultVpnGatewaysRestStub::AsyncDeleteVpnGateway( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -91,8 +99,7 @@ DefaultVpnGatewaysRestStub::AsyncDeleteVpnGateway( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "vpnGateways", "/", request.vpn_gateway()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -111,6 +118,10 @@ DefaultVpnGatewaysRestStub::DeleteVpnGateway( Options const& options, google::cloud::cpp::compute::vpn_gateways::v1:: DeleteVpnGatewayRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -118,8 +129,7 @@ DefaultVpnGatewaysRestStub::DeleteVpnGateway( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "vpnGateways", "/", request.vpn_gateway()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -128,13 +138,17 @@ DefaultVpnGatewaysRestStub::GetVpnGateway( Options const& options, google::cloud::cpp::compute::vpn_gateways::v1::GetVpnGatewayRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "vpnGateways", "/", - request.vpn_gateway())); + request.vpn_gateway()), + std::move(query_params)); } StatusOr @@ -143,6 +157,9 @@ DefaultVpnGatewaysRestStub::GetStatus( Options const& options, google::cloud::cpp::compute::vpn_gateways::v1::GetStatusRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::VpnGatewaysGetStatusResponse>( *service_, rest_context, request, false, @@ -150,7 +167,8 @@ DefaultVpnGatewaysRestStub::GetStatus( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "vpnGateways", "/", - request.vpn_gateway(), "/", "getStatus")); + request.vpn_gateway(), "/", "getStatus"), + std::move(query_params)); } future> @@ -165,6 +183,10 @@ DefaultVpnGatewaysRestStub::AsyncInsertVpnGateway( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.vpn_gateway_resource(), false, @@ -173,8 +195,7 @@ DefaultVpnGatewaysRestStub::AsyncInsertVpnGateway( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "vpnGateways"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -193,14 +214,17 @@ DefaultVpnGatewaysRestStub::InsertVpnGateway( Options const& options, google::cloud::cpp::compute::vpn_gateways::v1:: InsertVpnGatewayRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.vpn_gateway_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "vpnGateways"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -209,19 +233,23 @@ DefaultVpnGatewaysRestStub::ListVpnGateways( Options const& options, google::cloud::cpp::compute::vpn_gateways::v1::ListVpnGatewaysRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "vpnGateways"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -236,6 +264,10 @@ DefaultVpnGatewaysRestStub::AsyncSetLabels( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -246,8 +278,7 @@ DefaultVpnGatewaysRestStub::AsyncSetLabels( "regions", "/", request.region(), "/", "vpnGateways", "/", request.resource(), "/", "setLabels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -266,6 +297,10 @@ DefaultVpnGatewaysRestStub::SetLabels( Options const& options, google::cloud::cpp::compute::vpn_gateways::v1::SetLabelsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_labels_request_resource(), false, @@ -274,8 +309,7 @@ DefaultVpnGatewaysRestStub::SetLabels( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "vpnGateways", "/", request.resource(), "/", "setLabels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -284,6 +318,9 @@ DefaultVpnGatewaysRestStub::TestIamPermissions( Options const& options, google::cloud::cpp::compute::vpn_gateways::v1:: TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), @@ -292,7 +329,8 @@ DefaultVpnGatewaysRestStub::TestIamPermissions( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "vpnGateways", "/", - request.resource(), "/", "testIamPermissions")); + request.resource(), "/", "testIamPermissions"), + std::move(query_params)); } future> diff --git a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.cc b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.cc index fe8b44f36bea3..2f5beb8956faf 100644 --- a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.cc +++ b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.cc @@ -51,6 +51,20 @@ DefaultVpnTunnelsRestStub::AggregatedListVpnTunnels( Options const& options, google::cloud::cpp::compute::vpn_tunnels::v1:: AggregatedListVpnTunnelsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"include_all_scopes", (request.include_all_scopes() ? "1" : "0")}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params.push_back( + {"service_project_number", request.service_project_number()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::VpnTunnelAggregatedList>( *service_, rest_context, request, false, @@ -58,17 +72,7 @@ DefaultVpnTunnelsRestStub::AggregatedListVpnTunnels( rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "aggregated", "/", "vpnTunnels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("include_all_scopes", - (request.include_all_scopes() ? "1" : "0")), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0")), - std::make_pair("service_project_number", - request.service_project_number())})); + std::move(query_params)); } future> @@ -83,6 +87,10 @@ DefaultVpnTunnelsRestStub::AsyncDeleteVpnTunnel( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Delete( *service, *rest_context, request, false, @@ -91,8 +99,7 @@ DefaultVpnTunnelsRestStub::AsyncDeleteVpnTunnel( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "vpnTunnels", "/", request.vpn_tunnel()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -111,6 +118,10 @@ DefaultVpnTunnelsRestStub::DeleteVpnTunnel( Options const& options, google::cloud::cpp::compute::vpn_tunnels::v1::DeleteVpnTunnelRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -118,8 +129,7 @@ DefaultVpnTunnelsRestStub::DeleteVpnTunnel( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "vpnTunnels", "/", request.vpn_tunnel()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -128,13 +138,17 @@ DefaultVpnTunnelsRestStub::GetVpnTunnel( Options const& options, google::cloud::cpp::compute::vpn_tunnels::v1::GetVpnTunnelRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "vpnTunnels", "/", - request.vpn_tunnel())); + request.vpn_tunnel()), + std::move(query_params)); } future> @@ -149,6 +163,10 @@ DefaultVpnTunnelsRestStub::AsyncInsertVpnTunnel( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request.vpn_tunnel_resource(), false, @@ -157,8 +175,7 @@ DefaultVpnTunnelsRestStub::AsyncInsertVpnTunnel( "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "vpnTunnels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -177,14 +194,17 @@ DefaultVpnTunnelsRestStub::InsertVpnTunnel( Options const& options, google::cloud::cpp::compute::vpn_tunnels::v1::InsertVpnTunnelRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.vpn_tunnel_resource(), false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "vpnTunnels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } StatusOr @@ -193,19 +213,23 @@ DefaultVpnTunnelsRestStub::ListVpnTunnels( Options const& options, google::cloud::cpp::compute::vpn_tunnels::v1::ListVpnTunnelsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "vpnTunnels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } future> @@ -220,6 +244,10 @@ DefaultVpnTunnelsRestStub::AsyncSetLabels( p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -230,8 +258,7 @@ DefaultVpnTunnelsRestStub::AsyncSetLabels( "regions", "/", request.region(), "/", "vpnTunnels", "/", request.resource(), "/", "setLabels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -250,6 +277,10 @@ DefaultVpnTunnelsRestStub::SetLabels( Options const& options, google::cloud::cpp::compute::vpn_tunnels::v1::SetLabelsRequest const& request) { + std::vector> query_params; + query_params.push_back({"request_id", request.request_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_labels_request_resource(), false, @@ -258,8 +289,7 @@ DefaultVpnTunnelsRestStub::SetLabels( "projects", "/", request.project(), "/", "regions", "/", request.region(), "/", "vpnTunnels", "/", request.resource(), "/", "setLabels"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("request_id", request.request_id())})); + std::move(query_params)); } future> diff --git a/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.cc b/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.cc index 202876cc61514..9e989383cea0e 100644 --- a/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.cc +++ b/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.cc @@ -44,13 +44,16 @@ Status DefaultZoneOperationsRestStub::DeleteOperation( Options const& options, google::cloud::cpp::compute::zone_operations::v1:: DeleteOperationRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", - request.zone(), "/", "operations", "/", - request.operation())); + request.zone(), "/", "operations", "/", request.operation()), + std::move(query_params)); } StatusOr @@ -59,13 +62,16 @@ DefaultZoneOperationsRestStub::GetOperation( Options const& options, google::cloud::cpp::compute::zone_operations::v1::GetOperationRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", - request.zone(), "/", "operations", "/", - request.operation())); + request.zone(), "/", "operations", "/", request.operation()), + std::move(query_params)); } StatusOr @@ -74,19 +80,23 @@ DefaultZoneOperationsRestStub::ListZoneOperations( Options const& options, google::cloud::cpp::compute::zone_operations::v1:: ListZoneOperationsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "operations"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -95,13 +105,17 @@ DefaultZoneOperationsRestStub::Wait( Options const& options, google::cloud::cpp::compute::zone_operations::v1::WaitRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", request.zone(), "/", "operations", "/", request.operation(), - "/", "wait")); + "/", "wait"), + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/compute/zones/v1/internal/zones_rest_stub.cc b/google/cloud/compute/zones/v1/internal/zones_rest_stub.cc index 3d8425c634558..54bfe64a96c2b 100644 --- a/google/cloud/compute/zones/v1/internal/zones_rest_stub.cc +++ b/google/cloud/compute/zones/v1/internal/zones_rest_stub.cc @@ -43,12 +43,16 @@ StatusOr DefaultZonesRestStub::GetZone( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::zones::v1::GetZoneRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones", "/", - request.zone())); + request.zone()), + std::move(query_params)); } StatusOr @@ -56,18 +60,22 @@ DefaultZonesRestStub::ListZones( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::cpp::compute::zones::v1::ListZonesRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"order_by", request.order_by()}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"return_partial_success", + (request.return_partial_success() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "zones"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("order_by", request.order_by()), - std::make_pair("page_token", request.page_token()), - std::make_pair("return_partial_success", - (request.return_partial_success() ? "1" : "0"))})); + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/spanner/admin/internal/database_admin_rest_stub.cc b/google/cloud/spanner/admin/internal/database_admin_rest_stub.cc index 9ef0e938e8fec..e1f84c25d45cb 100644 --- a/google/cloud/spanner/admin/internal/database_admin_rest_stub.cc +++ b/google/cloud/spanner/admin/internal/database_admin_rest_stub.cc @@ -50,14 +50,17 @@ DefaultDatabaseAdminRestStub::ListDatabases( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::spanner::admin::database::v1::ListDatabasesRequest const& request) { + std::vector> query_params; + query_params.push_back({"page_size", std::to_string(request.page_size())}); + query_params.push_back({"page_token", request.page_token()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::spanner::admin::database::v1::ListDatabasesResponse>( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "databases"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("page_size", std::to_string(request.page_size())), - std::make_pair("page_token", request.page_token())})); + std::move(query_params)); } future> @@ -71,11 +74,15 @@ DefaultDatabaseAdminRestStub::AsyncCreateDatabase( future> f = p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), - "/", request.parent(), "/", "databases"))); + "/", request.parent(), "/", "databases"), + std::move(query_params))); }, std::move(p), service_, @@ -94,10 +101,14 @@ DefaultDatabaseAdminRestStub::CreateDatabase( Options const& options, google::spanner::admin::database::v1::CreateDatabaseRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.parent(), "/", "databases")); + request.parent(), "/", "databases"), + std::move(query_params)); } StatusOr @@ -105,10 +116,14 @@ DefaultDatabaseAdminRestStub::GetDatabase( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::spanner::admin::database::v1::GetDatabaseRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.name())); + request.name()), + std::move(query_params)); } future> @@ -122,11 +137,15 @@ DefaultDatabaseAdminRestStub::AsyncUpdateDatabase( future> f = p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Patch( *service, *rest_context, request.database(), false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), - "/", request.database().name()))); + "/", request.database().name()), + std::move(query_params))); }, std::move(p), service_, @@ -145,10 +164,14 @@ DefaultDatabaseAdminRestStub::UpdateDatabase( Options const& options, google::spanner::admin::database::v1::UpdateDatabaseRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.database(), false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.database().name())); + request.database().name()), + std::move(query_params)); } future> @@ -162,11 +185,15 @@ DefaultDatabaseAdminRestStub::AsyncUpdateDatabaseDdl( future> f = p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Patch( *service, *rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), - "/", request.database(), "/", "ddl"))); + "/", request.database(), "/", "ddl"), + std::move(query_params))); }, std::move(p), service_, @@ -185,20 +212,28 @@ DefaultDatabaseAdminRestStub::UpdateDatabaseDdl( Options const& options, google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.database(), "/", "ddl")); + request.database(), "/", "ddl"), + std::move(query_params)); } Status DefaultDatabaseAdminRestStub::DropDatabase( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::spanner::admin::database::v1::DropDatabaseRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.database())); + request.database()), + std::move(query_params)); } StatusOr @@ -207,31 +242,43 @@ DefaultDatabaseAdminRestStub::GetDatabaseDdl( Options const& options, google::spanner::admin::database::v1::GetDatabaseDdlRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::spanner::admin::database::v1::GetDatabaseDdlResponse>( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.database(), "/", "ddl")); + request.database(), "/", "ddl"), + std::move(query_params)); } StatusOr DefaultDatabaseAdminRestStub::SetIamPolicy( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::iam::v1::SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.resource(), ":setIamPolicy")); + request.resource(), ":setIamPolicy"), + std::move(query_params)); } StatusOr DefaultDatabaseAdminRestStub::GetIamPolicy( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::iam::v1::GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.resource(), ":getIamPolicy")); + request.resource(), ":getIamPolicy"), + std::move(query_params)); } StatusOr @@ -239,10 +286,14 @@ DefaultDatabaseAdminRestStub::TestIamPermissions( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::iam::v1::TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.resource(), ":testIamPermissions")); + request.resource(), ":testIamPermissions"), + std::move(query_params)); } future> @@ -255,13 +306,16 @@ DefaultDatabaseAdminRestStub::AsyncCreateBackup( future> f = p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params.push_back({"backup_id", request.backup_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request.backup(), false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), "/", request.parent(), "/", "backups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("backup_id", request.backup_id())}))); + std::move(query_params))); }, std::move(p), service_, @@ -279,12 +333,15 @@ DefaultDatabaseAdminRestStub::CreateBackup( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::spanner::admin::database::v1::CreateBackupRequest const& request) { + std::vector> query_params; + query_params.push_back({"backup_id", request.backup_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.backup(), false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "backups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("backup_id", request.backup_id())})); + std::move(query_params)); } future> @@ -297,11 +354,15 @@ DefaultDatabaseAdminRestStub::AsyncCopyBackup( future> f = p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), - "/", request.parent(), "/", "backups", ":copy"))); + "/", request.parent(), "/", "backups", ":copy"), + std::move(query_params))); }, std::move(p), service_, @@ -319,10 +380,14 @@ DefaultDatabaseAdminRestStub::CopyBackup( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::spanner::admin::database::v1::CopyBackupRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.parent(), "/", "backups", ":copy")); + request.parent(), "/", "backups", ":copy"), + std::move(query_params)); } StatusOr @@ -330,10 +395,14 @@ DefaultDatabaseAdminRestStub::GetBackup( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::spanner::admin::database::v1::GetBackupRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.name())); + request.name()), + std::move(query_params)); } StatusOr @@ -341,20 +410,28 @@ DefaultDatabaseAdminRestStub::UpdateBackup( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::spanner::admin::database::v1::UpdateBackupRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.backup(), false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.backup().name())); + request.backup().name()), + std::move(query_params)); } Status DefaultDatabaseAdminRestStub::DeleteBackup( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::spanner::admin::database::v1::DeleteBackupRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.name())); + request.name()), + std::move(query_params)); } StatusOr @@ -362,15 +439,18 @@ DefaultDatabaseAdminRestStub::ListBackups( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::spanner::admin::database::v1::ListBackupsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back({"page_size", std::to_string(request.page_size())}); + query_params.push_back({"page_token", request.page_token()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::spanner::admin::database::v1::ListBackupsResponse>( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "backups"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("page_size", std::to_string(request.page_size())), - std::make_pair("page_token", request.page_token())})); + std::move(query_params)); } future> @@ -384,11 +464,15 @@ DefaultDatabaseAdminRestStub::AsyncRestoreDatabase( future> f = p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), - "/", request.parent(), "/", "databases", ":restore"))); + "/", request.parent(), "/", "databases", ":restore"), + std::move(query_params))); }, std::move(p), service_, @@ -407,10 +491,14 @@ DefaultDatabaseAdminRestStub::RestoreDatabase( Options const& options, google::spanner::admin::database::v1::RestoreDatabaseRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.parent(), "/", "databases", ":restore")); + request.parent(), "/", "databases", ":restore"), + std::move(query_params)); } StatusOr @@ -419,15 +507,18 @@ DefaultDatabaseAdminRestStub::ListDatabaseOperations( Options const& options, google::spanner::admin::database::v1::ListDatabaseOperationsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back({"page_size", std::to_string(request.page_size())}); + query_params.push_back({"page_token", request.page_token()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::spanner::admin::database::v1::ListDatabaseOperationsResponse>( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "databaseOperations"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("page_size", std::to_string(request.page_size())), - std::make_pair("page_token", request.page_token())})); + std::move(query_params)); } StatusOr @@ -436,15 +527,18 @@ DefaultDatabaseAdminRestStub::ListBackupOperations( Options const& options, google::spanner::admin::database::v1::ListBackupOperationsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back({"page_size", std::to_string(request.page_size())}); + query_params.push_back({"page_token", request.page_token()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::spanner::admin::database::v1::ListBackupOperationsResponse>( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "backupOperations"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("page_size", std::to_string(request.page_size())), - std::make_pair("page_token", request.page_token())})); + std::move(query_params)); } StatusOr @@ -453,14 +547,17 @@ DefaultDatabaseAdminRestStub::ListDatabaseRoles( Options const& options, google::spanner::admin::database::v1::ListDatabaseRolesRequest const& request) { + std::vector> query_params; + query_params.push_back({"page_size", std::to_string(request.page_size())}); + query_params.push_back({"page_token", request.page_token()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::spanner::admin::database::v1::ListDatabaseRolesResponse>( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "databaseRoles"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("page_size", std::to_string(request.page_size())), - std::make_pair("page_token", request.page_token())})); + std::move(query_params)); } StatusOr @@ -469,13 +566,16 @@ DefaultDatabaseAdminRestStub::CreateBackupSchedule( Options const& options, google::spanner::admin::database::v1::CreateBackupScheduleRequest const& request) { + std::vector> query_params; + query_params.push_back({"backup_schedule_id", request.backup_schedule_id()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::spanner::admin::database::v1::BackupSchedule>( *service_, rest_context, request.backup_schedule(), false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "backupSchedules"), - rest_internal::TrimEmptyQueryParameters({std::make_pair( - "backup_schedule_id", request.backup_schedule_id())})); + std::move(query_params)); } StatusOr @@ -484,11 +584,15 @@ DefaultDatabaseAdminRestStub::GetBackupSchedule( Options const& options, google::spanner::admin::database::v1::GetBackupScheduleRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::spanner::admin::database::v1::BackupSchedule>( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.name())); + request.name()), + std::move(query_params)); } StatusOr @@ -497,11 +601,15 @@ DefaultDatabaseAdminRestStub::UpdateBackupSchedule( Options const& options, google::spanner::admin::database::v1::UpdateBackupScheduleRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch< google::spanner::admin::database::v1::BackupSchedule>( *service_, rest_context, request.backup_schedule(), false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.backup_schedule().name())); + request.backup_schedule().name()), + std::move(query_params)); } Status DefaultDatabaseAdminRestStub::DeleteBackupSchedule( @@ -509,10 +617,14 @@ Status DefaultDatabaseAdminRestStub::DeleteBackupSchedule( Options const& options, google::spanner::admin::database::v1::DeleteBackupScheduleRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.name())); + request.name()), + std::move(query_params)); } StatusOr @@ -521,14 +633,17 @@ DefaultDatabaseAdminRestStub::ListBackupSchedules( Options const& options, google::spanner::admin::database::v1::ListBackupSchedulesRequest const& request) { + std::vector> query_params; + query_params.push_back({"page_size", std::to_string(request.page_size())}); + query_params.push_back({"page_token", request.page_token()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::spanner::admin::database::v1::ListBackupSchedulesResponse>( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "backupSchedules"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("page_size", std::to_string(request.page_size())), - std::make_pair("page_token", request.page_token())})); + std::move(query_params)); } future> diff --git a/google/cloud/spanner/admin/internal/instance_admin_rest_stub.cc b/google/cloud/spanner/admin/internal/instance_admin_rest_stub.cc index 47f0b1e80c05e..6fab9f989cfed 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_rest_stub.cc +++ b/google/cloud/spanner/admin/internal/instance_admin_rest_stub.cc @@ -51,14 +51,17 @@ DefaultInstanceAdminRestStub::ListInstanceConfigs( Options const& options, google::spanner::admin::instance::v1::ListInstanceConfigsRequest const& request) { + std::vector> query_params; + query_params.push_back({"page_size", std::to_string(request.page_size())}); + query_params.push_back({"page_token", request.page_token()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::spanner::admin::instance::v1::ListInstanceConfigsResponse>( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "instanceConfigs"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("page_size", std::to_string(request.page_size())), - std::make_pair("page_token", request.page_token())})); + std::move(query_params)); } StatusOr @@ -67,11 +70,15 @@ DefaultInstanceAdminRestStub::GetInstanceConfig( Options const& options, google::spanner::admin::instance::v1::GetInstanceConfigRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::spanner::admin::instance::v1::InstanceConfig>( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.name())); + request.name()), + std::move(query_params)); } future> @@ -85,11 +92,15 @@ DefaultInstanceAdminRestStub::AsyncCreateInstanceConfig( future> f = p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), - "/", request.parent(), "/", "instanceConfigs"))); + "/", request.parent(), "/", "instanceConfigs"), + std::move(query_params))); }, std::move(p), service_, @@ -108,10 +119,14 @@ DefaultInstanceAdminRestStub::CreateInstanceConfig( Options const& options, google::spanner::admin::instance::v1::CreateInstanceConfigRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.parent(), "/", "instanceConfigs")); + request.parent(), "/", "instanceConfigs"), + std::move(query_params)); } future> @@ -125,11 +140,15 @@ DefaultInstanceAdminRestStub::AsyncUpdateInstanceConfig( future> f = p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Patch( *service, *rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), - "/", request.instance_config().name()))); + "/", request.instance_config().name()), + std::move(query_params))); }, std::move(p), service_, @@ -148,10 +167,14 @@ DefaultInstanceAdminRestStub::UpdateInstanceConfig( Options const& options, google::spanner::admin::instance::v1::UpdateInstanceConfigRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.instance_config().name())); + request.instance_config().name()), + std::move(query_params)); } Status DefaultInstanceAdminRestStub::DeleteInstanceConfig( @@ -159,14 +182,17 @@ Status DefaultInstanceAdminRestStub::DeleteInstanceConfig( Options const& options, google::spanner::admin::instance::v1::DeleteInstanceConfigRequest const& request) { + std::vector> query_params; + query_params.push_back({"etag", request.etag()}); + query_params.push_back( + {"validate_only", (request.validate_only() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.name()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("etag", request.etag()), - std::make_pair("validate_only", - (request.validate_only() ? "1" : "0"))})); + std::move(query_params)); } StatusOr< @@ -176,15 +202,18 @@ DefaultInstanceAdminRestStub::ListInstanceConfigOperations( Options const& options, google::spanner::admin::instance::v1:: ListInstanceConfigOperationsRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back({"page_size", std::to_string(request.page_size())}); + query_params.push_back({"page_token", request.page_token()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "instanceConfigOperations"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("page_size", std::to_string(request.page_size())), - std::make_pair("page_token", request.page_token())})); + std::move(query_params)); } StatusOr @@ -192,15 +221,18 @@ DefaultInstanceAdminRestStub::ListInstances( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::spanner::admin::instance::v1::ListInstancesRequest const& request) { + std::vector> query_params; + query_params.push_back({"page_size", std::to_string(request.page_size())}); + query_params.push_back({"page_token", request.page_token()}); + query_params.push_back({"filter", request.filter()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::spanner::admin::instance::v1::ListInstancesResponse>( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "instances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("page_size", std::to_string(request.page_size())), - std::make_pair("page_token", request.page_token()), - std::make_pair("filter", request.filter())})); + std::move(query_params)); } StatusOr @@ -209,14 +241,17 @@ DefaultInstanceAdminRestStub::ListInstancePartitions( Options const& options, google::spanner::admin::instance::v1::ListInstancePartitionsRequest const& request) { + std::vector> query_params; + query_params.push_back({"page_size", std::to_string(request.page_size())}); + query_params.push_back({"page_token", request.page_token()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::spanner::admin::instance::v1::ListInstancePartitionsResponse>( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "instancePartitions"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("page_size", std::to_string(request.page_size())), - std::make_pair("page_token", request.page_token())})); + std::move(query_params)); } StatusOr @@ -224,10 +259,14 @@ DefaultInstanceAdminRestStub::GetInstance( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::spanner::admin::instance::v1::GetInstanceRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.name())); + request.name()), + std::move(query_params)); } future> @@ -241,11 +280,15 @@ DefaultInstanceAdminRestStub::AsyncCreateInstance( future> f = p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), - "/", request.parent(), "/", "instances"))); + "/", request.parent(), "/", "instances"), + std::move(query_params))); }, std::move(p), service_, @@ -264,10 +307,14 @@ DefaultInstanceAdminRestStub::CreateInstance( Options const& options, google::spanner::admin::instance::v1::CreateInstanceRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.parent(), "/", "instances")); + request.parent(), "/", "instances"), + std::move(query_params)); } future> @@ -281,11 +328,15 @@ DefaultInstanceAdminRestStub::AsyncUpdateInstance( future> f = p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Patch( *service, *rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), - "/", request.instance().name()))); + "/", request.instance().name()), + std::move(query_params))); }, std::move(p), service_, @@ -304,10 +355,14 @@ DefaultInstanceAdminRestStub::UpdateInstance( Options const& options, google::spanner::admin::instance::v1::UpdateInstanceRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.instance().name())); + request.instance().name()), + std::move(query_params)); } Status DefaultInstanceAdminRestStub::DeleteInstance( @@ -315,30 +370,42 @@ Status DefaultInstanceAdminRestStub::DeleteInstance( Options const& options, google::spanner::admin::instance::v1::DeleteInstanceRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.name())); + request.name()), + std::move(query_params)); } StatusOr DefaultInstanceAdminRestStub::SetIamPolicy( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::iam::v1::SetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.resource(), ":setIamPolicy")); + request.resource(), ":setIamPolicy"), + std::move(query_params)); } StatusOr DefaultInstanceAdminRestStub::GetIamPolicy( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::iam::v1::GetIamPolicyRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.resource(), ":getIamPolicy")); + request.resource(), ":getIamPolicy"), + std::move(query_params)); } StatusOr @@ -346,10 +413,14 @@ DefaultInstanceAdminRestStub::TestIamPermissions( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::iam::v1::TestIamPermissionsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.resource(), ":testIamPermissions")); + request.resource(), ":testIamPermissions"), + std::move(query_params)); } StatusOr @@ -358,11 +429,15 @@ DefaultInstanceAdminRestStub::GetInstancePartition( Options const& options, google::spanner::admin::instance::v1::GetInstancePartitionRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::spanner::admin::instance::v1::InstancePartition>( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.name())); + request.name()), + std::move(query_params)); } future> @@ -376,11 +451,15 @@ DefaultInstanceAdminRestStub::AsyncCreateInstancePartition( future> f = p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), - "/", request.parent(), "/", "instancePartitions"))); + "/", request.parent(), "/", "instancePartitions"), + std::move(query_params))); }, std::move(p), service_, @@ -399,10 +478,14 @@ DefaultInstanceAdminRestStub::CreateInstancePartition( Options const& options, google::spanner::admin::instance::v1::CreateInstancePartitionRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.parent(), "/", "instancePartitions")); + request.parent(), "/", "instancePartitions"), + std::move(query_params)); } Status DefaultInstanceAdminRestStub::DeleteInstancePartition( @@ -410,12 +493,15 @@ Status DefaultInstanceAdminRestStub::DeleteInstancePartition( Options const& options, google::spanner::admin::instance::v1::DeleteInstancePartitionRequest const& request) { + std::vector> query_params; + query_params.push_back({"etag", request.etag()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.name()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("etag", request.etag())})); + std::move(query_params)); } future> @@ -429,11 +515,15 @@ DefaultInstanceAdminRestStub::AsyncUpdateInstancePartition( future> f = p.get_future(); std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Patch( *service, *rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), - "/", request.instance_partition().name()))); + "/", request.instance_partition().name()), + std::move(query_params))); }, std::move(p), service_, @@ -452,10 +542,14 @@ DefaultInstanceAdminRestStub::UpdateInstancePartition( Options const& options, google::spanner::admin::instance::v1::UpdateInstancePartitionRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - request.instance_partition().name())); + request.instance_partition().name()), + std::move(query_params)); } StatusOr> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back({"page_size", std::to_string(request.page_size())}); + query_params.push_back({"page_token", request.page_token()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "instancePartitionOperations"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("page_size", std::to_string(request.page_size())), - std::make_pair("page_token", request.page_token())})); + std::move(query_params)); } future> diff --git a/google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.cc b/google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.cc index 336d2a3119f1d..4eec39233f07e 100644 --- a/google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.cc @@ -45,11 +45,15 @@ DefaultSqlBackupRunsServiceRestStub::Delete( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlBackupRunsDeleteRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "backupRuns", "/", request.id())); + request.instance(), "/", "backupRuns", "/", request.id()), + std::move(query_params)); } StatusOr @@ -57,11 +61,15 @@ DefaultSqlBackupRunsServiceRestStub::Get( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlBackupRunsGetRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "backupRuns", "/", request.id())); + request.instance(), "/", "backupRuns", "/", request.id()), + std::move(query_params)); } StatusOr @@ -69,11 +77,15 @@ DefaultSqlBackupRunsServiceRestStub::Insert( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlBackupRunsInsertRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "backupRuns")); + request.instance(), "/", "backupRuns"), + std::move(query_params)); } StatusOr @@ -81,14 +93,18 @@ DefaultSqlBackupRunsServiceRestStub::List( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlBackupRunsListRequest const& request) { + std::vector> query_params; + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"page_token", request.page_token()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", request.instance(), "/", "backupRuns"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("page_token", request.page_token())})); + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/sql/v1/internal/sql_connect_rest_stub.cc b/google/cloud/sql/v1/internal/sql_connect_rest_stub.cc index 51d21a7304087..d557e375840d8 100644 --- a/google/cloud/sql/v1/internal/sql_connect_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_connect_rest_stub.cc @@ -45,11 +45,15 @@ DefaultSqlConnectServiceRestStub::GetConnectSettings( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::GetConnectSettingsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "connectSettings")); + request.instance(), "/", "connectSettings"), + std::move(query_params)); } StatusOr @@ -57,12 +61,16 @@ DefaultSqlConnectServiceRestStub::GenerateEphemeralCert( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::GenerateEphemeralCertRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::sql::v1::GenerateEphemeralCertResponse>( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), ":generateEphemeralCert")); + request.instance(), ":generateEphemeralCert"), + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/sql/v1/internal/sql_databases_rest_stub.cc b/google/cloud/sql/v1/internal/sql_databases_rest_stub.cc index f41bc73184358..17fdb6e04d586 100644 --- a/google/cloud/sql/v1/internal/sql_databases_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_databases_rest_stub.cc @@ -45,12 +45,16 @@ DefaultSqlDatabasesServiceRestStub::Delete( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlDatabasesDeleteRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", request.instance(), "/", "databases", "/", - request.database())); + request.database()), + std::move(query_params)); } StatusOr @@ -58,12 +62,16 @@ DefaultSqlDatabasesServiceRestStub::Get( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlDatabasesGetRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", request.instance(), "/", "databases", "/", - request.database())); + request.database()), + std::move(query_params)); } StatusOr @@ -71,11 +79,15 @@ DefaultSqlDatabasesServiceRestStub::Insert( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlDatabasesInsertRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "databases")); + request.instance(), "/", "databases"), + std::move(query_params)); } StatusOr @@ -83,11 +95,15 @@ DefaultSqlDatabasesServiceRestStub::List( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlDatabasesListRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "databases")); + request.instance(), "/", "databases"), + std::move(query_params)); } StatusOr @@ -95,12 +111,16 @@ DefaultSqlDatabasesServiceRestStub::Patch( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlDatabasesUpdateRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", request.instance(), "/", "databases", "/", - request.database())); + request.database()), + std::move(query_params)); } StatusOr @@ -108,12 +128,16 @@ DefaultSqlDatabasesServiceRestStub::Update( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlDatabasesUpdateRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", request.instance(), "/", "databases", "/", - request.database())); + request.database()), + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/sql/v1/internal/sql_flags_rest_stub.cc b/google/cloud/sql/v1/internal/sql_flags_rest_stub.cc index 09e956046796b..a921c08e54643 100644 --- a/google/cloud/sql/v1/internal/sql_flags_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_flags_rest_stub.cc @@ -44,12 +44,15 @@ DefaultSqlFlagsServiceRestStub::List( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlFlagsListRequest const& request) { + std::vector> query_params; + query_params.push_back({"database_version", request.database_version()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "flags"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("database_version", request.database_version())})); + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/sql/v1/internal/sql_instances_rest_stub.cc b/google/cloud/sql/v1/internal/sql_instances_rest_stub.cc index 039d704a4dbbf..30132f7f06d35 100644 --- a/google/cloud/sql/v1/internal/sql_instances_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_instances_rest_stub.cc @@ -45,11 +45,15 @@ DefaultSqlInstancesServiceRestStub::AddServerCa( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesAddServerCaRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "addServerCa")); + request.instance(), "/", "addServerCa"), + std::move(query_params)); } StatusOr @@ -57,11 +61,15 @@ DefaultSqlInstancesServiceRestStub::Clone( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesCloneRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "clone")); + request.instance(), "/", "clone"), + std::move(query_params)); } StatusOr @@ -69,11 +77,15 @@ DefaultSqlInstancesServiceRestStub::Delete( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesDeleteRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance())); + request.instance()), + std::move(query_params)); } StatusOr @@ -81,11 +93,15 @@ DefaultSqlInstancesServiceRestStub::DemoteMaster( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesDemoteMasterRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "demoteMaster")); + request.instance(), "/", "demoteMaster"), + std::move(query_params)); } StatusOr @@ -93,11 +109,15 @@ DefaultSqlInstancesServiceRestStub::Demote( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesDemoteRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "demote")); + request.instance(), "/", "demote"), + std::move(query_params)); } StatusOr @@ -105,11 +125,15 @@ DefaultSqlInstancesServiceRestStub::Export( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesExportRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "export")); + request.instance(), "/", "export"), + std::move(query_params)); } StatusOr @@ -117,11 +141,15 @@ DefaultSqlInstancesServiceRestStub::Failover( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesFailoverRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "failover")); + request.instance(), "/", "failover"), + std::move(query_params)); } StatusOr @@ -129,11 +157,15 @@ DefaultSqlInstancesServiceRestStub::Reencrypt( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesReencryptRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "reencrypt")); + request.instance(), "/", "reencrypt"), + std::move(query_params)); } StatusOr @@ -141,11 +173,15 @@ DefaultSqlInstancesServiceRestStub::Get( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesGetRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance())); + request.instance()), + std::move(query_params)); } StatusOr @@ -153,11 +189,15 @@ DefaultSqlInstancesServiceRestStub::Import( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesImportRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "import")); + request.instance(), "/", "import"), + std::move(query_params)); } StatusOr @@ -165,10 +205,14 @@ DefaultSqlInstancesServiceRestStub::Insert( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesInsertRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - "projects", "/", request.project(), "/", "instances")); + "projects", "/", request.project(), "/", "instances"), + std::move(query_params)); } StatusOr @@ -176,14 +220,18 @@ DefaultSqlInstancesServiceRestStub::List( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesListRequest const& request) { + std::vector> query_params; + query_params.push_back({"filter", request.filter()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"page_token", request.page_token()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("filter", request.filter()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("page_token", request.page_token())})); + std::move(query_params)); } StatusOr @@ -191,12 +239,16 @@ DefaultSqlInstancesServiceRestStub::ListServerCas( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesListServerCasRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::sql::v1::InstancesListServerCasResponse>( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "listServerCas")); + request.instance(), "/", "listServerCas"), + std::move(query_params)); } StatusOr @@ -204,11 +256,15 @@ DefaultSqlInstancesServiceRestStub::Patch( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesPatchRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance())); + request.instance()), + std::move(query_params)); } StatusOr @@ -216,13 +272,16 @@ DefaultSqlInstancesServiceRestStub::PromoteReplica( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesPromoteReplicaRequest const& request) { + std::vector> query_params; + query_params.push_back({"failover", (request.failover() ? "1" : "0")}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", request.instance(), "/", "promoteReplica"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("failover", (request.failover() ? "1" : "0"))})); + std::move(query_params)); } StatusOr @@ -230,11 +289,15 @@ DefaultSqlInstancesServiceRestStub::Switchover( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesSwitchoverRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "switchover")); + request.instance(), "/", "switchover"), + std::move(query_params)); } StatusOr @@ -242,11 +305,15 @@ DefaultSqlInstancesServiceRestStub::ResetSslConfig( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesResetSslConfigRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "resetSslConfig")); + request.instance(), "/", "resetSslConfig"), + std::move(query_params)); } StatusOr @@ -254,11 +321,15 @@ DefaultSqlInstancesServiceRestStub::Restart( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesRestartRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "restart")); + request.instance(), "/", "restart"), + std::move(query_params)); } StatusOr @@ -266,11 +337,15 @@ DefaultSqlInstancesServiceRestStub::RestoreBackup( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesRestoreBackupRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "restoreBackup")); + request.instance(), "/", "restoreBackup"), + std::move(query_params)); } StatusOr @@ -278,11 +353,15 @@ DefaultSqlInstancesServiceRestStub::RotateServerCa( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesRotateServerCaRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "rotateServerCa")); + request.instance(), "/", "rotateServerCa"), + std::move(query_params)); } StatusOr @@ -290,11 +369,15 @@ DefaultSqlInstancesServiceRestStub::StartReplica( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesStartReplicaRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "startReplica")); + request.instance(), "/", "startReplica"), + std::move(query_params)); } StatusOr @@ -302,11 +385,15 @@ DefaultSqlInstancesServiceRestStub::StopReplica( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesStopReplicaRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "stopReplica")); + request.instance(), "/", "stopReplica"), + std::move(query_params)); } StatusOr @@ -314,11 +401,15 @@ DefaultSqlInstancesServiceRestStub::TruncateLog( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesTruncateLogRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "truncateLog")); + request.instance(), "/", "truncateLog"), + std::move(query_params)); } StatusOr @@ -326,11 +417,15 @@ DefaultSqlInstancesServiceRestStub::Update( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlInstancesUpdateRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance())); + request.instance()), + std::move(query_params)); } StatusOr @@ -339,11 +434,15 @@ DefaultSqlInstancesServiceRestStub::CreateEphemeral( Options const& options, google::cloud::sql::v1::SqlInstancesCreateEphemeralCertRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "createEphemeral")); + request.instance(), "/", "createEphemeral"), + std::move(query_params)); } StatusOr @@ -352,11 +451,15 @@ DefaultSqlInstancesServiceRestStub::RescheduleMaintenance( Options const& options, google::cloud::sql::v1::SqlInstancesRescheduleMaintenanceRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "rescheduleMaintenance")); + request.instance(), "/", "rescheduleMaintenance"), + std::move(query_params)); } StatusOr @@ -365,12 +468,16 @@ DefaultSqlInstancesServiceRestStub::VerifyExternalSyncSettings( Options const& options, google::cloud::sql::v1::SqlInstancesVerifyExternalSyncSettingsRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::sql::v1::SqlInstancesVerifyExternalSyncSettingsResponse>( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "verifyExternalSyncSettings")); + request.instance(), "/", "verifyExternalSyncSettings"), + std::move(query_params)); } StatusOr @@ -379,11 +486,15 @@ DefaultSqlInstancesServiceRestStub::StartExternalSync( Options const& options, google::cloud::sql::v1::SqlInstancesStartExternalSyncRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "startExternalSync")); + request.instance(), "/", "startExternalSync"), + std::move(query_params)); } StatusOr @@ -392,11 +503,15 @@ DefaultSqlInstancesServiceRestStub::PerformDiskShrink( Options const& options, google::cloud::sql::v1::SqlInstancesPerformDiskShrinkRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "performDiskShrink")); + request.instance(), "/", "performDiskShrink"), + std::move(query_params)); } StatusOr @@ -405,12 +520,16 @@ DefaultSqlInstancesServiceRestStub::GetDiskShrinkConfig( Options const& options, google::cloud::sql::v1::SqlInstancesGetDiskShrinkConfigRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::sql::v1::SqlInstancesGetDiskShrinkConfigResponse>( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "getDiskShrinkConfig")); + request.instance(), "/", "getDiskShrinkConfig"), + std::move(query_params)); } StatusOr @@ -419,11 +538,15 @@ DefaultSqlInstancesServiceRestStub::ResetReplicaSize( Options const& options, google::cloud::sql::v1::SqlInstancesResetReplicaSizeRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "resetReplicaSize")); + request.instance(), "/", "resetReplicaSize"), + std::move(query_params)); } StatusOr @@ -432,12 +555,16 @@ DefaultSqlInstancesServiceRestStub::GetLatestRecoveryTime( Options const& options, google::cloud::sql::v1::SqlInstancesGetLatestRecoveryTimeRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::sql::v1::SqlInstancesGetLatestRecoveryTimeResponse>( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "getLatestRecoveryTime")); + request.instance(), "/", "getLatestRecoveryTime"), + std::move(query_params)); } StatusOr @@ -446,12 +573,16 @@ DefaultSqlInstancesServiceRestStub::AcquireSsrsLease( Options const& options, google::cloud::sql::v1::SqlInstancesAcquireSsrsLeaseRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::sql::v1::SqlInstancesAcquireSsrsLeaseResponse>( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "acquireSsrsLease")); + request.instance(), "/", "acquireSsrsLease"), + std::move(query_params)); } StatusOr @@ -460,12 +591,16 @@ DefaultSqlInstancesServiceRestStub::ReleaseSsrsLease( Options const& options, google::cloud::sql::v1::SqlInstancesReleaseSsrsLeaseRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::sql::v1::SqlInstancesReleaseSsrsLeaseResponse>( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "releaseSsrsLease")); + request.instance(), "/", "releaseSsrsLease"), + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/sql/v1/internal/sql_operations_rest_stub.cc b/google/cloud/sql/v1/internal/sql_operations_rest_stub.cc index 0a102726ef0a4..a38b52b30129f 100644 --- a/google/cloud/sql/v1/internal/sql_operations_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_operations_rest_stub.cc @@ -45,11 +45,15 @@ DefaultSqlOperationsServiceRestStub::Get( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlOperationsGetRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "operations", "/", - request.operation())); + request.operation()), + std::move(query_params)); } StatusOr @@ -57,25 +61,33 @@ DefaultSqlOperationsServiceRestStub::List( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlOperationsListRequest const& request) { + std::vector> query_params; + query_params.push_back({"instance", request.instance()}); + query_params.push_back( + {"max_results", std::to_string(request.max_results())}); + query_params.push_back({"page_token", request.page_token()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "operations"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("instance", request.instance()), - std::make_pair("max_results", std::to_string(request.max_results())), - std::make_pair("page_token", request.page_token())})); + std::move(query_params)); } Status DefaultSqlOperationsServiceRestStub::Cancel( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlOperationsCancelRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "operations", "/", - request.operation(), "/", "cancel")); + request.operation(), "/", "cancel"), + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.cc b/google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.cc index c4e4c0509072f..7cd0e527c17f7 100644 --- a/google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.cc @@ -45,12 +45,16 @@ DefaultSqlSslCertsServiceRestStub::Delete( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlSslCertsDeleteRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", request.instance(), "/", "sslCerts", "/", - request.sha1_fingerprint())); + request.sha1_fingerprint()), + std::move(query_params)); } StatusOr @@ -58,12 +62,16 @@ DefaultSqlSslCertsServiceRestStub::Get( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlSslCertsGetRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", request.instance(), "/", "sslCerts", "/", - request.sha1_fingerprint())); + request.sha1_fingerprint()), + std::move(query_params)); } StatusOr @@ -71,11 +79,15 @@ DefaultSqlSslCertsServiceRestStub::Insert( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlSslCertsInsertRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "sslCerts")); + request.instance(), "/", "sslCerts"), + std::move(query_params)); } StatusOr @@ -83,11 +95,15 @@ DefaultSqlSslCertsServiceRestStub::List( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlSslCertsListRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "sslCerts")); + request.instance(), "/", "sslCerts"), + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/sql/v1/internal/sql_tiers_rest_stub.cc b/google/cloud/sql/v1/internal/sql_tiers_rest_stub.cc index dac007f154570..25f3ce65c3776 100644 --- a/google/cloud/sql/v1/internal/sql_tiers_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_tiers_rest_stub.cc @@ -44,10 +44,14 @@ DefaultSqlTiersServiceRestStub::List( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlTiersListRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", - "projects", "/", request.project(), "/", "tiers")); + "projects", "/", request.project(), "/", "tiers"), + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/sql/v1/internal/sql_users_rest_stub.cc b/google/cloud/sql/v1/internal/sql_users_rest_stub.cc index fb9a53a46d739..69075ede61999 100644 --- a/google/cloud/sql/v1/internal/sql_users_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_users_rest_stub.cc @@ -44,27 +44,33 @@ DefaultSqlUsersServiceRestStub::Delete( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlUsersDeleteRequest const& request) { + std::vector> query_params; + query_params.push_back({"host", request.host()}); + query_params.push_back({"name", request.name()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", request.instance(), "/", "users"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("host", request.host()), - std::make_pair("name", request.name())})); + std::move(query_params)); } StatusOr DefaultSqlUsersServiceRestStub::Get( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlUsersGetRequest const& request) { + std::vector> query_params; + query_params.push_back({"host", request.host()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", request.instance(), "/", "users", "/", request.name()), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("host", request.host())})); + std::move(query_params)); } StatusOr @@ -72,11 +78,15 @@ DefaultSqlUsersServiceRestStub::Insert( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlUsersInsertRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "users")); + request.instance(), "/", "users"), + std::move(query_params)); } StatusOr @@ -84,11 +94,15 @@ DefaultSqlUsersServiceRestStub::List( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlUsersListRequest const& request) { + std::vector> query_params; + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", - request.instance(), "/", "users")); + request.instance(), "/", "users"), + std::move(query_params)); } StatusOr @@ -96,14 +110,17 @@ DefaultSqlUsersServiceRestStub::Update( google::cloud::rest_internal::RestContext& rest_context, Options const& options, google::cloud::sql::v1::SqlUsersUpdateRequest const& request) { + std::vector> query_params; + query_params.push_back({"host", request.host()}); + query_params.push_back({"name", request.name()}); + query_params = + rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "projects", "/", request.project(), "/", "instances", "/", request.instance(), "/", "users"), - rest_internal::TrimEmptyQueryParameters( - {std::make_pair("host", request.host()), - std::make_pair("name", request.name())})); + std::move(query_params)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END From 8898707dcd9c6043dd949366cb9bc9c71a53397f Mon Sep 17 00:00:00 2001 From: dbolduc Date: Wed, 31 Jul 2024 23:26:58 +0000 Subject: [PATCH 3/4] address review comments --- generator/internal/http_option_utils.cc | 4 ++++ generator/internal/http_option_utils_test.cc | 16 +++++++++------- generator/internal/stub_rest_generator.cc | 6 ------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/generator/internal/http_option_utils.cc b/generator/internal/http_option_utils.cc index 320957b3fcc8b..706886e3ab5dc 100644 --- a/generator/internal/http_option_utils.cc +++ b/generator/internal/http_option_utils.cc @@ -136,6 +136,10 @@ std::string FormatQueryParameterCode( i.first, field_access); } } + if (!code.empty()) { + code += R"""( + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params));)"""; + } return code; } diff --git a/generator/internal/http_option_utils_test.cc b/generator/internal/http_option_utils_test.cc index 50a8a4783ea20..722b3c1fb2ead 100644 --- a/generator/internal/http_option_utils_test.cc +++ b/generator/internal/http_option_utils_test.cc @@ -616,7 +616,8 @@ TEST_F(HttpOptionUtilsTest, SetHttpGetQueryParametersGetPaginated) { SetHttpQueryParameters(ParseHttpExtension(*method), *method, vars); EXPECT_THAT(vars, Contains(Pair("method_http_query_parameters", - AllOf(HasSubstr("page_token"), HasSubstr("name"), + AllOf(HasSubstr("TrimEmptyQueryParameters"), + HasSubstr("page_token"), HasSubstr("name"), HasSubstr("include_foo"))))); } @@ -629,12 +630,13 @@ TEST_F(HttpOptionUtilsTest, VarsDictionary vars; SetHttpQueryParameters(ParseHttpExtension(*method), *method, vars); EXPECT_THAT( - vars, Contains(Pair( - "method_http_query_parameters", - AllOf(HasSubstr("page_token"), HasSubstr("max_results"), - HasSubstr("include_location"), HasSubstr("double_value"), - HasSubstr("float_value"), HasSubstr("int32_value"), - HasSubstr("int64_value"))))); + vars, + Contains(Pair( + "method_http_query_parameters", + AllOf(HasSubstr("TrimEmptyQueryParameters"), HasSubstr("page_token"), + HasSubstr("max_results"), HasSubstr("include_location"), + HasSubstr("double_value"), HasSubstr("float_value"), + HasSubstr("int32_value"), HasSubstr("int64_value"))))); } TEST_F(HttpOptionUtilsTest, HasHttpAnnotationRoutingHeaderSuccess) { diff --git a/generator/internal/stub_rest_generator.cc b/generator/internal/stub_rest_generator.cc index 145cc62c59654..a217a67ab870b 100644 --- a/generator/internal/stub_rest_generator.cc +++ b/generator/internal/stub_rest_generator.cc @@ -355,7 +355,6 @@ Default$stub_rest_class_name$::Async$method_name$( std::thread t{[]( auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params;$method_http_query_parameters$ - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::$method_http_verb$<$response_type$>( *service, *rest_context, $request_resource$, $preserve_proto_field_names_in_json$, @@ -379,7 +378,6 @@ Default$stub_rest_class_name$::$method_name$( Options const& options, $request_type$ const& request) { std::vector> query_params;$method_http_query_parameters$ - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::$method_http_verb$<$response_type$>( *service_, rest_context, $request_resource$, $preserve_proto_field_names_in_json$, $method_rest_path$, std::move(query_params)); @@ -394,7 +392,6 @@ Status Default$stub_rest_class_name$::$method_name$( Options const& options, $request_type$ const& request) { std::vector> query_params;$method_http_query_parameters$ - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::$method_http_verb$( *service_, rest_context, $request_resource$, $preserve_proto_field_names_in_json$, $method_rest_path$, std::move(query_params)); @@ -408,7 +405,6 @@ Default$stub_rest_class_name$::$method_name$( Options const& options, $request_type$ const& request) { std::vector> query_params;$method_http_query_parameters$ - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::$method_http_verb$<$response_type$>( *service_, rest_context, $request_resource$, $preserve_proto_field_names_in_json$, $method_rest_path$, std::move(query_params)); @@ -435,7 +431,6 @@ Default$stub_rest_class_name$::Async$method_name$( std::thread t{[]( auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params;$method_http_query_parameters$ - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::$method_http_verb$( *service, *rest_context, $request_resource$, $preserve_proto_field_names_in_json$, $method_rest_path_async$, std::move(query_params))); @@ -463,7 +458,6 @@ Default$stub_rest_class_name$::Async$method_name$( std::thread t{[]( auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params;$method_http_query_parameters$ - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::$method_http_verb$<$response_type$>( *service, *rest_context, $request_resource$, $preserve_proto_field_names_in_json$, $method_rest_path_async$, std::move(query_params))); From f27570fe3d0c447424d7af5e369013fd7ce7eaa4 Mon Sep 17 00:00:00 2001 From: dbolduc Date: Wed, 31 Jul 2024 23:28:21 +0000 Subject: [PATCH 4/4] generated changes --- .../internal/golden_kitchen_sink_rest_stub.cc | 7 -- .../v1/internal/golden_rest_only_rest_stub.cc | 1 - .../internal/golden_thing_admin_rest_stub.cc | 19 +----- .../v2/internal/dataset_rest_stub.cc | 8 --- .../v2/internal/job_rest_stub.cc | 4 -- .../v2/internal/model_rest_stub.cc | 6 -- .../v2/internal/project_rest_stub.cc | 2 - .../v2/internal/routine_rest_stub.cc | 8 --- .../v2/internal/table_rest_stub.cc | 4 -- .../internal/accelerator_types_rest_stub.cc | 2 - .../v1/internal/addresses_rest_stub.cc | 2 - .../v1/internal/autoscalers_rest_stub.cc | 2 - .../v1/internal/backend_buckets_rest_stub.cc | 10 --- .../v1/internal/backend_services_rest_stub.cc | 12 ---- .../v1/internal/disk_types_rest_stub.cc | 2 - .../disks/v1/internal/disks_rest_stub.cc | 10 --- .../external_vpn_gateways_rest_stub.cc | 8 --- .../internal/firewall_policies_rest_stub.cc | 22 ------- .../v1/internal/firewalls_rest_stub.cc | 2 - .../v1/internal/forwarding_rules_rest_stub.cc | 2 - .../v1/internal/global_addresses_rest_stub.cc | 6 -- .../global_forwarding_rules_rest_stub.cc | 6 -- ...lobal_network_endpoint_groups_rest_stub.cc | 4 -- .../internal/global_operations_rest_stub.cc | 6 -- ...bal_public_delegated_prefixes_rest_stub.cc | 2 - .../v1/internal/health_checks_rest_stub.cc | 2 - .../internal/http_health_checks_rest_stub.cc | 2 - .../internal/https_health_checks_rest_stub.cc | 2 - .../internal/image_family_views_rest_stub.cc | 2 - .../images/v1/internal/images_rest_stub.cc | 12 ---- ...group_manager_resize_requests_rest_stub.cc | 6 -- .../instance_group_managers_rest_stub.cc | 18 ------ .../v1/internal/instance_groups_rest_stub.cc | 2 - .../internal/instance_settings_rest_stub.cc | 2 - .../internal/instance_templates_rest_stub.cc | 6 -- .../v1/internal/instances_rest_stub.cc | 56 ---------------- .../interconnect_attachments_rest_stub.cc | 2 - .../interconnect_locations_rest_stub.cc | 2 - ...interconnect_remote_locations_rest_stub.cc | 2 - .../v1/internal/interconnects_rest_stub.cc | 10 --- .../v1/internal/license_codes_rest_stub.cc | 4 -- .../v1/internal/licenses_rest_stub.cc | 6 -- .../v1/internal/machine_images_rest_stub.cc | 6 -- .../v1/internal/machine_types_rest_stub.cc | 2 - .../internal/network_attachments_rest_stub.cc | 6 -- ...etwork_edge_security_services_rest_stub.cc | 2 - .../network_endpoint_groups_rest_stub.cc | 4 -- .../network_firewall_policies_rest_stub.cc | 18 ------ .../v1/internal/networks_rest_stub.cc | 8 --- .../v1/internal/node_groups_rest_stub.cc | 8 --- .../v1/internal/node_templates_rest_stub.cc | 6 -- .../v1/internal/node_types_rest_stub.cc | 2 - .../internal/packet_mirrorings_rest_stub.cc | 4 -- .../v1/internal/projects_rest_stub.cc | 12 ---- .../public_advertised_prefixes_rest_stub.cc | 10 --- .../public_delegated_prefixes_rest_stub.cc | 10 --- .../internal/region_autoscalers_rest_stub.cc | 2 - .../region_backend_services_rest_stub.cc | 8 --- .../internal/region_commitments_rest_stub.cc | 2 - .../internal/region_disk_types_rest_stub.cc | 2 - .../v1/internal/region_disks_rest_stub.cc | 10 --- .../region_health_check_services_rest_stub.cc | 2 - .../region_health_checks_rest_stub.cc | 2 - ...egion_instance_group_managers_rest_stub.cc | 18 ------ .../region_instance_groups_rest_stub.cc | 2 - .../region_instance_templates_rest_stub.cc | 2 - ...egion_network_endpoint_groups_rest_stub.cc | 4 -- ...ion_network_firewall_policies_rest_stub.cc | 18 ------ ...region_notification_endpoints_rest_stub.cc | 2 - .../internal/region_operations_rest_stub.cc | 6 -- .../region_security_policies_rest_stub.cc | 6 -- .../region_ssl_certificates_rest_stub.cc | 2 - .../internal/region_ssl_policies_rest_stub.cc | 2 - .../region_target_http_proxies_rest_stub.cc | 2 - .../region_target_https_proxies_rest_stub.cc | 2 - .../region_target_tcp_proxies_rest_stub.cc | 2 - .../v1/internal/region_url_maps_rest_stub.cc | 4 -- .../regions/v1/internal/regions_rest_stub.cc | 2 - .../v1/internal/reservations_rest_stub.cc | 6 -- .../internal/resource_policies_rest_stub.cc | 6 -- .../routers/v1/internal/routers_rest_stub.cc | 6 -- .../routes/v1/internal/routes_rest_stub.cc | 2 - .../internal/security_policies_rest_stub.cc | 10 --- .../internal/service_attachments_rest_stub.cc | 6 -- .../internal/snapshot_settings_rest_stub.cc | 2 - .../v1/internal/snapshots_rest_stub.cc | 10 --- .../v1/internal/ssl_certificates_rest_stub.cc | 2 - .../v1/internal/ssl_policies_rest_stub.cc | 2 - .../internal/storage_pool_types_rest_stub.cc | 2 - .../v1/internal/storage_pools_rest_stub.cc | 6 -- .../v1/internal/subnetworks_rest_stub.cc | 6 -- .../internal/target_grpc_proxies_rest_stub.cc | 2 - .../internal/target_http_proxies_rest_stub.cc | 2 - .../target_https_proxies_rest_stub.cc | 2 - .../v1/internal/target_instances_rest_stub.cc | 2 - .../v1/internal/target_pools_rest_stub.cc | 4 -- .../internal/target_ssl_proxies_rest_stub.cc | 2 - .../internal/target_tcp_proxies_rest_stub.cc | 2 - .../internal/target_vpn_gateways_rest_stub.cc | 2 - .../v1/internal/url_maps_rest_stub.cc | 4 -- .../v1/internal/vpn_gateways_rest_stub.cc | 6 -- .../v1/internal/vpn_tunnels_rest_stub.cc | 2 - .../v1/internal/zone_operations_rest_stub.cc | 6 -- .../zones/v1/internal/zones_rest_stub.cc | 2 - .../internal/database_admin_rest_stub.cc | 44 ------------- .../internal/instance_admin_rest_stub.cc | 38 ----------- .../v1/internal/sql_backup_runs_rest_stub.cc | 6 -- .../sql/v1/internal/sql_connect_rest_stub.cc | 4 -- .../v1/internal/sql_databases_rest_stub.cc | 12 ---- .../v1/internal/sql_instances_rest_stub.cc | 64 ------------------- .../v1/internal/sql_operations_rest_stub.cc | 4 -- .../v1/internal/sql_ssl_certs_rest_stub.cc | 8 --- .../sql/v1/internal/sql_tiers_rest_stub.cc | 2 - .../sql/v1/internal/sql_users_rest_stub.cc | 4 -- 114 files changed, 1 insertion(+), 782 deletions(-) diff --git a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_stub.cc b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_stub.cc index d1b77b58c81c1..25ca1b08df5f6 100644 --- a/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_stub.cc +++ b/generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_stub.cc @@ -47,7 +47,6 @@ DefaultGoldenKitchenSinkRestStub::GenerateAccessToken( Options const& options, google::test::admin::database::v1::GenerateAccessTokenRequest const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.name(), ":generateAccessToken"), std::move(query_params)); @@ -59,7 +58,6 @@ DefaultGoldenKitchenSinkRestStub::GenerateIdToken( Options const& options, google::test::admin::database::v1::GenerateIdTokenRequest const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "token", ":generate"), std::move(query_params)); @@ -71,7 +69,6 @@ DefaultGoldenKitchenSinkRestStub::WriteLogEntries( Options const& options, google::test::admin::database::v1::WriteLogEntriesRequest const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "entries", ":write"), std::move(query_params)); @@ -97,7 +94,6 @@ DefaultGoldenKitchenSinkRestStub::ListServiceAccountKeys( Options const& options, google::test::admin::database::v1::ListServiceAccountKeysRequest const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.name(), "/", "keys"), std::move(query_params)); @@ -108,7 +104,6 @@ Status DefaultGoldenKitchenSinkRestStub::DoNothing( Options const& options, google::protobuf::Empty const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "doNothing"), std::move(query_params)); @@ -119,7 +114,6 @@ Status DefaultGoldenKitchenSinkRestStub::ExplicitRouting1( Options const& options, google::test::admin::database::v1::ExplicitRoutingRequest const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.table_name(), ":explicitRouting1"), std::move(query_params)); @@ -130,7 +124,6 @@ Status DefaultGoldenKitchenSinkRestStub::ExplicitRouting2( Options const& options, google::test::admin::database::v1::ExplicitRoutingRequest const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.table_name(), ":explicitRouting2"), std::move(query_params)); diff --git a/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_stub.cc b/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_stub.cc index d6df4cbb9a237..1c4d0945bc7ab 100644 --- a/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_stub.cc +++ b/generator/integration_tests/golden/v1/internal/golden_rest_only_rest_stub.cc @@ -46,7 +46,6 @@ Status DefaultGoldenRestOnlyRestStub::Noop( Options const& options, google::protobuf::Empty const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", "noop"), std::move(query_params)); diff --git a/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_stub.cc b/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_stub.cc index 0ca7bfd27c318..ee3d9b134d418 100644 --- a/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_stub.cc +++ b/generator/integration_tests/golden/v1/internal/golden_thing_admin_rest_stub.cc @@ -71,7 +71,6 @@ DefaultGoldenThingAdminRestStub::AsyncCreateDatabase( std::thread t{[]( auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request, false, @@ -93,7 +92,6 @@ DefaultGoldenThingAdminRestStub::CreateDatabase( Options const& options, google::test::admin::database::v1::CreateDatabaseRequest const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "databases"), std::move(query_params)); @@ -105,7 +103,6 @@ DefaultGoldenThingAdminRestStub::GetDatabase( Options const& options, google::test::admin::database::v1::GetDatabaseRequest const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.name()), std::move(query_params)); @@ -122,7 +119,6 @@ DefaultGoldenThingAdminRestStub::AsyncUpdateDatabaseDdl( std::thread t{[]( auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Patch( *service, *rest_context, request, false, @@ -144,7 +140,6 @@ DefaultGoldenThingAdminRestStub::UpdateDatabaseDdl( Options const& options, google::test::admin::database::v1::UpdateDatabaseDdlRequest const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.database(), "/", "ddl"), std::move(query_params)); @@ -155,7 +150,6 @@ Status DefaultGoldenThingAdminRestStub::DropDatabase( Options const& options, google::test::admin::database::v1::DropDatabaseRequest const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.database()), std::move(query_params)); @@ -167,7 +161,6 @@ DefaultGoldenThingAdminRestStub::GetDatabaseDdl( Options const& options, google::test::admin::database::v1::GetDatabaseDdlRequest const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.database(), "/", "ddl"), std::move(query_params)); @@ -179,7 +172,6 @@ DefaultGoldenThingAdminRestStub::SetIamPolicy( Options const& options, google::iam::v1::SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.resource(), ":setIamPolicy"), std::move(query_params)); @@ -191,7 +183,6 @@ DefaultGoldenThingAdminRestStub::GetIamPolicy( Options const& options, google::iam::v1::GetIamPolicyRequest const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.resource(), ":getIamPolicy"), std::move(query_params)); @@ -203,7 +194,6 @@ DefaultGoldenThingAdminRestStub::TestIamPermissions( Options const& options, google::iam::v1::TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.resource(), ":testIamPermissions"), std::move(query_params)); @@ -221,7 +211,7 @@ DefaultGoldenThingAdminRestStub::AsyncCreateBackup( auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; query_params.push_back({"backup_id", request.backup_id()}); - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); + query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request.backup(), false, @@ -256,7 +246,6 @@ DefaultGoldenThingAdminRestStub::GetBackup( Options const& options, google::test::admin::database::v1::GetBackupRequest const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.name()), std::move(query_params)); @@ -268,7 +257,6 @@ DefaultGoldenThingAdminRestStub::UpdateBackup( Options const& options, google::test::admin::database::v1::UpdateBackupRequest const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.backup(), false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.backup().name()), std::move(query_params)); @@ -279,7 +267,6 @@ Status DefaultGoldenThingAdminRestStub::DeleteBackup( Options const& options, google::test::admin::database::v1::DeleteBackupRequest const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.name()), std::move(query_params)); @@ -311,7 +298,6 @@ DefaultGoldenThingAdminRestStub::AsyncRestoreDatabase( std::thread t{[]( auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request, false, @@ -333,7 +319,6 @@ DefaultGoldenThingAdminRestStub::RestoreDatabase( Options const& options, google::test::admin::database::v1::RestoreDatabaseRequest const& request) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", request.parent(), "/", "databases", ":restore"), std::move(query_params)); @@ -380,7 +365,6 @@ DefaultGoldenThingAdminRestStub::AsyncGetDatabase( std::thread t{[]( auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Get( *service, *rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), "/", request.name()), std::move(query_params))); @@ -406,7 +390,6 @@ DefaultGoldenThingAdminRestStub::AsyncDropDatabase( std::thread t{[]( auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Delete( *service, *rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", *options), "/", request.database()), std::move(query_params))); diff --git a/google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.cc index 3bbe9c378e3fa..def4b13790415 100644 --- a/google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/dataset_rest_stub.cc @@ -64,8 +64,6 @@ DefaultDatasetServiceRestStub::InsertDataset( Options const& options, google::cloud::bigquery::v2::InsertDatasetRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.dataset(), false, absl::StrCat("/", "bigquery", "/", @@ -80,8 +78,6 @@ DefaultDatasetServiceRestStub::PatchDataset( Options const& options, google::cloud::bigquery::v2::UpdateOrPatchDatasetRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.dataset(), false, absl::StrCat("/", "bigquery", "/", @@ -97,8 +93,6 @@ DefaultDatasetServiceRestStub::UpdateDataset( Options const& options, google::cloud::bigquery::v2::UpdateOrPatchDatasetRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.dataset(), false, absl::StrCat("/", "bigquery", "/", @@ -155,8 +149,6 @@ DefaultDatasetServiceRestStub::UndeleteDataset( Options const& options, google::cloud::bigquery::v2::UndeleteDatasetRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", diff --git a/google/cloud/bigquerycontrol/v2/internal/job_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/job_rest_stub.cc index 7f2bb30f37a57..2a468e833894e 100644 --- a/google/cloud/bigquerycontrol/v2/internal/job_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/job_rest_stub.cc @@ -79,8 +79,6 @@ StatusOr DefaultJobServiceRestStub::InsertJob( Options const& options, google::cloud::bigquery::v2::InsertJobRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.job(), false, absl::StrCat("/", "bigquery", "/", @@ -175,8 +173,6 @@ DefaultJobServiceRestStub::Query( Options const& options, google::cloud::bigquery::v2::PostQueryRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.query_request(), false, absl::StrCat("/", "bigquery", "/", diff --git a/google/cloud/bigquerycontrol/v2/internal/model_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/model_rest_stub.cc index 78cccb82eec21..b9026b7d2deab 100644 --- a/google/cloud/bigquerycontrol/v2/internal/model_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/model_rest_stub.cc @@ -45,8 +45,6 @@ DefaultModelServiceRestStub::GetModel( Options const& options, google::cloud::bigquery::v2::GetModelRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", @@ -85,8 +83,6 @@ DefaultModelServiceRestStub::PatchModel( Options const& options, google::cloud::bigquery::v2::PatchModelRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.model(), false, absl::StrCat("/", "bigquery", "/", @@ -102,8 +98,6 @@ Status DefaultModelServiceRestStub::DeleteModel( Options const& options, google::cloud::bigquery::v2::DeleteModelRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", diff --git a/google/cloud/bigquerycontrol/v2/internal/project_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/project_rest_stub.cc index d1aeb8e8a0793..4f6d6d9ef4b37 100644 --- a/google/cloud/bigquerycontrol/v2/internal/project_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/project_rest_stub.cc @@ -45,8 +45,6 @@ DefaultProjectServiceRestStub::GetServiceAccount( Options const& options, google::cloud::bigquery::v2::GetServiceAccountRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::bigquery::v2::GetServiceAccountResponse>( *service_, rest_context, request, false, diff --git a/google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.cc index 892de8557bd43..72352c8e1321f 100644 --- a/google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/routine_rest_stub.cc @@ -45,8 +45,6 @@ DefaultRoutineServiceRestStub::GetRoutine( Options const& options, google::cloud::bigquery::v2::GetRoutineRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", @@ -63,8 +61,6 @@ DefaultRoutineServiceRestStub::InsertRoutine( Options const& options, google::cloud::bigquery::v2::InsertRoutineRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.routine(), false, absl::StrCat("/", "bigquery", "/", @@ -80,8 +76,6 @@ DefaultRoutineServiceRestStub::UpdateRoutine( Options const& options, google::cloud::bigquery::v2::UpdateRoutineRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.routine(), false, absl::StrCat("/", "bigquery", "/", @@ -97,8 +91,6 @@ Status DefaultRoutineServiceRestStub::DeleteRoutine( Options const& options, google::cloud::bigquery::v2::DeleteRoutineRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", diff --git a/google/cloud/bigquerycontrol/v2/internal/table_rest_stub.cc b/google/cloud/bigquerycontrol/v2/internal/table_rest_stub.cc index 4a6f4c472ad56..1651c276dfcd1 100644 --- a/google/cloud/bigquerycontrol/v2/internal/table_rest_stub.cc +++ b/google/cloud/bigquerycontrol/v2/internal/table_rest_stub.cc @@ -65,8 +65,6 @@ DefaultTableServiceRestStub::InsertTable( Options const& options, google::cloud::bigquery::v2::InsertTableRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.table(), false, absl::StrCat("/", "bigquery", "/", @@ -121,8 +119,6 @@ Status DefaultTableServiceRestStub::DeleteTable( Options const& options, google::cloud::bigquery::v2::DeleteTableRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "bigquery", "/", diff --git a/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_stub.cc b/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_stub.cc index 102582c50a7f9..cb35d61928d96 100644 --- a/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_stub.cc +++ b/google/cloud/compute/accelerator_types/v1/internal/accelerator_types_rest_stub.cc @@ -77,8 +77,6 @@ DefaultAcceleratorTypesRestStub::GetAcceleratorType( google::cloud::cpp::compute::accelerator_types::v1:: GetAcceleratorTypeRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/addresses/v1/internal/addresses_rest_stub.cc b/google/cloud/compute/addresses/v1/internal/addresses_rest_stub.cc index fd203f96ca6e4..92d57a920feeb 100644 --- a/google/cloud/compute/addresses/v1/internal/addresses_rest_stub.cc +++ b/google/cloud/compute/addresses/v1/internal/addresses_rest_stub.cc @@ -138,8 +138,6 @@ DefaultAddressesRestStub::GetAddress( google::cloud::cpp::compute::addresses::v1::GetAddressRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.cc b/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.cc index f33e252e44173..06ce3a1edbe09 100644 --- a/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.cc +++ b/google/cloud/compute/autoscalers/v1/internal/autoscalers_rest_stub.cc @@ -139,8 +139,6 @@ DefaultAutoscalersRestStub::GetAutoscaler( google::cloud::cpp::compute::autoscalers::v1::GetAutoscalerRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.cc b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.cc index e8a003b455bb9..ec0e898ee48d1 100644 --- a/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.cc +++ b/google/cloud/compute/backend_buckets/v1/internal/backend_buckets_rest_stub.cc @@ -172,8 +172,6 @@ DefaultBackendBucketsRestStub::AsyncDeleteSignedUrlKey( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -203,8 +201,6 @@ DefaultBackendBucketsRestStub::DeleteSignedUrlKey( google::cloud::cpp::compute::backend_buckets::v1:: DeleteSignedUrlKeyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -222,8 +218,6 @@ DefaultBackendBucketsRestStub::GetBackendBucket( google::cloud::cpp::compute::backend_buckets::v1:: GetBackendBucketRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -460,8 +454,6 @@ DefaultBackendBucketsRestStub::SetIamPolicy( google::cloud::cpp::compute::backend_buckets::v1::SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_policy_request_resource(), false, @@ -480,8 +472,6 @@ DefaultBackendBucketsRestStub::TestIamPermissions( google::cloud::cpp::compute::backend_buckets::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.cc b/google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.cc index 3d25a60d72a0e..1e5d454624be5 100644 --- a/google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.cc +++ b/google/cloud/compute/backend_services/v1/internal/backend_services_rest_stub.cc @@ -202,8 +202,6 @@ DefaultBackendServicesRestStub::AsyncDeleteSignedUrlKey( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -233,8 +231,6 @@ DefaultBackendServicesRestStub::DeleteSignedUrlKey( google::cloud::cpp::compute::backend_services::v1:: DeleteSignedUrlKeyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -252,8 +248,6 @@ DefaultBackendServicesRestStub::GetBackendService( google::cloud::cpp::compute::backend_services::v1:: GetBackendServiceRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -270,8 +264,6 @@ DefaultBackendServicesRestStub::GetHealth( google::cloud::cpp::compute::backend_services::v1::GetHealthRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::BackendServiceGroupHealth>( *service_, rest_context, request.resource_group_reference_resource(), @@ -538,8 +530,6 @@ DefaultBackendServicesRestStub::SetIamPolicy( google::cloud::cpp::compute::backend_services::v1:: SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_policy_request_resource(), false, @@ -618,8 +608,6 @@ DefaultBackendServicesRestStub::TestIamPermissions( google::cloud::cpp::compute::backend_services::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.cc b/google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.cc index 0b562e7ed4b70..5681155a14f3a 100644 --- a/google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.cc +++ b/google/cloud/compute/disk_types/v1/internal/disk_types_rest_stub.cc @@ -76,8 +76,6 @@ DefaultDiskTypesRestStub::GetDiskType( google::cloud::cpp::compute::disk_types::v1::GetDiskTypeRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/disks/v1/internal/disks_rest_stub.cc b/google/cloud/compute/disks/v1/internal/disks_rest_stub.cc index ae6c1633d6e7e..622b2c5b27fe0 100644 --- a/google/cloud/compute/disks/v1/internal/disks_rest_stub.cc +++ b/google/cloud/compute/disks/v1/internal/disks_rest_stub.cc @@ -308,8 +308,6 @@ StatusOr DefaultDisksRestStub::GetDisk( Options const& options, google::cloud::cpp::compute::disks::v1::GetDiskRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -543,8 +541,6 @@ DefaultDisksRestStub::SetIamPolicy( google::cloud::cpp::compute::disks::v1::SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.zone_set_policy_request_resource(), false, @@ -685,8 +681,6 @@ DefaultDisksRestStub::AsyncStopAsyncReplication( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -715,8 +709,6 @@ DefaultDisksRestStub::StopAsyncReplication( google::cloud::cpp::compute::disks::v1::StopAsyncReplicationRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -793,8 +785,6 @@ DefaultDisksRestStub::TestIamPermissions( google::cloud::cpp::compute::disks::v1::TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.cc b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.cc index 1a342cb3255fa..f1952a748cc82 100644 --- a/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.cc +++ b/google/cloud/compute/external_vpn_gateways/v1/internal/external_vpn_gateways_rest_stub.cc @@ -110,8 +110,6 @@ DefaultExternalVpnGatewaysRestStub::GetExternalVpnGateway( google::cloud::cpp::compute::external_vpn_gateways::v1:: GetExternalVpnGatewayRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::ExternalVpnGateway>( *service_, rest_context, request, false, @@ -217,8 +215,6 @@ DefaultExternalVpnGatewaysRestStub::AsyncSetLabels( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -248,8 +244,6 @@ DefaultExternalVpnGatewaysRestStub::SetLabels( google::cloud::cpp::compute::external_vpn_gateways::v1:: SetLabelsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_labels_request_resource(), false, @@ -268,8 +262,6 @@ DefaultExternalVpnGatewaysRestStub::TestIamPermissions( google::cloud::cpp::compute::external_vpn_gateways::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.cc b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.cc index 19d6f491db3e0..7cd537c35e2cc 100644 --- a/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.cc +++ b/google/cloud/compute/firewall_policies/v1/internal/firewall_policies_rest_stub.cc @@ -180,8 +180,6 @@ DefaultFirewallPoliciesRestStub::AsyncCloneRules( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -210,8 +208,6 @@ DefaultFirewallPoliciesRestStub::CloneRules( google::cloud::cpp::compute::firewall_policies::v1::CloneRulesRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -284,8 +280,6 @@ DefaultFirewallPoliciesRestStub::GetFirewallPolicy( google::cloud::cpp::compute::firewall_policies::v1:: GetFirewallPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -473,8 +467,6 @@ DefaultFirewallPoliciesRestStub::AsyncMove( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -503,8 +495,6 @@ DefaultFirewallPoliciesRestStub::Move( google::cloud::cpp::compute::firewall_policies::v1::MoveRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -644,8 +634,6 @@ DefaultFirewallPoliciesRestStub::AsyncRemoveAssociation( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -674,8 +662,6 @@ DefaultFirewallPoliciesRestStub::RemoveAssociation( google::cloud::cpp::compute::firewall_policies::v1:: RemoveAssociationRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -698,8 +684,6 @@ DefaultFirewallPoliciesRestStub::AsyncRemoveRule( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -728,8 +712,6 @@ DefaultFirewallPoliciesRestStub::RemoveRule( google::cloud::cpp::compute::firewall_policies::v1::RemoveRuleRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -746,8 +728,6 @@ DefaultFirewallPoliciesRestStub::SetIamPolicy( google::cloud::cpp::compute::firewall_policies::v1:: SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_organization_set_policy_request_resource(), false, @@ -765,8 +745,6 @@ DefaultFirewallPoliciesRestStub::TestIamPermissions( google::cloud::cpp::compute::firewall_policies::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.cc b/google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.cc index 37942e205c949..b73f2d2ff33ce 100644 --- a/google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.cc +++ b/google/cloud/compute/firewalls/v1/internal/firewalls_rest_stub.cc @@ -108,8 +108,6 @@ DefaultFirewallsRestStub::GetFirewall( google::cloud::cpp::compute::firewalls::v1::GetFirewallRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.cc b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.cc index ee1d2050846a7..e0c5917e2ce89 100644 --- a/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.cc +++ b/google/cloud/compute/forwarding_rules/v1/internal/forwarding_rules_rest_stub.cc @@ -139,8 +139,6 @@ DefaultForwardingRulesRestStub::GetForwardingRule( google::cloud::cpp::compute::forwarding_rules::v1:: GetForwardingRuleRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.cc b/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.cc index 144f2b32a8a16..aec352a15c1ea 100644 --- a/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.cc +++ b/google/cloud/compute/global_addresses/v1/internal/global_addresses_rest_stub.cc @@ -108,8 +108,6 @@ DefaultGlobalAddressesRestStub::GetAddress( google::cloud::cpp::compute::global_addresses::v1::GetAddressRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -270,8 +268,6 @@ DefaultGlobalAddressesRestStub::AsyncSetLabels( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -301,8 +297,6 @@ DefaultGlobalAddressesRestStub::SetLabels( google::cloud::cpp::compute::global_addresses::v1::SetLabelsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_labels_request_resource(), false, diff --git a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.cc b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.cc index 3119c721da07c..0f6bb7bf7cef2 100644 --- a/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.cc +++ b/google/cloud/compute/global_forwarding_rules/v1/internal/global_forwarding_rules_rest_stub.cc @@ -110,8 +110,6 @@ DefaultGlobalForwardingRulesRestStub::GetForwardingRule( google::cloud::cpp::compute::global_forwarding_rules::v1:: GetForwardingRuleRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -273,8 +271,6 @@ DefaultGlobalForwardingRulesRestStub::AsyncSetLabels( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -304,8 +300,6 @@ DefaultGlobalForwardingRulesRestStub::SetLabels( google::cloud::cpp::compute::global_forwarding_rules::v1:: SetLabelsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_labels_request_resource(), false, diff --git a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.cc b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.cc index 7f9379f8ac6b9..7a9d0a7f5d0e5 100644 --- a/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.cc +++ b/google/cloud/compute/global_network_endpoint_groups/v1/internal/global_network_endpoint_groups_rest_stub.cc @@ -240,8 +240,6 @@ DefaultGlobalNetworkEndpointGroupsRestStub::GetNetworkEndpointGroup( google::cloud::cpp::compute::global_network_endpoint_groups::v1:: GetNetworkEndpointGroupRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NetworkEndpointGroup>( *service_, rest_context, request, false, @@ -343,8 +341,6 @@ DefaultGlobalNetworkEndpointGroupsRestStub::ListNetworkEndpoints( google::cloud::cpp::compute::global_network_endpoint_groups::v1:: ListNetworkEndpointsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, diff --git a/google/cloud/compute/global_operations/v1/internal/global_operations_rest_stub.cc b/google/cloud/compute/global_operations/v1/internal/global_operations_rest_stub.cc index ce38f60c01921..7053cc0447708 100644 --- a/google/cloud/compute/global_operations/v1/internal/global_operations_rest_stub.cc +++ b/google/cloud/compute/global_operations/v1/internal/global_operations_rest_stub.cc @@ -76,8 +76,6 @@ Status DefaultGlobalOperationsRestStub::DeleteOperation( google::cloud::cpp::compute::global_operations::v1:: DeleteOperationRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -94,8 +92,6 @@ DefaultGlobalOperationsRestStub::GetOperation( google::cloud::cpp::compute::global_operations::v1:: GetOperationRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -137,8 +133,6 @@ DefaultGlobalOperationsRestStub::Wait( google::cloud::cpp::compute::global_operations::v1::WaitRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.cc b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.cc index 6eb8590eb5705..9fc1f7d2baa1f 100644 --- a/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.cc +++ b/google/cloud/compute/global_public_delegated_prefixes/v1/internal/global_public_delegated_prefixes_rest_stub.cc @@ -112,8 +112,6 @@ DefaultGlobalPublicDelegatedPrefixesRestStub::GetPublicDelegatedPrefix( google::cloud::cpp::compute::global_public_delegated_prefixes::v1:: GetPublicDelegatedPrefixRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::PublicDelegatedPrefix>( *service_, rest_context, request, false, diff --git a/google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.cc b/google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.cc index 9c6d4a01f6f9c..3f34d96af82eb 100644 --- a/google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.cc +++ b/google/cloud/compute/health_checks/v1/internal/health_checks_rest_stub.cc @@ -138,8 +138,6 @@ DefaultHealthChecksRestStub::GetHealthCheck( google::cloud::cpp::compute::health_checks::v1::GetHealthCheckRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.cc b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.cc index 0c47e83025967..5f29e7bf9edf5 100644 --- a/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.cc +++ b/google/cloud/compute/http_health_checks/v1/internal/http_health_checks_rest_stub.cc @@ -109,8 +109,6 @@ DefaultHttpHealthChecksRestStub::GetHttpHealthCheck( google::cloud::cpp::compute::http_health_checks::v1:: GetHttpHealthCheckRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.cc b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.cc index 67b0645f716af..abb69ebd058a7 100644 --- a/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.cc +++ b/google/cloud/compute/https_health_checks/v1/internal/https_health_checks_rest_stub.cc @@ -109,8 +109,6 @@ DefaultHttpsHealthChecksRestStub::GetHttpsHealthCheck( google::cloud::cpp::compute::https_health_checks::v1:: GetHttpsHealthCheckRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_stub.cc b/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_stub.cc index 4328c9161d84f..f38c7cb7ec434 100644 --- a/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_stub.cc +++ b/google/cloud/compute/image_family_views/v1/internal/image_family_views_rest_stub.cc @@ -47,8 +47,6 @@ DefaultImageFamilyViewsRestStub::GetImageFamilyView( google::cloud::cpp::compute::image_family_views::v1:: GetImageFamilyViewRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/images/v1/internal/images_rest_stub.cc b/google/cloud/compute/images/v1/internal/images_rest_stub.cc index 8bdf5f1c3d782..28689f74484bb 100644 --- a/google/cloud/compute/images/v1/internal/images_rest_stub.cc +++ b/google/cloud/compute/images/v1/internal/images_rest_stub.cc @@ -161,8 +161,6 @@ DefaultImagesRestStub::GetImage( Options const& options, google::cloud::cpp::compute::images::v1::GetImageRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -179,8 +177,6 @@ DefaultImagesRestStub::GetFromFamily( google::cloud::cpp::compute::images::v1::GetFromFamilyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -354,8 +350,6 @@ DefaultImagesRestStub::SetIamPolicy( google::cloud::cpp::compute::images::v1::SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_policy_request_resource(), false, @@ -378,8 +372,6 @@ DefaultImagesRestStub::AsyncSetLabels( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -408,8 +400,6 @@ DefaultImagesRestStub::SetLabels( Options const& options, google::cloud::cpp::compute::images::v1::SetLabelsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_labels_request_resource(), false, @@ -427,8 +417,6 @@ DefaultImagesRestStub::TestIamPermissions( google::cloud::cpp::compute::images::v1::TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.cc b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.cc index 40b35c3d3b329..29bd4ccaafbee 100644 --- a/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.cc +++ b/google/cloud/compute/instance_group_manager_resize_requests/v1/internal/instance_group_manager_resize_requests_rest_stub.cc @@ -61,8 +61,6 @@ DefaultInstanceGroupManagerResizeRequestsRestStub::AsyncCancel( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -93,8 +91,6 @@ DefaultInstanceGroupManagerResizeRequestsRestStub::Cancel( google::cloud::cpp::compute::instance_group_manager_resize_requests::v1:: CancelRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -176,8 +172,6 @@ DefaultInstanceGroupManagerResizeRequestsRestStub:: google::cloud::cpp::compute::instance_group_manager_resize_requests:: v1::GetInstanceGroupManagerResizeRequestRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InstanceGroupManagerResizeRequest>( *service_, rest_context, request, false, diff --git a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.cc b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.cc index e568c26998462..d5f375de3a9f6 100644 --- a/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.cc +++ b/google/cloud/compute/instance_group_managers/v1/internal/instance_group_managers_rest_stub.cc @@ -153,8 +153,6 @@ DefaultInstanceGroupManagersRestStub::AsyncApplyUpdatesToInstances( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -188,8 +186,6 @@ DefaultInstanceGroupManagersRestStub::ApplyUpdatesToInstances( google::cloud::cpp::compute::instance_group_managers::v1:: ApplyUpdatesToInstancesRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.instance_group_managers_apply_updates_request_resource(), false, @@ -397,8 +393,6 @@ DefaultInstanceGroupManagersRestStub::AsyncDeletePerInstanceConfigs( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -431,8 +425,6 @@ DefaultInstanceGroupManagersRestStub::DeletePerInstanceConfigs( google::cloud::cpp::compute::instance_group_managers::v1:: DeletePerInstanceConfigsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request @@ -454,8 +446,6 @@ DefaultInstanceGroupManagersRestStub::GetInstanceGroupManager( google::cloud::cpp::compute::instance_group_managers::v1:: GetInstanceGroupManagerRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InstanceGroupManager>( *service_, rest_context, request, false, @@ -586,8 +576,6 @@ DefaultInstanceGroupManagersRestStub::ListManagedInstances( google::cloud::cpp::compute::instance_group_managers::v1:: ListManagedInstancesRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1:: InstanceGroupManagersListManagedInstancesResponse>( @@ -609,8 +597,6 @@ DefaultInstanceGroupManagersRestStub::ListPerInstanceConfigs( google::cloud::cpp::compute::instance_group_managers::v1:: ListPerInstanceConfigsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1:: InstanceGroupManagersListPerInstanceConfigsResp>( @@ -823,8 +809,6 @@ DefaultInstanceGroupManagersRestStub::AsyncResize( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -854,8 +838,6 @@ DefaultInstanceGroupManagersRestStub::Resize( google::cloud::cpp::compute::instance_group_managers::v1:: ResizeRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.cc b/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.cc index a5887742625f0..6325015b90dc5 100644 --- a/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.cc +++ b/google/cloud/compute/instance_groups/v1/internal/instance_groups_rest_stub.cc @@ -199,8 +199,6 @@ DefaultInstanceGroupsRestStub::GetInstanceGroup( google::cloud::cpp::compute::instance_groups::v1:: GetInstanceGroupRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.cc b/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.cc index 2e566ed03f88b..ce1ad54c7edf8 100644 --- a/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.cc +++ b/google/cloud/compute/instance_settings/v1/internal/instance_settings_rest_stub.cc @@ -53,8 +53,6 @@ DefaultInstanceSettingsRestStub::GetInstanceSettings( google::cloud::cpp::compute::instance_settings::v1:: GetInstanceSettingsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.cc b/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.cc index 235859336948d..6595885c14b59 100644 --- a/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.cc +++ b/google/cloud/compute/instance_templates/v1/internal/instance_templates_rest_stub.cc @@ -139,8 +139,6 @@ DefaultInstanceTemplatesRestStub::GetInstanceTemplate( google::cloud::cpp::compute::instance_templates::v1:: GetInstanceTemplateRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -261,8 +259,6 @@ DefaultInstanceTemplatesRestStub::SetIamPolicy( google::cloud::cpp::compute::instance_templates::v1:: SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_policy_request_resource(), false, @@ -281,8 +277,6 @@ DefaultInstanceTemplatesRestStub::TestIamPermissions( google::cloud::cpp::compute::instance_templates::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/instances/v1/internal/instances_rest_stub.cc b/google/cloud/compute/instances/v1/internal/instances_rest_stub.cc index c02ec2316e673..c46fbaf0e5041 100644 --- a/google/cloud/compute/instances/v1/internal/instances_rest_stub.cc +++ b/google/cloud/compute/instances/v1/internal/instances_rest_stub.cc @@ -385,8 +385,6 @@ DefaultInstancesRestStub::AsyncDeleteAccessConfig( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -416,8 +414,6 @@ DefaultInstancesRestStub::DeleteAccessConfig( google::cloud::cpp::compute::instances::v1::DeleteAccessConfigRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -441,8 +437,6 @@ DefaultInstancesRestStub::AsyncDetachDisk( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -471,8 +465,6 @@ DefaultInstancesRestStub::DetachDisk( google::cloud::cpp::compute::instances::v1::DetachDiskRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -490,8 +482,6 @@ DefaultInstancesRestStub::GetInstance( google::cloud::cpp::compute::instances::v1::GetInstanceRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -573,8 +563,6 @@ DefaultInstancesRestStub::GetScreenshot( google::cloud::cpp::compute::instances::v1::GetScreenshotRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -613,8 +601,6 @@ DefaultInstancesRestStub::GetShieldedInstanceIdentity( google::cloud::cpp::compute::instances::v1:: GetShieldedInstanceIdentityRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::ShieldedInstanceIdentity>( *service_, rest_context, request, false, @@ -754,8 +740,6 @@ DefaultInstancesRestStub::AsyncPerformMaintenance( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -785,8 +769,6 @@ DefaultInstancesRestStub::PerformMaintenance( google::cloud::cpp::compute::instances::v1::PerformMaintenanceRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -870,8 +852,6 @@ DefaultInstancesRestStub::AsyncReset( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -899,8 +879,6 @@ DefaultInstancesRestStub::Reset( Options const& options, google::cloud::cpp::compute::instances::v1::ResetRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -923,8 +901,6 @@ DefaultInstancesRestStub::AsyncResume( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -952,8 +928,6 @@ DefaultInstancesRestStub::Resume( Options const& options, google::cloud::cpp::compute::instances::v1::ResumeRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -970,8 +944,6 @@ Status DefaultInstancesRestStub::SendDiagnosticInterrupt( google::cloud::cpp::compute::instances::v1:: SendDiagnosticInterruptRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -995,8 +967,6 @@ DefaultInstancesRestStub::AsyncSetDeletionProtection( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -1026,8 +996,6 @@ DefaultInstancesRestStub::SetDeletionProtection( google::cloud::cpp::compute::instances::v1:: SetDeletionProtectionRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -1051,8 +1019,6 @@ DefaultInstancesRestStub::AsyncSetDiskAutoDelete( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -1081,8 +1047,6 @@ DefaultInstancesRestStub::SetDiskAutoDelete( google::cloud::cpp::compute::instances::v1::SetDiskAutoDeleteRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -1100,8 +1064,6 @@ DefaultInstancesRestStub::SetIamPolicy( google::cloud::cpp::compute::instances::v1::SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.zone_set_policy_request_resource(), false, @@ -1769,8 +1731,6 @@ DefaultInstancesRestStub::AsyncSimulateMaintenanceEvent( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -1800,8 +1760,6 @@ DefaultInstancesRestStub::SimulateMaintenanceEvent( google::cloud::cpp::compute::instances::v1:: SimulateMaintenanceEventRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -1824,8 +1782,6 @@ DefaultInstancesRestStub::AsyncStart( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -1853,8 +1809,6 @@ DefaultInstancesRestStub::Start( Options const& options, google::cloud::cpp::compute::instances::v1::StartRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -1938,8 +1892,6 @@ DefaultInstancesRestStub::AsyncStop( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -1967,8 +1919,6 @@ DefaultInstancesRestStub::Stop( Options const& options, google::cloud::cpp::compute::instances::v1::StopRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -1991,8 +1941,6 @@ DefaultInstancesRestStub::AsyncSuspend( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -2020,8 +1968,6 @@ DefaultInstancesRestStub::Suspend( Options const& options, google::cloud::cpp::compute::instances::v1::SuspendRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -2039,8 +1985,6 @@ DefaultInstancesRestStub::TestIamPermissions( google::cloud::cpp::compute::instances::v1::TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.cc b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.cc index 33e6922e018d1..2d8a443c99137 100644 --- a/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.cc +++ b/google/cloud/compute/interconnect_attachments/v1/internal/interconnect_attachments_rest_stub.cc @@ -142,8 +142,6 @@ DefaultInterconnectAttachmentsRestStub::GetInterconnectAttachment( google::cloud::cpp::compute::interconnect_attachments::v1:: GetInterconnectAttachmentRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InterconnectAttachment>( *service_, rest_context, request, false, diff --git a/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_stub.cc b/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_stub.cc index 797d71b69e56d..4cc5bf9b1881e 100644 --- a/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_stub.cc +++ b/google/cloud/compute/interconnect_locations/v1/internal/interconnect_locations_rest_stub.cc @@ -48,8 +48,6 @@ DefaultInterconnectLocationsRestStub::GetInterconnectLocation( google::cloud::cpp::compute::interconnect_locations::v1:: GetInterconnectLocationRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InterconnectLocation>( *service_, rest_context, request, false, diff --git a/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_stub.cc b/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_stub.cc index d54568ad092b1..32d9159bced85 100644 --- a/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_stub.cc +++ b/google/cloud/compute/interconnect_remote_locations/v1/internal/interconnect_remote_locations_rest_stub.cc @@ -49,8 +49,6 @@ DefaultInterconnectRemoteLocationsRestStub::GetInterconnectRemoteLocation( google::cloud::cpp::compute::interconnect_remote_locations::v1:: GetInterconnectRemoteLocationRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InterconnectRemoteLocation>( *service_, rest_context, request, false, diff --git a/google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.cc b/google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.cc index 7693c0a71bbf9..3d6b0f1413334 100644 --- a/google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.cc +++ b/google/cloud/compute/interconnects/v1/internal/interconnects_rest_stub.cc @@ -108,8 +108,6 @@ DefaultInterconnectsRestStub::GetInterconnect( google::cloud::cpp::compute::interconnects::v1:: GetInterconnectRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -126,8 +124,6 @@ DefaultInterconnectsRestStub::GetDiagnostics( google::cloud::cpp::compute::interconnects::v1::GetDiagnosticsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InterconnectsGetDiagnosticsResponse>( *service_, rest_context, request, false, @@ -146,8 +142,6 @@ DefaultInterconnectsRestStub::GetMacsecConfig( google::cloud::cpp::compute::interconnects::v1:: GetMacsecConfigRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InterconnectsGetMacsecConfigResponse>( *service_, rest_context, request, false, @@ -308,8 +302,6 @@ DefaultInterconnectsRestStub::AsyncSetLabels( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -339,8 +331,6 @@ DefaultInterconnectsRestStub::SetLabels( google::cloud::cpp::compute::interconnects::v1::SetLabelsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_labels_request_resource(), false, diff --git a/google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.cc b/google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.cc index e7a664de1e592..ac720e511d092 100644 --- a/google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.cc +++ b/google/cloud/compute/license_codes/v1/internal/license_codes_rest_stub.cc @@ -46,8 +46,6 @@ DefaultLicenseCodesRestStub::GetLicenseCode( google::cloud::cpp::compute::license_codes::v1::GetLicenseCodeRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -64,8 +62,6 @@ DefaultLicenseCodesRestStub::TestIamPermissions( google::cloud::cpp::compute::license_codes::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/licenses/v1/internal/licenses_rest_stub.cc b/google/cloud/compute/licenses/v1/internal/licenses_rest_stub.cc index 10feb136e7f8f..e92928029026a 100644 --- a/google/cloud/compute/licenses/v1/internal/licenses_rest_stub.cc +++ b/google/cloud/compute/licenses/v1/internal/licenses_rest_stub.cc @@ -107,8 +107,6 @@ DefaultLicensesRestStub::GetLicense( google::cloud::cpp::compute::licenses::v1::GetLicenseRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -227,8 +225,6 @@ DefaultLicensesRestStub::SetIamPolicy( google::cloud::cpp::compute::licenses::v1::SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_policy_request_resource(), false, @@ -246,8 +242,6 @@ DefaultLicensesRestStub::TestIamPermissions( google::cloud::cpp::compute::licenses::v1::TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.cc b/google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.cc index 825e5447dedbd..0ef1543faff4f 100644 --- a/google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.cc +++ b/google/cloud/compute/machine_images/v1/internal/machine_images_rest_stub.cc @@ -108,8 +108,6 @@ DefaultMachineImagesRestStub::GetMachineImage( google::cloud::cpp::compute::machine_images::v1:: GetMachineImageRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -231,8 +229,6 @@ DefaultMachineImagesRestStub::SetIamPolicy( google::cloud::cpp::compute::machine_images::v1::SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_policy_request_resource(), false, @@ -251,8 +247,6 @@ DefaultMachineImagesRestStub::TestIamPermissions( google::cloud::cpp::compute::machine_images::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.cc b/google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.cc index 426eda2a6c21a..c7b21cd6bffb8 100644 --- a/google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.cc +++ b/google/cloud/compute/machine_types/v1/internal/machine_types_rest_stub.cc @@ -76,8 +76,6 @@ DefaultMachineTypesRestStub::GetMachineType( google::cloud::cpp::compute::machine_types::v1::GetMachineTypeRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.cc b/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.cc index 89f3db97b3474..c9128f555ed90 100644 --- a/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.cc +++ b/google/cloud/compute/network_attachments/v1/internal/network_attachments_rest_stub.cc @@ -141,8 +141,6 @@ DefaultNetworkAttachmentsRestStub::GetNetworkAttachment( google::cloud::cpp::compute::network_attachments::v1:: GetNetworkAttachmentRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -324,8 +322,6 @@ DefaultNetworkAttachmentsRestStub::SetIamPolicy( google::cloud::cpp::compute::network_attachments::v1:: SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_policy_request_resource(), false, @@ -344,8 +340,6 @@ DefaultNetworkAttachmentsRestStub::TestIamPermissions( google::cloud::cpp::compute::network_attachments::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.cc b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.cc index bcc89c26a583c..ee9ded0d7ee21 100644 --- a/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.cc +++ b/google/cloud/compute/network_edge_security_services/v1/internal/network_edge_security_services_rest_stub.cc @@ -146,8 +146,6 @@ DefaultNetworkEdgeSecurityServicesRestStub::GetNetworkEdgeSecurityService( google::cloud::cpp::compute::network_edge_security_services::v1:: GetNetworkEdgeSecurityServiceRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NetworkEdgeSecurityService>( *service_, rest_context, request, false, diff --git a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.cc b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.cc index 499c79bbed346..5238d7cc60562 100644 --- a/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.cc +++ b/google/cloud/compute/network_endpoint_groups/v1/internal/network_endpoint_groups_rest_stub.cc @@ -268,8 +268,6 @@ DefaultNetworkEndpointGroupsRestStub::GetNetworkEndpointGroup( google::cloud::cpp::compute::network_endpoint_groups::v1:: GetNetworkEndpointGroupRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NetworkEndpointGroup>( *service_, rest_context, request, false, @@ -401,8 +399,6 @@ DefaultNetworkEndpointGroupsRestStub::TestIamPermissions( google::cloud::cpp::compute::network_endpoint_groups::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.cc b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.cc index 8748e0d9da568..5c9285ca7cdaa 100644 --- a/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.cc +++ b/google/cloud/compute/network_firewall_policies/v1/internal/network_firewall_policies_rest_stub.cc @@ -191,8 +191,6 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncCloneRules( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -221,8 +219,6 @@ DefaultNetworkFirewallPoliciesRestStub::CloneRules( google::cloud::cpp::compute::network_firewall_policies::v1:: CloneRulesRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -296,8 +292,6 @@ DefaultNetworkFirewallPoliciesRestStub::GetFirewallPolicy( google::cloud::cpp::compute::network_firewall_policies::v1:: GetFirewallPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -584,8 +578,6 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncRemoveAssociation( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -615,8 +607,6 @@ DefaultNetworkFirewallPoliciesRestStub::RemoveAssociation( google::cloud::cpp::compute::network_firewall_policies::v1:: RemoveAssociationRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -640,8 +630,6 @@ DefaultNetworkFirewallPoliciesRestStub::AsyncRemoveRule( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -670,8 +658,6 @@ DefaultNetworkFirewallPoliciesRestStub::RemoveRule( google::cloud::cpp::compute::network_firewall_policies::v1:: RemoveRuleRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -689,8 +675,6 @@ DefaultNetworkFirewallPoliciesRestStub::SetIamPolicy( google::cloud::cpp::compute::network_firewall_policies::v1:: SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_policy_request_resource(), false, @@ -709,8 +693,6 @@ DefaultNetworkFirewallPoliciesRestStub::TestIamPermissions( google::cloud::cpp::compute::network_firewall_policies::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/networks/v1/internal/networks_rest_stub.cc b/google/cloud/compute/networks/v1/internal/networks_rest_stub.cc index dd386e75ddea0..3d30b5bb27e0b 100644 --- a/google/cloud/compute/networks/v1/internal/networks_rest_stub.cc +++ b/google/cloud/compute/networks/v1/internal/networks_rest_stub.cc @@ -165,8 +165,6 @@ DefaultNetworksRestStub::GetNetwork( google::cloud::cpp::compute::networks::v1::GetNetworkRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -183,8 +181,6 @@ DefaultNetworksRestStub::GetEffectiveFirewalls( google::cloud::cpp::compute::networks::v1:: GetEffectiveFirewallsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NetworksGetEffectiveFirewallsResponse>( *service_, rest_context, request, false, @@ -432,8 +428,6 @@ DefaultNetworksRestStub::AsyncSwitchToCustomMode( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -462,8 +456,6 @@ DefaultNetworksRestStub::SwitchToCustomMode( google::cloud::cpp::compute::networks::v1::SwitchToCustomModeRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.cc b/google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.cc index 764e2259f30fe..c136c1131e899 100644 --- a/google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.cc +++ b/google/cloud/compute/node_groups/v1/internal/node_groups_rest_stub.cc @@ -257,8 +257,6 @@ DefaultNodeGroupsRestStub::GetNodeGroup( google::cloud::cpp::compute::node_groups::v1::GetNodeGroupRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -382,8 +380,6 @@ DefaultNodeGroupsRestStub::ListNodes( google::cloud::cpp::compute::node_groups::v1::ListNodesRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::NodeGroupsListNodes>( *service_, rest_context, request, false, @@ -520,8 +516,6 @@ DefaultNodeGroupsRestStub::SetIamPolicy( google::cloud::cpp::compute::node_groups::v1::SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.zone_set_policy_request_resource(), false, @@ -661,8 +655,6 @@ DefaultNodeGroupsRestStub::TestIamPermissions( google::cloud::cpp::compute::node_groups::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.cc b/google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.cc index 2e433dafb9761..ed799987f61b0 100644 --- a/google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.cc +++ b/google/cloud/compute/node_templates/v1/internal/node_templates_rest_stub.cc @@ -139,8 +139,6 @@ DefaultNodeTemplatesRestStub::GetNodeTemplate( google::cloud::cpp::compute::node_templates::v1:: GetNodeTemplateRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -262,8 +260,6 @@ DefaultNodeTemplatesRestStub::SetIamPolicy( google::cloud::cpp::compute::node_templates::v1::SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_policy_request_resource(), false, @@ -282,8 +278,6 @@ DefaultNodeTemplatesRestStub::TestIamPermissions( google::cloud::cpp::compute::node_templates::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/node_types/v1/internal/node_types_rest_stub.cc b/google/cloud/compute/node_types/v1/internal/node_types_rest_stub.cc index 37eef30330e9b..4cd4d68e05383 100644 --- a/google/cloud/compute/node_types/v1/internal/node_types_rest_stub.cc +++ b/google/cloud/compute/node_types/v1/internal/node_types_rest_stub.cc @@ -76,8 +76,6 @@ DefaultNodeTypesRestStub::GetNodeType( google::cloud::cpp::compute::node_types::v1::GetNodeTypeRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.cc b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.cc index 544cb01e0eab5..34ce9025b4104 100644 --- a/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.cc +++ b/google/cloud/compute/packet_mirrorings/v1/internal/packet_mirrorings_rest_stub.cc @@ -141,8 +141,6 @@ DefaultPacketMirroringsRestStub::GetPacketMirroring( google::cloud::cpp::compute::packet_mirrorings::v1:: GetPacketMirroringRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -302,8 +300,6 @@ DefaultPacketMirroringsRestStub::TestIamPermissions( google::cloud::cpp::compute::packet_mirrorings::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/projects/v1/internal/projects_rest_stub.cc b/google/cloud/compute/projects/v1/internal/projects_rest_stub.cc index aaa6a2f3b3f63..eef501c19ca98 100644 --- a/google/cloud/compute/projects/v1/internal/projects_rest_stub.cc +++ b/google/cloud/compute/projects/v1/internal/projects_rest_stub.cc @@ -58,8 +58,6 @@ DefaultProjectsRestStub::AsyncDisableXpnHost( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -87,8 +85,6 @@ DefaultProjectsRestStub::DisableXpnHost( google::cloud::cpp::compute::projects::v1::DisableXpnHostRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -167,8 +163,6 @@ DefaultProjectsRestStub::AsyncEnableXpnHost( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -196,8 +190,6 @@ DefaultProjectsRestStub::EnableXpnHost( google::cloud::cpp::compute::projects::v1::EnableXpnHostRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -270,8 +262,6 @@ DefaultProjectsRestStub::GetProject( google::cloud::cpp::compute::projects::v1::GetProjectRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -287,8 +277,6 @@ DefaultProjectsRestStub::GetXpnHost( google::cloud::cpp::compute::projects::v1::GetXpnHostRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.cc b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.cc index 900867d071d9a..a9ef3f3603ad3 100644 --- a/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.cc +++ b/google/cloud/compute/public_advertised_prefixes/v1/internal/public_advertised_prefixes_rest_stub.cc @@ -61,8 +61,6 @@ DefaultPublicAdvertisedPrefixesRestStub::AsyncAnnounce( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -92,8 +90,6 @@ DefaultPublicAdvertisedPrefixesRestStub::Announce( google::cloud::cpp::compute::public_advertised_prefixes::v1:: AnnounceRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -168,8 +164,6 @@ DefaultPublicAdvertisedPrefixesRestStub::GetPublicAdvertisedPrefix( google::cloud::cpp::compute::public_advertised_prefixes::v1:: GetPublicAdvertisedPrefixRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::PublicAdvertisedPrefix>( *service_, rest_context, request, false, @@ -336,8 +330,6 @@ DefaultPublicAdvertisedPrefixesRestStub::AsyncWithdraw( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -367,8 +359,6 @@ DefaultPublicAdvertisedPrefixesRestStub::Withdraw( google::cloud::cpp::compute::public_advertised_prefixes::v1:: WithdrawRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.cc b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.cc index 75e18b9ef3fbd..063281250bd09 100644 --- a/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.cc +++ b/google/cloud/compute/public_delegated_prefixes/v1/internal/public_delegated_prefixes_rest_stub.cc @@ -90,8 +90,6 @@ DefaultPublicDelegatedPrefixesRestStub::AsyncAnnounce( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -121,8 +119,6 @@ DefaultPublicDelegatedPrefixesRestStub::Announce( google::cloud::cpp::compute::public_delegated_prefixes::v1:: AnnounceRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -198,8 +194,6 @@ DefaultPublicDelegatedPrefixesRestStub::GetPublicDelegatedPrefix( google::cloud::cpp::compute::public_delegated_prefixes::v1:: GetPublicDelegatedPrefixRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::PublicDelegatedPrefix>( *service_, rest_context, request, false, @@ -368,8 +362,6 @@ DefaultPublicDelegatedPrefixesRestStub::AsyncWithdraw( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -399,8 +391,6 @@ DefaultPublicDelegatedPrefixesRestStub::Withdraw( google::cloud::cpp::compute::public_delegated_prefixes::v1:: WithdrawRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.cc b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.cc index f193ec21555fc..fa52326022849 100644 --- a/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.cc +++ b/google/cloud/compute/region_autoscalers/v1/internal/region_autoscalers_rest_stub.cc @@ -110,8 +110,6 @@ DefaultRegionAutoscalersRestStub::GetAutoscaler( google::cloud::cpp::compute::region_autoscalers::v1:: GetAutoscalerRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.cc b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.cc index 4b4f4f8c1cf6f..5e319e8091b2a 100644 --- a/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.cc +++ b/google/cloud/compute/region_backend_services/v1/internal/region_backend_services_rest_stub.cc @@ -111,8 +111,6 @@ DefaultRegionBackendServicesRestStub::GetBackendService( google::cloud::cpp::compute::region_backend_services::v1:: GetBackendServiceRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -130,8 +128,6 @@ DefaultRegionBackendServicesRestStub::GetHealth( google::cloud::cpp::compute::region_backend_services::v1:: GetHealthRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::BackendServiceGroupHealth>( *service_, rest_context, request.resource_group_reference_resource(), @@ -340,8 +336,6 @@ DefaultRegionBackendServicesRestStub::SetIamPolicy( google::cloud::cpp::compute::region_backend_services::v1:: SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_policy_request_resource(), false, @@ -420,8 +414,6 @@ DefaultRegionBackendServicesRestStub::TestIamPermissions( google::cloud::cpp::compute::region_backend_services::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.cc b/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.cc index e21b405b36640..5da166f40d922 100644 --- a/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.cc +++ b/google/cloud/compute/region_commitments/v1/internal/region_commitments_rest_stub.cc @@ -83,8 +83,6 @@ DefaultRegionCommitmentsRestStub::GetCommitment( google::cloud::cpp::compute::region_commitments::v1:: GetCommitmentRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.cc b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.cc index 1fbd65c55258e..52e9e07a8cce5 100644 --- a/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.cc +++ b/google/cloud/compute/region_disk_types/v1/internal/region_disk_types_rest_stub.cc @@ -46,8 +46,6 @@ DefaultRegionDiskTypesRestStub::GetDiskType( google::cloud::cpp::compute::region_disk_types::v1:: GetDiskTypeRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.cc b/google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.cc index 9db0f33b376e3..8f9582451f017 100644 --- a/google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.cc +++ b/google/cloud/compute/region_disks/v1/internal/region_disks_rest_stub.cc @@ -282,8 +282,6 @@ DefaultRegionDisksRestStub::GetDisk( google::cloud::cpp::compute::region_disks::v1::GetDiskRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -525,8 +523,6 @@ DefaultRegionDisksRestStub::SetIamPolicy( google::cloud::cpp::compute::region_disks::v1::SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_policy_request_resource(), false, @@ -670,8 +666,6 @@ DefaultRegionDisksRestStub::AsyncStopAsyncReplication( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -700,8 +694,6 @@ DefaultRegionDisksRestStub::StopAsyncReplication( google::cloud::cpp::compute::region_disks::v1:: StopAsyncReplicationRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -778,8 +770,6 @@ DefaultRegionDisksRestStub::TestIamPermissions( google::cloud::cpp::compute::region_disks::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.cc b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.cc index 98c83ceb32a51..d681012da5878 100644 --- a/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.cc +++ b/google/cloud/compute/region_health_check_services/v1/internal/region_health_check_services_rest_stub.cc @@ -113,8 +113,6 @@ DefaultRegionHealthCheckServicesRestStub::GetHealthCheckService( google::cloud::cpp::compute::region_health_check_services::v1:: GetHealthCheckServiceRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::HealthCheckService>( *service_, rest_context, request, false, diff --git a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.cc b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.cc index b5b56f16f88e7..9f3650216197a 100644 --- a/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.cc +++ b/google/cloud/compute/region_health_checks/v1/internal/region_health_checks_rest_stub.cc @@ -111,8 +111,6 @@ DefaultRegionHealthChecksRestStub::GetHealthCheck( google::cloud::cpp::compute::region_health_checks::v1:: GetHealthCheckRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.cc b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.cc index 034b9e17cf9b9..b6f12b25ceff6 100644 --- a/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.cc +++ b/google/cloud/compute/region_instance_group_managers/v1/internal/region_instance_group_managers_rest_stub.cc @@ -125,8 +125,6 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncApplyUpdatesToInstances( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -160,8 +158,6 @@ DefaultRegionInstanceGroupManagersRestStub::ApplyUpdatesToInstances( google::cloud::cpp::compute::region_instance_group_managers::v1:: ApplyUpdatesToInstancesRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_instance_group_managers_apply_updates_request_resource(), @@ -374,8 +370,6 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncDeletePerInstanceConfigs( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post< google::cloud::cpp::compute::v1::Operation>( *service, *rest_context, @@ -409,8 +403,6 @@ DefaultRegionInstanceGroupManagersRestStub::DeletePerInstanceConfigs( google::cloud::cpp::compute::region_instance_group_managers::v1:: DeletePerInstanceConfigsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request @@ -432,8 +424,6 @@ DefaultRegionInstanceGroupManagersRestStub::GetInstanceGroupManager( google::cloud::cpp::compute::region_instance_group_managers::v1:: GetInstanceGroupManagerRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::InstanceGroupManager>( *service_, rest_context, request, false, @@ -564,8 +554,6 @@ DefaultRegionInstanceGroupManagersRestStub::ListManagedInstances( google::cloud::cpp::compute::region_instance_group_managers::v1:: ListManagedInstancesRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1:: RegionInstanceGroupManagersListInstancesResponse>( @@ -587,8 +575,6 @@ DefaultRegionInstanceGroupManagersRestStub::ListPerInstanceConfigs( google::cloud::cpp::compute::region_instance_group_managers::v1:: ListPerInstanceConfigsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1:: RegionInstanceGroupManagersListInstanceConfigsResp>( @@ -802,8 +788,6 @@ DefaultRegionInstanceGroupManagersRestStub::AsyncResize( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -833,8 +817,6 @@ DefaultRegionInstanceGroupManagersRestStub::Resize( google::cloud::cpp::compute::region_instance_group_managers::v1:: ResizeRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.cc b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.cc index cd571439bca8f..c0d90241f54fd 100644 --- a/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.cc +++ b/google/cloud/compute/region_instance_groups/v1/internal/region_instance_groups_rest_stub.cc @@ -54,8 +54,6 @@ DefaultRegionInstanceGroupsRestStub::GetInstanceGroup( google::cloud::cpp::compute::region_instance_groups::v1:: GetInstanceGroupRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.cc b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.cc index c9d1f408fd638..83438f4fb4cd9 100644 --- a/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.cc +++ b/google/cloud/compute/region_instance_templates/v1/internal/region_instance_templates_rest_stub.cc @@ -112,8 +112,6 @@ DefaultRegionInstanceTemplatesRestStub::GetInstanceTemplate( google::cloud::cpp::compute::region_instance_templates::v1:: GetInstanceTemplateRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.cc b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.cc index 400a30c23fc79..8a25dae5f4cab 100644 --- a/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.cc +++ b/google/cloud/compute/region_network_endpoint_groups/v1/internal/region_network_endpoint_groups_rest_stub.cc @@ -245,8 +245,6 @@ DefaultRegionNetworkEndpointGroupsRestStub::GetNetworkEndpointGroup( google::cloud::cpp::compute::region_network_endpoint_groups::v1:: GetNetworkEndpointGroupRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NetworkEndpointGroup>( *service_, rest_context, request, false, @@ -349,8 +347,6 @@ DefaultRegionNetworkEndpointGroupsRestStub::ListNetworkEndpoints( google::cloud::cpp::compute::region_network_endpoint_groups::v1:: ListNetworkEndpointsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, diff --git a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.cc b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.cc index 024c9222504cf..def7c0c3c64bf 100644 --- a/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.cc +++ b/google/cloud/compute/region_network_firewall_policies/v1/internal/region_network_firewall_policies_rest_stub.cc @@ -194,8 +194,6 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncCloneRules( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -225,8 +223,6 @@ DefaultRegionNetworkFirewallPoliciesRestStub::CloneRules( google::cloud::cpp::compute::region_network_firewall_policies::v1:: CloneRulesRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -302,8 +298,6 @@ DefaultRegionNetworkFirewallPoliciesRestStub::GetFirewallPolicy( google::cloud::cpp::compute::region_network_firewall_policies::v1:: GetFirewallPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -618,8 +612,6 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncRemoveAssociation( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -649,8 +641,6 @@ DefaultRegionNetworkFirewallPoliciesRestStub::RemoveAssociation( google::cloud::cpp::compute::region_network_firewall_policies::v1:: RemoveAssociationRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -674,8 +664,6 @@ DefaultRegionNetworkFirewallPoliciesRestStub::AsyncRemoveRule( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -705,8 +693,6 @@ DefaultRegionNetworkFirewallPoliciesRestStub::RemoveRule( google::cloud::cpp::compute::region_network_firewall_policies::v1:: RemoveRuleRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -724,8 +710,6 @@ DefaultRegionNetworkFirewallPoliciesRestStub::SetIamPolicy( google::cloud::cpp::compute::region_network_firewall_policies::v1:: SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_policy_request_resource(), false, @@ -744,8 +728,6 @@ DefaultRegionNetworkFirewallPoliciesRestStub::TestIamPermissions( google::cloud::cpp::compute::region_network_firewall_policies::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.cc b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.cc index 2f1502b23439c..bc6635cdd1cc7 100644 --- a/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.cc +++ b/google/cloud/compute/region_notification_endpoints/v1/internal/region_notification_endpoints_rest_stub.cc @@ -113,8 +113,6 @@ DefaultRegionNotificationEndpointsRestStub::GetNotificationEndpoint( google::cloud::cpp::compute::region_notification_endpoints::v1:: GetNotificationEndpointRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::NotificationEndpoint>( *service_, rest_context, request, false, diff --git a/google/cloud/compute/region_operations/v1/internal/region_operations_rest_stub.cc b/google/cloud/compute/region_operations/v1/internal/region_operations_rest_stub.cc index 8ed4d82d1f56d..f8a7b1b90bf79 100644 --- a/google/cloud/compute/region_operations/v1/internal/region_operations_rest_stub.cc +++ b/google/cloud/compute/region_operations/v1/internal/region_operations_rest_stub.cc @@ -46,8 +46,6 @@ Status DefaultRegionOperationsRestStub::DeleteOperation( google::cloud::cpp::compute::region_operations::v1:: DeleteOperationRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -65,8 +63,6 @@ DefaultRegionOperationsRestStub::GetOperation( google::cloud::cpp::compute::region_operations::v1:: GetOperationRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -109,8 +105,6 @@ DefaultRegionOperationsRestStub::Wait( google::cloud::cpp::compute::region_operations::v1::WaitRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.cc b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.cc index 1fb324623d87c..6b3e0cdfcc01f 100644 --- a/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.cc +++ b/google/cloud/compute/region_security_policies/v1/internal/region_security_policies_rest_stub.cc @@ -173,8 +173,6 @@ DefaultRegionSecurityPoliciesRestStub::GetSecurityPolicy( google::cloud::cpp::compute::region_security_policies::v1:: GetSecurityPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -433,8 +431,6 @@ DefaultRegionSecurityPoliciesRestStub::AsyncRemoveRule( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -464,8 +460,6 @@ DefaultRegionSecurityPoliciesRestStub::RemoveRule( google::cloud::cpp::compute::region_security_policies::v1:: RemoveRuleRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.cc b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.cc index 1428c8695133a..e206a396b718f 100644 --- a/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.cc +++ b/google/cloud/compute/region_ssl_certificates/v1/internal/region_ssl_certificates_rest_stub.cc @@ -111,8 +111,6 @@ DefaultRegionSslCertificatesRestStub::GetSslCertificate( google::cloud::cpp::compute::region_ssl_certificates::v1:: GetSslCertificateRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.cc b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.cc index bd38782de573e..5232e384a6b5a 100644 --- a/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.cc +++ b/google/cloud/compute/region_ssl_policies/v1/internal/region_ssl_policies_rest_stub.cc @@ -110,8 +110,6 @@ DefaultRegionSslPoliciesRestStub::GetSslPolicy( google::cloud::cpp::compute::region_ssl_policies::v1:: GetSslPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.cc b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.cc index 71c38b8eba7b4..c0925bcb97c35 100644 --- a/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.cc +++ b/google/cloud/compute/region_target_http_proxies/v1/internal/region_target_http_proxies_rest_stub.cc @@ -112,8 +112,6 @@ DefaultRegionTargetHttpProxiesRestStub::GetTargetHttpProxy( google::cloud::cpp::compute::region_target_http_proxies::v1:: GetTargetHttpProxyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.cc b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.cc index d36aa2b2375d4..63865a21f9c33 100644 --- a/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.cc +++ b/google/cloud/compute/region_target_https_proxies/v1/internal/region_target_https_proxies_rest_stub.cc @@ -113,8 +113,6 @@ DefaultRegionTargetHttpsProxiesRestStub::GetTargetHttpsProxy( google::cloud::cpp::compute::region_target_https_proxies::v1:: GetTargetHttpsProxyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.cc b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.cc index f49732696a11a..e6dc95929b12e 100644 --- a/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.cc +++ b/google/cloud/compute/region_target_tcp_proxies/v1/internal/region_target_tcp_proxies_rest_stub.cc @@ -112,8 +112,6 @@ DefaultRegionTargetTcpProxiesRestStub::GetTargetTcpProxy( google::cloud::cpp::compute::region_target_tcp_proxies::v1:: GetTargetTcpProxyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.cc b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.cc index 3013d4dfdeca4..ca48cc6305336 100644 --- a/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.cc +++ b/google/cloud/compute/region_url_maps/v1/internal/region_url_maps_rest_stub.cc @@ -108,8 +108,6 @@ DefaultRegionUrlMapsRestStub::GetUrlMap( google::cloud::cpp::compute::region_url_maps::v1::GetUrlMapRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -318,8 +316,6 @@ DefaultRegionUrlMapsRestStub::Validate( google::cloud::cpp::compute::region_url_maps::v1::ValidateRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::UrlMapsValidateResponse>( *service_, rest_context, diff --git a/google/cloud/compute/regions/v1/internal/regions_rest_stub.cc b/google/cloud/compute/regions/v1/internal/regions_rest_stub.cc index 8ba241f4d720e..9d907fef4b2fe 100644 --- a/google/cloud/compute/regions/v1/internal/regions_rest_stub.cc +++ b/google/cloud/compute/regions/v1/internal/regions_rest_stub.cc @@ -45,8 +45,6 @@ DefaultRegionsRestStub::GetRegion( Options const& options, google::cloud::cpp::compute::regions::v1::GetRegionRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/reservations/v1/internal/reservations_rest_stub.cc b/google/cloud/compute/reservations/v1/internal/reservations_rest_stub.cc index 6180d7fb67f11..0dc83631b46ab 100644 --- a/google/cloud/compute/reservations/v1/internal/reservations_rest_stub.cc +++ b/google/cloud/compute/reservations/v1/internal/reservations_rest_stub.cc @@ -139,8 +139,6 @@ DefaultReservationsRestStub::GetReservation( google::cloud::cpp::compute::reservations::v1::GetReservationRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -319,8 +317,6 @@ DefaultReservationsRestStub::SetIamPolicy( google::cloud::cpp::compute::reservations::v1::SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.zone_set_policy_request_resource(), false, @@ -339,8 +335,6 @@ DefaultReservationsRestStub::TestIamPermissions( google::cloud::cpp::compute::reservations::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.cc b/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.cc index c5a59f6200d45..f0ba2ea4aa1c6 100644 --- a/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.cc +++ b/google/cloud/compute/resource_policies/v1/internal/resource_policies_rest_stub.cc @@ -141,8 +141,6 @@ DefaultResourcePoliciesRestStub::GetResourcePolicy( google::cloud::cpp::compute::resource_policies::v1:: GetResourcePolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -326,8 +324,6 @@ DefaultResourcePoliciesRestStub::SetIamPolicy( google::cloud::cpp::compute::resource_policies::v1:: SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_policy_request_resource(), false, @@ -346,8 +342,6 @@ DefaultResourcePoliciesRestStub::TestIamPermissions( google::cloud::cpp::compute::resource_policies::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/routers/v1/internal/routers_rest_stub.cc b/google/cloud/compute/routers/v1/internal/routers_rest_stub.cc index 984a468952ccf..ab59c10d26a63 100644 --- a/google/cloud/compute/routers/v1/internal/routers_rest_stub.cc +++ b/google/cloud/compute/routers/v1/internal/routers_rest_stub.cc @@ -137,8 +137,6 @@ DefaultRoutersRestStub::GetRouter( Options const& options, google::cloud::cpp::compute::routers::v1::GetRouterRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -203,8 +201,6 @@ DefaultRoutersRestStub::GetRouterStatus( google::cloud::cpp::compute::routers::v1::GetRouterStatusRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::RouterStatusResponse>( *service_, rest_context, request, false, @@ -358,8 +354,6 @@ DefaultRoutersRestStub::Preview( Options const& options, google::cloud::cpp::compute::routers::v1::PreviewRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::RoutersPreviewResponse>( *service_, rest_context, request.router_resource(), false, diff --git a/google/cloud/compute/routes/v1/internal/routes_rest_stub.cc b/google/cloud/compute/routes/v1/internal/routes_rest_stub.cc index 3df4c92f681d6..d0fff81074c4e 100644 --- a/google/cloud/compute/routes/v1/internal/routes_rest_stub.cc +++ b/google/cloud/compute/routes/v1/internal/routes_rest_stub.cc @@ -106,8 +106,6 @@ DefaultRoutesRestStub::GetRoute( Options const& options, google::cloud::cpp::compute::routes::v1::GetRouteRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.cc b/google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.cc index a08b0b3126da2..be4f6427460df 100644 --- a/google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.cc +++ b/google/cloud/compute/security_policies/v1/internal/security_policies_rest_stub.cc @@ -199,8 +199,6 @@ DefaultSecurityPoliciesRestStub::GetSecurityPolicy( google::cloud::cpp::compute::security_policies::v1:: GetSecurityPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -482,8 +480,6 @@ DefaultSecurityPoliciesRestStub::AsyncRemoveRule( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, request, false, @@ -512,8 +508,6 @@ DefaultSecurityPoliciesRestStub::RemoveRule( google::cloud::cpp::compute::security_policies::v1::RemoveRuleRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -537,8 +531,6 @@ DefaultSecurityPoliciesRestStub::AsyncSetLabels( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -568,8 +560,6 @@ DefaultSecurityPoliciesRestStub::SetLabels( google::cloud::cpp::compute::security_policies::v1::SetLabelsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_labels_request_resource(), false, diff --git a/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.cc b/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.cc index e9bbdcaaceef5..9506c084d0663 100644 --- a/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.cc +++ b/google/cloud/compute/service_attachments/v1/internal/service_attachments_rest_stub.cc @@ -141,8 +141,6 @@ DefaultServiceAttachmentsRestStub::GetServiceAttachment( google::cloud::cpp::compute::service_attachments::v1:: GetServiceAttachmentRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -324,8 +322,6 @@ DefaultServiceAttachmentsRestStub::SetIamPolicy( google::cloud::cpp::compute::service_attachments::v1:: SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_policy_request_resource(), false, @@ -344,8 +340,6 @@ DefaultServiceAttachmentsRestStub::TestIamPermissions( google::cloud::cpp::compute::service_attachments::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.cc b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.cc index d53f85609991f..87279b266ce64 100644 --- a/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.cc +++ b/google/cloud/compute/snapshot_settings/v1/internal/snapshot_settings_rest_stub.cc @@ -53,8 +53,6 @@ DefaultSnapshotSettingsRestStub::GetSnapshotSettings( google::cloud::cpp::compute::snapshot_settings::v1:: GetSnapshotSettingsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.cc b/google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.cc index 4ec2cc0743589..814221457f5e5 100644 --- a/google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.cc +++ b/google/cloud/compute/snapshots/v1/internal/snapshots_rest_stub.cc @@ -108,8 +108,6 @@ DefaultSnapshotsRestStub::GetSnapshot( google::cloud::cpp::compute::snapshots::v1::GetSnapshotRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -227,8 +225,6 @@ DefaultSnapshotsRestStub::SetIamPolicy( google::cloud::cpp::compute::snapshots::v1::SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_policy_request_resource(), false, @@ -252,8 +248,6 @@ DefaultSnapshotsRestStub::AsyncSetLabels( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value( rest_internal::Post( *service, *rest_context, @@ -283,8 +277,6 @@ DefaultSnapshotsRestStub::SetLabels( google::cloud::cpp::compute::snapshots::v1::SetLabelsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.global_set_labels_request_resource(), false, @@ -302,8 +294,6 @@ DefaultSnapshotsRestStub::TestIamPermissions( google::cloud::cpp::compute::snapshots::v1::TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.cc b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.cc index 93de7f1c28b66..f2a92215a56f9 100644 --- a/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.cc +++ b/google/cloud/compute/ssl_certificates/v1/internal/ssl_certificates_rest_stub.cc @@ -138,8 +138,6 @@ DefaultSslCertificatesRestStub::GetSslCertificate( google::cloud::cpp::compute::ssl_certificates::v1:: GetSslCertificateRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.cc b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.cc index 8608bf85b2738..8487fbf07d40e 100644 --- a/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.cc +++ b/google/cloud/compute/ssl_policies/v1/internal/ssl_policies_rest_stub.cc @@ -138,8 +138,6 @@ DefaultSslPoliciesRestStub::GetSslPolicy( google::cloud::cpp::compute::ssl_policies::v1::GetSslPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_stub.cc b/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_stub.cc index ae0c0690de178..28b70f327f00e 100644 --- a/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_stub.cc +++ b/google/cloud/compute/storage_pool_types/v1/internal/storage_pool_types_rest_stub.cc @@ -77,8 +77,6 @@ DefaultStoragePoolTypesRestStub::GetStoragePoolType( google::cloud::cpp::compute::storage_pool_types::v1:: GetStoragePoolTypeRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.cc b/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.cc index 0319ad0a0938c..6b4ebe5fe9e77 100644 --- a/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.cc +++ b/google/cloud/compute/storage_pools/v1/internal/storage_pools_rest_stub.cc @@ -139,8 +139,6 @@ DefaultStoragePoolsRestStub::GetStoragePool( google::cloud::cpp::compute::storage_pools::v1::GetStoragePoolRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -287,8 +285,6 @@ DefaultStoragePoolsRestStub::SetIamPolicy( google::cloud::cpp::compute::storage_pools::v1::SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.zone_set_policy_request_resource(), false, @@ -307,8 +303,6 @@ DefaultStoragePoolsRestStub::TestIamPermissions( google::cloud::cpp::compute::storage_pools::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.cc b/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.cc index 1e49654b7b158..9ed1f5bc9e6b7 100644 --- a/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.cc +++ b/google/cloud/compute/subnetworks/v1/internal/subnetworks_rest_stub.cc @@ -200,8 +200,6 @@ DefaultSubnetworksRestStub::GetSubnetwork( google::cloud::cpp::compute::subnetworks::v1::GetSubnetworkRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -410,8 +408,6 @@ DefaultSubnetworksRestStub::SetIamPolicy( google::cloud::cpp::compute::subnetworks::v1::SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.region_set_policy_request_resource(), false, @@ -492,8 +488,6 @@ DefaultSubnetworksRestStub::TestIamPermissions( google::cloud::cpp::compute::subnetworks::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.cc b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.cc index 804f60c5449e7..66fbcb7c4b237 100644 --- a/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.cc +++ b/google/cloud/compute/target_grpc_proxies/v1/internal/target_grpc_proxies_rest_stub.cc @@ -109,8 +109,6 @@ DefaultTargetGrpcProxiesRestStub::GetTargetGrpcProxy( google::cloud::cpp::compute::target_grpc_proxies::v1:: GetTargetGrpcProxyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.cc b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.cc index 055fc7c9c5d5c..12b5e8a5e5cea 100644 --- a/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.cc +++ b/google/cloud/compute/target_http_proxies/v1/internal/target_http_proxies_rest_stub.cc @@ -139,8 +139,6 @@ DefaultTargetHttpProxiesRestStub::GetTargetHttpProxy( google::cloud::cpp::compute::target_http_proxies::v1:: GetTargetHttpProxyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.cc b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.cc index e48d411002d1e..b944461c8df24 100644 --- a/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.cc +++ b/google/cloud/compute/target_https_proxies/v1/internal/target_https_proxies_rest_stub.cc @@ -140,8 +140,6 @@ DefaultTargetHttpsProxiesRestStub::GetTargetHttpsProxy( google::cloud::cpp::compute::target_https_proxies::v1:: GetTargetHttpsProxyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.cc b/google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.cc index b808595e175d8..3404912888203 100644 --- a/google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.cc +++ b/google/cloud/compute/target_instances/v1/internal/target_instances_rest_stub.cc @@ -139,8 +139,6 @@ DefaultTargetInstancesRestStub::GetTargetInstance( google::cloud::cpp::compute::target_instances::v1:: GetTargetInstanceRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.cc b/google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.cc index dd3ace50e3dad..b1473a9493ec4 100644 --- a/google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.cc +++ b/google/cloud/compute/target_pools/v1/internal/target_pools_rest_stub.cc @@ -259,8 +259,6 @@ DefaultTargetPoolsRestStub::GetTargetPool( google::cloud::cpp::compute::target_pools::v1::GetTargetPoolRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -278,8 +276,6 @@ DefaultTargetPoolsRestStub::GetHealth( google::cloud::cpp::compute::target_pools::v1::GetHealthRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TargetPoolInstanceHealth>( *service_, rest_context, request.instance_reference_resource(), false, diff --git a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.cc b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.cc index d0f88dd0e89f3..7f45b90ab5bc1 100644 --- a/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.cc +++ b/google/cloud/compute/target_ssl_proxies/v1/internal/target_ssl_proxies_rest_stub.cc @@ -109,8 +109,6 @@ DefaultTargetSslProxiesRestStub::GetTargetSslProxy( google::cloud::cpp::compute::target_ssl_proxies::v1:: GetTargetSslProxyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.cc b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.cc index 8e5d81d6d53a3..fb0b05a9f65bc 100644 --- a/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.cc +++ b/google/cloud/compute/target_tcp_proxies/v1/internal/target_tcp_proxies_rest_stub.cc @@ -139,8 +139,6 @@ DefaultTargetTcpProxiesRestStub::GetTargetTcpProxy( google::cloud::cpp::compute::target_tcp_proxies::v1:: GetTargetTcpProxyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.cc b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.cc index fca0c7ba5fc47..1b735cc8bb792 100644 --- a/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.cc +++ b/google/cloud/compute/target_vpn_gateways/v1/internal/target_vpn_gateways_rest_stub.cc @@ -141,8 +141,6 @@ DefaultTargetVpnGatewaysRestStub::GetTargetVpnGateway( google::cloud::cpp::compute::target_vpn_gateways::v1:: GetTargetVpnGatewayRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.cc b/google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.cc index 6daf7de309734..a7268e89a6cc2 100644 --- a/google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.cc +++ b/google/cloud/compute/url_maps/v1/internal/url_maps_rest_stub.cc @@ -137,8 +137,6 @@ DefaultUrlMapsRestStub::GetUrlMap( google::cloud::cpp::compute::url_maps::v1::GetUrlMapRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -402,8 +400,6 @@ DefaultUrlMapsRestStub::Validate( Options const& options, google::cloud::cpp::compute::url_maps::v1::ValidateRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::UrlMapsValidateResponse>( *service_, rest_context, request.url_maps_validate_request_resource(), diff --git a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.cc b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.cc index daadd17a7c8ac..ea1ead991e1af 100644 --- a/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.cc +++ b/google/cloud/compute/vpn_gateways/v1/internal/vpn_gateways_rest_stub.cc @@ -139,8 +139,6 @@ DefaultVpnGatewaysRestStub::GetVpnGateway( google::cloud::cpp::compute::vpn_gateways::v1::GetVpnGatewayRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -158,8 +156,6 @@ DefaultVpnGatewaysRestStub::GetStatus( google::cloud::cpp::compute::vpn_gateways::v1::GetStatusRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::cpp::compute::v1::VpnGatewaysGetStatusResponse>( *service_, rest_context, request, false, @@ -319,8 +315,6 @@ DefaultVpnGatewaysRestStub::TestIamPermissions( google::cloud::cpp::compute::vpn_gateways::v1:: TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::cpp::compute::v1::TestPermissionsResponse>( *service_, rest_context, request.test_permissions_request_resource(), diff --git a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.cc b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.cc index 2f5beb8956faf..1b88c250ed773 100644 --- a/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.cc +++ b/google/cloud/compute/vpn_tunnels/v1/internal/vpn_tunnels_rest_stub.cc @@ -139,8 +139,6 @@ DefaultVpnTunnelsRestStub::GetVpnTunnel( google::cloud::cpp::compute::vpn_tunnels::v1::GetVpnTunnelRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.cc b/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.cc index 9e989383cea0e..b8598bda34eb2 100644 --- a/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.cc +++ b/google/cloud/compute/zone_operations/v1/internal/zone_operations_rest_stub.cc @@ -45,8 +45,6 @@ Status DefaultZoneOperationsRestStub::DeleteOperation( google::cloud::cpp::compute::zone_operations::v1:: DeleteOperationRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -63,8 +61,6 @@ DefaultZoneOperationsRestStub::GetOperation( google::cloud::cpp::compute::zone_operations::v1::GetOperationRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", @@ -106,8 +102,6 @@ DefaultZoneOperationsRestStub::Wait( google::cloud::cpp::compute::zone_operations::v1::WaitRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/compute/zones/v1/internal/zones_rest_stub.cc b/google/cloud/compute/zones/v1/internal/zones_rest_stub.cc index 54bfe64a96c2b..ec35fce04a606 100644 --- a/google/cloud/compute/zones/v1/internal/zones_rest_stub.cc +++ b/google/cloud/compute/zones/v1/internal/zones_rest_stub.cc @@ -44,8 +44,6 @@ StatusOr DefaultZonesRestStub::GetZone( Options const& options, google::cloud::cpp::compute::zones::v1::GetZoneRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", "compute", "/", diff --git a/google/cloud/spanner/admin/internal/database_admin_rest_stub.cc b/google/cloud/spanner/admin/internal/database_admin_rest_stub.cc index e1f84c25d45cb..5ced75e24d78c 100644 --- a/google/cloud/spanner/admin/internal/database_admin_rest_stub.cc +++ b/google/cloud/spanner/admin/internal/database_admin_rest_stub.cc @@ -75,8 +75,6 @@ DefaultDatabaseAdminRestStub::AsyncCreateDatabase( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request, false, absl::StrCat("/", @@ -102,8 +100,6 @@ DefaultDatabaseAdminRestStub::CreateDatabase( google::spanner::admin::database::v1::CreateDatabaseRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -117,8 +113,6 @@ DefaultDatabaseAdminRestStub::GetDatabase( Options const& options, google::spanner::admin::database::v1::GetDatabaseRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -138,8 +132,6 @@ DefaultDatabaseAdminRestStub::AsyncUpdateDatabase( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Patch( *service, *rest_context, request.database(), false, absl::StrCat("/", @@ -165,8 +157,6 @@ DefaultDatabaseAdminRestStub::UpdateDatabase( google::spanner::admin::database::v1::UpdateDatabaseRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.database(), false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -186,8 +176,6 @@ DefaultDatabaseAdminRestStub::AsyncUpdateDatabaseDdl( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Patch( *service, *rest_context, request, false, absl::StrCat("/", @@ -213,8 +201,6 @@ DefaultDatabaseAdminRestStub::UpdateDatabaseDdl( google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -227,8 +213,6 @@ Status DefaultDatabaseAdminRestStub::DropDatabase( Options const& options, google::spanner::admin::database::v1::DropDatabaseRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -243,8 +227,6 @@ DefaultDatabaseAdminRestStub::GetDatabaseDdl( google::spanner::admin::database::v1::GetDatabaseDdlRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::spanner::admin::database::v1::GetDatabaseDdlResponse>( *service_, rest_context, request, false, @@ -258,8 +240,6 @@ StatusOr DefaultDatabaseAdminRestStub::SetIamPolicy( Options const& options, google::iam::v1::SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -272,8 +252,6 @@ StatusOr DefaultDatabaseAdminRestStub::GetIamPolicy( Options const& options, google::iam::v1::GetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -287,8 +265,6 @@ DefaultDatabaseAdminRestStub::TestIamPermissions( Options const& options, google::iam::v1::TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -355,8 +331,6 @@ DefaultDatabaseAdminRestStub::AsyncCopyBackup( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request, false, absl::StrCat("/", @@ -381,8 +355,6 @@ DefaultDatabaseAdminRestStub::CopyBackup( Options const& options, google::spanner::admin::database::v1::CopyBackupRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -396,8 +368,6 @@ DefaultDatabaseAdminRestStub::GetBackup( Options const& options, google::spanner::admin::database::v1::GetBackupRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -411,8 +381,6 @@ DefaultDatabaseAdminRestStub::UpdateBackup( Options const& options, google::spanner::admin::database::v1::UpdateBackupRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.backup(), false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -425,8 +393,6 @@ Status DefaultDatabaseAdminRestStub::DeleteBackup( Options const& options, google::spanner::admin::database::v1::DeleteBackupRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -465,8 +431,6 @@ DefaultDatabaseAdminRestStub::AsyncRestoreDatabase( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request, false, absl::StrCat("/", @@ -492,8 +456,6 @@ DefaultDatabaseAdminRestStub::RestoreDatabase( google::spanner::admin::database::v1::RestoreDatabaseRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -585,8 +547,6 @@ DefaultDatabaseAdminRestStub::GetBackupSchedule( google::spanner::admin::database::v1::GetBackupScheduleRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::spanner::admin::database::v1::BackupSchedule>( *service_, rest_context, request, false, @@ -602,8 +562,6 @@ DefaultDatabaseAdminRestStub::UpdateBackupSchedule( google::spanner::admin::database::v1::UpdateBackupScheduleRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch< google::spanner::admin::database::v1::BackupSchedule>( *service_, rest_context, request.backup_schedule(), false, @@ -618,8 +576,6 @@ Status DefaultDatabaseAdminRestStub::DeleteBackupSchedule( google::spanner::admin::database::v1::DeleteBackupScheduleRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", diff --git a/google/cloud/spanner/admin/internal/instance_admin_rest_stub.cc b/google/cloud/spanner/admin/internal/instance_admin_rest_stub.cc index 6fab9f989cfed..9d0de2e446368 100644 --- a/google/cloud/spanner/admin/internal/instance_admin_rest_stub.cc +++ b/google/cloud/spanner/admin/internal/instance_admin_rest_stub.cc @@ -71,8 +71,6 @@ DefaultInstanceAdminRestStub::GetInstanceConfig( google::spanner::admin::instance::v1::GetInstanceConfigRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::spanner::admin::instance::v1::InstanceConfig>( *service_, rest_context, request, false, @@ -93,8 +91,6 @@ DefaultInstanceAdminRestStub::AsyncCreateInstanceConfig( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request, false, absl::StrCat("/", @@ -120,8 +116,6 @@ DefaultInstanceAdminRestStub::CreateInstanceConfig( google::spanner::admin::instance::v1::CreateInstanceConfigRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -141,8 +135,6 @@ DefaultInstanceAdminRestStub::AsyncUpdateInstanceConfig( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Patch( *service, *rest_context, request, false, absl::StrCat("/", @@ -168,8 +160,6 @@ DefaultInstanceAdminRestStub::UpdateInstanceConfig( google::spanner::admin::instance::v1::UpdateInstanceConfigRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -260,8 +250,6 @@ DefaultInstanceAdminRestStub::GetInstance( Options const& options, google::spanner::admin::instance::v1::GetInstanceRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -281,8 +269,6 @@ DefaultInstanceAdminRestStub::AsyncCreateInstance( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request, false, absl::StrCat("/", @@ -308,8 +294,6 @@ DefaultInstanceAdminRestStub::CreateInstance( google::spanner::admin::instance::v1::CreateInstanceRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -329,8 +313,6 @@ DefaultInstanceAdminRestStub::AsyncUpdateInstance( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Patch( *service, *rest_context, request, false, absl::StrCat("/", @@ -356,8 +338,6 @@ DefaultInstanceAdminRestStub::UpdateInstance( google::spanner::admin::instance::v1::UpdateInstanceRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -371,8 +351,6 @@ Status DefaultInstanceAdminRestStub::DeleteInstance( google::spanner::admin::instance::v1::DeleteInstanceRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -385,8 +363,6 @@ StatusOr DefaultInstanceAdminRestStub::SetIamPolicy( Options const& options, google::iam::v1::SetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -399,8 +375,6 @@ StatusOr DefaultInstanceAdminRestStub::GetIamPolicy( Options const& options, google::iam::v1::GetIamPolicyRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -414,8 +388,6 @@ DefaultInstanceAdminRestStub::TestIamPermissions( Options const& options, google::iam::v1::TestIamPermissionsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -430,8 +402,6 @@ DefaultInstanceAdminRestStub::GetInstancePartition( google::spanner::admin::instance::v1::GetInstancePartitionRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::spanner::admin::instance::v1::InstancePartition>( *service_, rest_context, request, false, @@ -452,8 +422,6 @@ DefaultInstanceAdminRestStub::AsyncCreateInstancePartition( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Post( *service, *rest_context, request, false, absl::StrCat("/", @@ -479,8 +447,6 @@ DefaultInstanceAdminRestStub::CreateInstancePartition( google::spanner::admin::instance::v1::CreateInstancePartitionRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -516,8 +482,6 @@ DefaultInstanceAdminRestStub::AsyncUpdateInstancePartition( std::thread t{ [](auto p, auto service, auto request, auto rest_context, auto options) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); p.set_value(rest_internal::Patch( *service, *rest_context, request, false, absl::StrCat("/", @@ -543,8 +507,6 @@ DefaultInstanceAdminRestStub::UpdateInstancePartition( google::spanner::admin::instance::v1::UpdateInstancePartitionRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request, false, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", diff --git a/google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.cc b/google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.cc index 4eec39233f07e..2ff96a76cb088 100644 --- a/google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_backup_runs_rest_stub.cc @@ -46,8 +46,6 @@ DefaultSqlBackupRunsServiceRestStub::Delete( Options const& options, google::cloud::sql::v1::SqlBackupRunsDeleteRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -62,8 +60,6 @@ DefaultSqlBackupRunsServiceRestStub::Get( Options const& options, google::cloud::sql::v1::SqlBackupRunsGetRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -78,8 +74,6 @@ DefaultSqlBackupRunsServiceRestStub::Insert( Options const& options, google::cloud::sql::v1::SqlBackupRunsInsertRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", diff --git a/google/cloud/sql/v1/internal/sql_connect_rest_stub.cc b/google/cloud/sql/v1/internal/sql_connect_rest_stub.cc index d557e375840d8..fa81b309f37fb 100644 --- a/google/cloud/sql/v1/internal/sql_connect_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_connect_rest_stub.cc @@ -46,8 +46,6 @@ DefaultSqlConnectServiceRestStub::GetConnectSettings( Options const& options, google::cloud::sql::v1::GetConnectSettingsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -62,8 +60,6 @@ DefaultSqlConnectServiceRestStub::GenerateEphemeralCert( Options const& options, google::cloud::sql::v1::GenerateEphemeralCertRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::sql::v1::GenerateEphemeralCertResponse>( *service_, rest_context, request, true, diff --git a/google/cloud/sql/v1/internal/sql_databases_rest_stub.cc b/google/cloud/sql/v1/internal/sql_databases_rest_stub.cc index 17fdb6e04d586..75c1bb1a1a041 100644 --- a/google/cloud/sql/v1/internal/sql_databases_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_databases_rest_stub.cc @@ -46,8 +46,6 @@ DefaultSqlDatabasesServiceRestStub::Delete( Options const& options, google::cloud::sql::v1::SqlDatabasesDeleteRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -63,8 +61,6 @@ DefaultSqlDatabasesServiceRestStub::Get( Options const& options, google::cloud::sql::v1::SqlDatabasesGetRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -80,8 +76,6 @@ DefaultSqlDatabasesServiceRestStub::Insert( Options const& options, google::cloud::sql::v1::SqlDatabasesInsertRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -96,8 +90,6 @@ DefaultSqlDatabasesServiceRestStub::List( Options const& options, google::cloud::sql::v1::SqlDatabasesListRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -112,8 +104,6 @@ DefaultSqlDatabasesServiceRestStub::Patch( Options const& options, google::cloud::sql::v1::SqlDatabasesUpdateRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -129,8 +119,6 @@ DefaultSqlDatabasesServiceRestStub::Update( Options const& options, google::cloud::sql::v1::SqlDatabasesUpdateRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", diff --git a/google/cloud/sql/v1/internal/sql_instances_rest_stub.cc b/google/cloud/sql/v1/internal/sql_instances_rest_stub.cc index 30132f7f06d35..23892dd8295d8 100644 --- a/google/cloud/sql/v1/internal/sql_instances_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_instances_rest_stub.cc @@ -46,8 +46,6 @@ DefaultSqlInstancesServiceRestStub::AddServerCa( Options const& options, google::cloud::sql::v1::SqlInstancesAddServerCaRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -62,8 +60,6 @@ DefaultSqlInstancesServiceRestStub::Clone( Options const& options, google::cloud::sql::v1::SqlInstancesCloneRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -78,8 +74,6 @@ DefaultSqlInstancesServiceRestStub::Delete( Options const& options, google::cloud::sql::v1::SqlInstancesDeleteRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -94,8 +88,6 @@ DefaultSqlInstancesServiceRestStub::DemoteMaster( Options const& options, google::cloud::sql::v1::SqlInstancesDemoteMasterRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -110,8 +102,6 @@ DefaultSqlInstancesServiceRestStub::Demote( Options const& options, google::cloud::sql::v1::SqlInstancesDemoteRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -126,8 +116,6 @@ DefaultSqlInstancesServiceRestStub::Export( Options const& options, google::cloud::sql::v1::SqlInstancesExportRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -142,8 +130,6 @@ DefaultSqlInstancesServiceRestStub::Failover( Options const& options, google::cloud::sql::v1::SqlInstancesFailoverRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -158,8 +144,6 @@ DefaultSqlInstancesServiceRestStub::Reencrypt( Options const& options, google::cloud::sql::v1::SqlInstancesReencryptRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -174,8 +158,6 @@ DefaultSqlInstancesServiceRestStub::Get( Options const& options, google::cloud::sql::v1::SqlInstancesGetRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -190,8 +172,6 @@ DefaultSqlInstancesServiceRestStub::Import( Options const& options, google::cloud::sql::v1::SqlInstancesImportRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -206,8 +186,6 @@ DefaultSqlInstancesServiceRestStub::Insert( Options const& options, google::cloud::sql::v1::SqlInstancesInsertRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -240,8 +218,6 @@ DefaultSqlInstancesServiceRestStub::ListServerCas( Options const& options, google::cloud::sql::v1::SqlInstancesListServerCasRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::sql::v1::InstancesListServerCasResponse>( *service_, rest_context, request, true, @@ -257,8 +233,6 @@ DefaultSqlInstancesServiceRestStub::Patch( Options const& options, google::cloud::sql::v1::SqlInstancesPatchRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Patch( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -290,8 +264,6 @@ DefaultSqlInstancesServiceRestStub::Switchover( Options const& options, google::cloud::sql::v1::SqlInstancesSwitchoverRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -306,8 +278,6 @@ DefaultSqlInstancesServiceRestStub::ResetSslConfig( Options const& options, google::cloud::sql::v1::SqlInstancesResetSslConfigRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -322,8 +292,6 @@ DefaultSqlInstancesServiceRestStub::Restart( Options const& options, google::cloud::sql::v1::SqlInstancesRestartRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -338,8 +306,6 @@ DefaultSqlInstancesServiceRestStub::RestoreBackup( Options const& options, google::cloud::sql::v1::SqlInstancesRestoreBackupRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -354,8 +320,6 @@ DefaultSqlInstancesServiceRestStub::RotateServerCa( Options const& options, google::cloud::sql::v1::SqlInstancesRotateServerCaRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -370,8 +334,6 @@ DefaultSqlInstancesServiceRestStub::StartReplica( Options const& options, google::cloud::sql::v1::SqlInstancesStartReplicaRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -386,8 +348,6 @@ DefaultSqlInstancesServiceRestStub::StopReplica( Options const& options, google::cloud::sql::v1::SqlInstancesStopReplicaRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -402,8 +362,6 @@ DefaultSqlInstancesServiceRestStub::TruncateLog( Options const& options, google::cloud::sql::v1::SqlInstancesTruncateLogRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -418,8 +376,6 @@ DefaultSqlInstancesServiceRestStub::Update( Options const& options, google::cloud::sql::v1::SqlInstancesUpdateRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Put( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -435,8 +391,6 @@ DefaultSqlInstancesServiceRestStub::CreateEphemeral( google::cloud::sql::v1::SqlInstancesCreateEphemeralCertRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -452,8 +406,6 @@ DefaultSqlInstancesServiceRestStub::RescheduleMaintenance( google::cloud::sql::v1::SqlInstancesRescheduleMaintenanceRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -469,8 +421,6 @@ DefaultSqlInstancesServiceRestStub::VerifyExternalSyncSettings( google::cloud::sql::v1::SqlInstancesVerifyExternalSyncSettingsRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::sql::v1::SqlInstancesVerifyExternalSyncSettingsResponse>( *service_, rest_context, request, true, @@ -487,8 +437,6 @@ DefaultSqlInstancesServiceRestStub::StartExternalSync( google::cloud::sql::v1::SqlInstancesStartExternalSyncRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -504,8 +452,6 @@ DefaultSqlInstancesServiceRestStub::PerformDiskShrink( google::cloud::sql::v1::SqlInstancesPerformDiskShrinkRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -521,8 +467,6 @@ DefaultSqlInstancesServiceRestStub::GetDiskShrinkConfig( google::cloud::sql::v1::SqlInstancesGetDiskShrinkConfigRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::sql::v1::SqlInstancesGetDiskShrinkConfigResponse>( *service_, rest_context, request, true, @@ -539,8 +483,6 @@ DefaultSqlInstancesServiceRestStub::ResetReplicaSize( google::cloud::sql::v1::SqlInstancesResetReplicaSizeRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -556,8 +498,6 @@ DefaultSqlInstancesServiceRestStub::GetLatestRecoveryTime( google::cloud::sql::v1::SqlInstancesGetLatestRecoveryTimeRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get< google::cloud::sql::v1::SqlInstancesGetLatestRecoveryTimeResponse>( *service_, rest_context, request, true, @@ -574,8 +514,6 @@ DefaultSqlInstancesServiceRestStub::AcquireSsrsLease( google::cloud::sql::v1::SqlInstancesAcquireSsrsLeaseRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::sql::v1::SqlInstancesAcquireSsrsLeaseResponse>( *service_, rest_context, request.body(), true, @@ -592,8 +530,6 @@ DefaultSqlInstancesServiceRestStub::ReleaseSsrsLease( google::cloud::sql::v1::SqlInstancesReleaseSsrsLeaseRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post< google::cloud::sql::v1::SqlInstancesReleaseSsrsLeaseResponse>( *service_, rest_context, request, true, diff --git a/google/cloud/sql/v1/internal/sql_operations_rest_stub.cc b/google/cloud/sql/v1/internal/sql_operations_rest_stub.cc index a38b52b30129f..c3133516e26ce 100644 --- a/google/cloud/sql/v1/internal/sql_operations_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_operations_rest_stub.cc @@ -46,8 +46,6 @@ DefaultSqlOperationsServiceRestStub::Get( Options const& options, google::cloud::sql::v1::SqlOperationsGetRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -80,8 +78,6 @@ Status DefaultSqlOperationsServiceRestStub::Cancel( Options const& options, google::cloud::sql::v1::SqlOperationsCancelRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", diff --git a/google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.cc b/google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.cc index 7cd0e527c17f7..35e7275be1be4 100644 --- a/google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_ssl_certs_rest_stub.cc @@ -46,8 +46,6 @@ DefaultSqlSslCertsServiceRestStub::Delete( Options const& options, google::cloud::sql::v1::SqlSslCertsDeleteRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Delete( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -63,8 +61,6 @@ DefaultSqlSslCertsServiceRestStub::Get( Options const& options, google::cloud::sql::v1::SqlSslCertsGetRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -80,8 +76,6 @@ DefaultSqlSslCertsServiceRestStub::Insert( Options const& options, google::cloud::sql::v1::SqlSslCertsInsertRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -96,8 +90,6 @@ DefaultSqlSslCertsServiceRestStub::List( Options const& options, google::cloud::sql::v1::SqlSslCertsListRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", diff --git a/google/cloud/sql/v1/internal/sql_tiers_rest_stub.cc b/google/cloud/sql/v1/internal/sql_tiers_rest_stub.cc index 25f3ce65c3776..4df4e634f7dcd 100644 --- a/google/cloud/sql/v1/internal/sql_tiers_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_tiers_rest_stub.cc @@ -45,8 +45,6 @@ DefaultSqlTiersServiceRestStub::List( Options const& options, google::cloud::sql::v1::SqlTiersListRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", diff --git a/google/cloud/sql/v1/internal/sql_users_rest_stub.cc b/google/cloud/sql/v1/internal/sql_users_rest_stub.cc index 69075ede61999..9ca7a082c3ecc 100644 --- a/google/cloud/sql/v1/internal/sql_users_rest_stub.cc +++ b/google/cloud/sql/v1/internal/sql_users_rest_stub.cc @@ -79,8 +79,6 @@ DefaultSqlUsersServiceRestStub::Insert( Options const& options, google::cloud::sql::v1::SqlUsersInsertRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Post( *service_, rest_context, request.body(), true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/", @@ -95,8 +93,6 @@ DefaultSqlUsersServiceRestStub::List( Options const& options, google::cloud::sql::v1::SqlUsersListRequest const& request) { std::vector> query_params; - query_params = - rest_internal::TrimEmptyQueryParameters(std::move(query_params)); return rest_internal::Get( *service_, rest_context, request, true, absl::StrCat("/", rest_internal::DetermineApiVersion("v1", options), "/",