Skip to content

Commit

Permalink
Regenerate few clients for describe endpoints default update
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyRyabinin committed Aug 1, 2024
1 parent 653eafc commit 25ffa82
Show file tree
Hide file tree
Showing 28 changed files with 585 additions and 186 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using Aws::Endpoint::DefaultEndpointProvider;

using CognitoIdentityProviderClientContextParameters = Aws::Endpoint::ClientContextParameters;

using CognitoIdentityProviderClientConfiguration = Aws::Client::GenericClientConfiguration<false>;
using CognitoIdentityProviderClientConfiguration = Aws::Client::GenericClientConfiguration;
using CognitoIdentityProviderBuiltInParameters = Aws::Endpoint::BuiltInParameters;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ namespace Aws

namespace CognitoIdentityProvider
{
using CognitoIdentityProviderClientConfiguration = Aws::Client::GenericClientConfiguration<false>;
using CognitoIdentityProviderClientConfiguration = Aws::Client::GenericClientConfiguration;
using CognitoIdentityProviderEndpointProviderBase = Aws::CognitoIdentityProvider::Endpoint::CognitoIdentityProviderEndpointProviderBase;
using CognitoIdentityProviderEndpointProvider = Aws::CognitoIdentityProvider::Endpoint::CognitoIdentityProviderEndpointProvider;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once

#include <aws/dynamodb/DynamoDB_EXPORTS.h>
#include <aws/core/client/GenericClientConfiguration.h>


namespace Aws
{
namespace DynamoDB
{
struct AWS_DYNAMODB_API DynamoDBClientConfiguration : public Aws::Client::GenericClientConfiguration
{
using BaseClientConfigClass = Aws::Client::GenericClientConfiguration;
static const bool EndpointDiscoverySupported = true;
static const bool EndpointDiscoveryRequired = false;

DynamoDBClientConfiguration(const Client::ClientConfigurationInitValues &configuration = {});

/**
* Create a configuration based on settings in the aws configuration file for the given profile name.
* The configuration file location can be set via the environment variable AWS_CONFIG_FILE
* @param profileName the aws profile name.
* @param shouldDisableIMDS whether or not to disable IMDS calls.
*/
DynamoDBClientConfiguration(const char* profileName, bool shouldDisableIMDS = false);

/**
* Create a configuration with a predefined smart defaults
* @param useSmartDefaults, required to differentiate c-tors
* @param defaultMode, default mode to use
* @param shouldDisableIMDS whether or not to disable IMDS calls.
*/
DynamoDBClientConfiguration(bool useSmartDefaults, const char* defaultMode = "legacy", bool shouldDisableIMDS = false);

/**
* Converting constructors for compatibility with a legacy code
*/
DynamoDBClientConfiguration(const Client::ClientConfiguration& config);

/**
* Enable endpoint discovery
* For some services to dynamically set up their endpoints for different requests.
* By default, service clients will decide if endpoint discovery is enabled or not.
* If disabled, regional or overridden endpoint will be used instead.
* If a request requires endpoint discovery, but it was disabled then the request will never succeed.
* A boolean value is either true of false, use Optional here to have an instance does not contain a value,
* such that SDK will decide the default behavior as stated before, if no value specified.
* DynamoDB service client does not require endpoint discovery. The default value for this setting is Disabled.
*/
Aws::Crt::Optional<bool>& enableEndpointDiscovery;

private:
void LoadDynamoDBSpecificConfig(const Aws::String& profileName);
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using Aws::Endpoint::DefaultEndpointProvider;

using DynamoDBClientContextParameters = Aws::Endpoint::ClientContextParameters;

using DynamoDBClientConfiguration = Aws::Client::GenericClientConfiguration<true>;
using DynamoDBClientConfiguration = Aws::Client::GenericClientConfiguration;
using DynamoDBBuiltInParameters = Aws::Endpoint::BuiltInParameters;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/* Generic header includes */
#include <aws/dynamodb/DynamoDBErrors.h>
#include <aws/core/client/GenericClientConfiguration.h>
#include <aws/dynamodb/DynamoDBClientConfiguration.h>
#include <aws/core/client/AWSError.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/client/AsyncCallerContext.h>
Expand Down Expand Up @@ -116,7 +116,6 @@ namespace Aws

namespace DynamoDB
{
using DynamoDBClientConfiguration = Aws::Client::GenericClientConfiguration<true>;
using DynamoDBEndpointProviderBase = Aws::DynamoDB::Endpoint::DynamoDBEndpointProviderBase;
using DynamoDBEndpointProvider = Aws::DynamoDB::Endpoint::DynamoDBEndpointProvider;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#include <aws/dynamodb/DynamoDBClientConfiguration.h>

namespace Aws
{
namespace DynamoDB
{


bool IsEndpointDiscoveryEnabled(const Aws::String& endpointOverride, const Aws::String &profileName)
{
bool enabled = false;

if (!endpointOverride.empty())
{
enabled = false;
}
else
{
static const char* AWS_ENABLE_ENDPOINT_DISCOVERY_ENV_KEY = "AWS_ENABLE_ENDPOINT_DISCOVERY";
static const char* AWS_ENABLE_ENDPOINT_DISCOVERY_PROFILE_KEY = "AWS_ENABLE_ENDPOINT_DISCOVERY";
static const char* AWS_ENABLE_EP_DISCOVERY_ENABLED = "true";
static const char* AWS_ENABLE_EP_DISCOVERY_DISABLED = "false";

static const const* DEFAULT_VALUE_FOR_$serviceNameCaps = AWS_ENABLE_EP_DISCOVERY_DISABLED;
Aws::String configVal = Client::ClientConfiguration::LoadConfigFromEnvOrProfile(
AWS_ENABLE_ENDPOINT_DISCOVERY_ENV_KEY, profileName, AWS_ENABLE_ENDPOINT_DISCOVERY_PROFILE_KEY,
{AWS_ENABLE_EP_DISCOVERY_ENABLED, AWS_ENABLE_EP_DISCOVERY_DISABLED}, DEFAULT_VALUE_FOR_$serviceNameCaps);

if (AWS_ENABLE_EP_DISCOVERY_ENABLED == configVal)
{
enabled = true;
}
}
return enabled;
}

void DynamoDBClientConfiguration::LoadDynamoDBSpecificConfig(const Aws::String& inputProfileName)
{
if(!enableEndpointDiscovery) {
enableEndpointDiscovery = IsEndpointDiscoveryEnabled(this->endpointOverride, inputProfileName);
}
}

DynamoDBClientConfiguration::DynamoDBClientConfiguration(const Client::ClientConfigurationInitValues &configuration)
: BaseClientConfigClass(configuration), enableEndpointDiscovery(ClientConfiguration::enableEndpointDiscovery)
{
LoadDynamoDBSpecificConfig(this->profileName);
}

DynamoDBClientConfiguration::DynamoDBClientConfiguration(const char* inputProfileName, bool shouldDisableIMDS)
: BaseClientConfigClass(inputProfileName, shouldDisableIMDS), enableEndpointDiscovery(ClientConfiguration::enableEndpointDiscovery)
{
LoadDynamoDBSpecificConfig(Aws::String(inputProfileName));
}

DynamoDBClientConfiguration::DynamoDBClientConfiguration(bool useSmartDefaults, const char* defaultMode, bool shouldDisableIMDS)
: BaseClientConfigClass(useSmartDefaults, defaultMode, shouldDisableIMDS), enableEndpointDiscovery(ClientConfiguration::enableEndpointDiscovery)
{
LoadDynamoDBSpecificConfig(this->profileName);
}

DynamoDBClientConfiguration::DynamoDBClientConfiguration(const Client::ClientConfiguration& config) : BaseClientConfigClass(config), enableEndpointDiscovery(ClientConfiguration::enableEndpointDiscovery){
LoadDynamoDBSpecificConfig(this->profileName);
}


} // namespace DynamoDB
} // namespace Aws
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using Aws::Endpoint::DefaultEndpointProvider;

using CloudWatchLogsClientContextParameters = Aws::Endpoint::ClientContextParameters;

using CloudWatchLogsClientConfiguration = Aws::Client::GenericClientConfiguration<false>;
using CloudWatchLogsClientConfiguration = Aws::Client::GenericClientConfiguration;
using CloudWatchLogsBuiltInParameters = Aws::Endpoint::BuiltInParameters;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ namespace Aws

namespace CloudWatchLogs
{
using CloudWatchLogsClientConfiguration = Aws::Client::GenericClientConfiguration<false>;
using CloudWatchLogsClientConfiguration = Aws::Client::GenericClientConfiguration;
using CloudWatchLogsEndpointProviderBase = Aws::CloudWatchLogs::Endpoint::CloudWatchLogsEndpointProviderBase;
using CloudWatchLogsEndpointProvider = Aws::CloudWatchLogs::Endpoint::CloudWatchLogsEndpointProvider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ namespace Aws
REGIONAL //stands for using regional endpoint for us-east-1
};

struct AWS_S3CRT_API S3CrtClientConfiguration : public Aws::Client::GenericClientConfiguration</*EndpointDiscoverySupported*/true>
struct AWS_S3CRT_API S3CrtClientConfiguration : public Aws::Client::GenericClientConfiguration
{
using BaseClientConfigClass = Aws::Client::GenericClientConfiguration</*EndpointDiscoverySupported*/true>;
using BaseClientConfigClass = Aws::Client::GenericClientConfiguration;

S3CrtClientConfiguration(const Client::ClientConfigurationInitValues &configuration = {});

Expand Down Expand Up @@ -66,4 +66,4 @@ namespace Aws
void LoadS3CrtSpecificConfig(const Aws::String& profileName);
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ namespace Aws
REGIONAL //stands for using regional endpoint for us-east-1
};

struct AWS_S3_API S3ClientConfiguration : public Aws::Client::GenericClientConfiguration</*EndpointDiscoverySupported*/true>
struct AWS_S3_API S3ClientConfiguration : public Aws::Client::GenericClientConfiguration
{
using BaseClientConfigClass = Aws::Client::GenericClientConfiguration</*EndpointDiscoverySupported*/true>;
using BaseClientConfigClass = Aws::Client::GenericClientConfiguration;

S3ClientConfiguration(const Client::ClientConfigurationInitValues &configuration = {});

Expand Down Expand Up @@ -66,4 +66,4 @@ namespace Aws
void LoadS3SpecificConfig(const Aws::String& profileName);
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using Aws::Endpoint::DefaultEndpointProvider;

using TimestreamInfluxDBClientContextParameters = Aws::Endpoint::ClientContextParameters;

using TimestreamInfluxDBClientConfiguration = Aws::Client::GenericClientConfiguration<false>;
using TimestreamInfluxDBClientConfiguration = Aws::Client::GenericClientConfiguration;
using TimestreamInfluxDBBuiltInParameters = Aws::Endpoint::BuiltInParameters;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace Aws

namespace TimestreamInfluxDB
{
using TimestreamInfluxDBClientConfiguration = Aws::Client::GenericClientConfiguration<false>;
using TimestreamInfluxDBClientConfiguration = Aws::Client::GenericClientConfiguration;
using TimestreamInfluxDBEndpointProviderBase = Aws::TimestreamInfluxDB::Endpoint::TimestreamInfluxDBEndpointProviderBase;
using TimestreamInfluxDBEndpointProvider = Aws::TimestreamInfluxDB::Endpoint::TimestreamInfluxDBEndpointProvider;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once

#include <aws/timestream-query/TimestreamQuery_EXPORTS.h>
#include <aws/core/client/GenericClientConfiguration.h>


namespace Aws
{
namespace TimestreamQuery
{
struct AWS_TIMESTREAMQUERY_API TimestreamQueryClientConfiguration : public Aws::Client::GenericClientConfiguration
{
using BaseClientConfigClass = Aws::Client::GenericClientConfiguration;
static const bool EndpointDiscoverySupported = true;
static const bool EndpointDiscoveryRequired = true;

TimestreamQueryClientConfiguration(const Client::ClientConfigurationInitValues &configuration = {});

/**
* Create a configuration based on settings in the aws configuration file for the given profile name.
* The configuration file location can be set via the environment variable AWS_CONFIG_FILE
* @param profileName the aws profile name.
* @param shouldDisableIMDS whether or not to disable IMDS calls.
*/
TimestreamQueryClientConfiguration(const char* profileName, bool shouldDisableIMDS = false);

/**
* Create a configuration with a predefined smart defaults
* @param useSmartDefaults, required to differentiate c-tors
* @param defaultMode, default mode to use
* @param shouldDisableIMDS whether or not to disable IMDS calls.
*/
TimestreamQueryClientConfiguration(bool useSmartDefaults, const char* defaultMode = "legacy", bool shouldDisableIMDS = false);

/**
* Converting constructors for compatibility with a legacy code
*/
TimestreamQueryClientConfiguration(const Client::ClientConfiguration& config);

/**
* Enable endpoint discovery
* For some services to dynamically set up their endpoints for different requests.
* By default, service clients will decide if endpoint discovery is enabled or not.
* If disabled, regional or overridden endpoint will be used instead.
* If a request requires endpoint discovery, but it was disabled then the request will never succeed.
* A boolean value is either true of false, use Optional here to have an instance does not contain a value,
* such that SDK will decide the default behavior as stated before, if no value specified.
* Timestream Query service client requires endpoint discovery. The default value for this setting is Enabled.
*/
Aws::Crt::Optional<bool>& enableEndpointDiscovery;

private:
void LoadTimestreamQuerySpecificConfig(const Aws::String& profileName);
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using Aws::Endpoint::DefaultEndpointProvider;

using TimestreamQueryClientContextParameters = Aws::Endpoint::ClientContextParameters;

using TimestreamQueryClientConfiguration = Aws::Client::GenericClientConfiguration<true>;
using TimestreamQueryClientConfiguration = Aws::Client::GenericClientConfiguration;
using TimestreamQueryBuiltInParameters = Aws::Endpoint::BuiltInParameters;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/* Generic header includes */
#include <aws/timestream-query/TimestreamQueryErrors.h>
#include <aws/core/client/GenericClientConfiguration.h>
#include <aws/timestream-query/TimestreamQueryClientConfiguration.h>
#include <aws/core/client/AWSError.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/client/AsyncCallerContext.h>
Expand Down Expand Up @@ -69,7 +69,6 @@ namespace Aws

namespace TimestreamQuery
{
using TimestreamQueryClientConfiguration = Aws::Client::GenericClientConfiguration<true>;
using TimestreamQueryEndpointProviderBase = Aws::TimestreamQuery::Endpoint::TimestreamQueryEndpointProviderBase;
using TimestreamQueryEndpointProvider = Aws::TimestreamQuery::Endpoint::TimestreamQueryEndpointProvider;

Expand Down
Loading

0 comments on commit 25ffa82

Please sign in to comment.