diff --git a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/common/ServiceClientConfigurationSource.vm b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/common/ServiceClientConfigurationSource.vm index a4b9ee14aef7..8852e0290bc3 100644 --- a/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/common/ServiceClientConfigurationSource.vm +++ b/tools/code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/common/ServiceClientConfigurationSource.vm @@ -6,6 +6,7 @@ #set($endpointPrefix = $metadata.endpointPrefix) #set($serviceNameCaps = $metadata.serviceId.replaceAll("[^a-zA-Z\d]+", "_").toUpperCase()) \#include + #if($serviceNamespace == "S3Crt") \#include \#include @@ -71,9 +72,11 @@ bool IsEndpointDiscoveryEnabled(const Aws::String& endpointOverride, const Aws:: } #end +#set($inputProfileNameUsed = false) void ${metadata.classNamePrefix}ClientConfiguration::Load${serviceNamespace}SpecificConfig(const Aws::String& inputProfileName) { #if($serviceModel.metadata.serviceId == "S3") +#set($inputProfileNameUsed = true) if (Aws::${serviceNamespace}::US_EAST_1_REGIONAL_ENDPOINT_OPTION::NOT_SET == this->useUSEast1RegionalEndPointOption) { const Aws::String& useUSEastOption = @@ -111,6 +114,7 @@ void ${metadata.classNamePrefix}ClientConfiguration::Load${serviceNamespace}Spec #end #if($serviceModel.metadata.serviceId == "S3" || $serviceModel.metadata.serviceId == "S3 Control") +#set($inputProfileNameUsed = true) Aws::String useArnRegionCfg = ClientConfiguration::LoadConfigFromEnvOrProfile(S3_USE_ARN_REGION_ENVIRONMENT_VARIABLE, inputProfileName, S3_USE_ARN_REGION_CONFIG_FILE_OPTION, @@ -122,6 +126,7 @@ void ${metadata.classNamePrefix}ClientConfiguration::Load${serviceNamespace}Spec } #end #if($metadata.hasEndpointDiscoveryTrait) +#set($inputProfileNameUsed = true) if(!enableEndpointDiscovery) { enableEndpointDiscovery = IsEndpointDiscoveryEnabled(this->endpointOverride, inputProfileName); } @@ -137,6 +142,7 @@ void ${metadata.classNamePrefix}ClientConfiguration::Load${serviceNamespace}Spec #end ## Bedrock API key auth #if($serviceModel.metadata.signingName == "bedrock") +#set($inputProfileNameUsed = true) const Aws::String& bedrockToken = BaseClientConfigClass::LoadConfigFromEnvOrProfile(AWS_BEARER_TOKEN_BEDROCK, inputProfileName, @@ -151,6 +157,14 @@ void ${metadata.classNamePrefix}ClientConfiguration::Load${serviceNamespace}Spec authPreferences.insert(authPreferences.begin(), "bearer"); } #end +#if(!$inputProfileNameUsed) +\#if defined(_MSC_VER) +\#define AWS_UNREFERENCED_PARAM(x) (&reinterpret_cast(x)) +\#else +\#define AWS_UNREFERENCED_PARAM(x) ((void)(x)) +#endif + AWS_UNREFERENCED_PARAM(inputProfileName); +#end } ${metadata.classNamePrefix}ClientConfiguration::${metadata.classNamePrefix}ClientConfiguration(const Aws::Client::ClientConfigurationInitValues &configuration)