Skip to content

Commit

Permalink
DDB preview
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyRyabinin committed Aug 13, 2024
1 parent 4b77004 commit 3c831d8
Show file tree
Hide file tree
Showing 11 changed files with 1,992 additions and 269 deletions.
215 changes: 98 additions & 117 deletions generated/src/aws-cpp-sdk-dynamodb/include/aws/dynamodb/DynamoDBClient.h

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ namespace Aws
*/
Aws::Crt::Optional<bool>& enableEndpointDiscovery;

/**
* The AWS AccountId used for the request.
*/
Aws::String accountId;
/**
* The AccountId Endpoint Mode.
*/
Aws::String accountIdEndpointMode = "preferred";
private:
void LoadDynamoDBSpecificConfig(const Aws::String& profileName);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ using Aws::Endpoint::DefaultEndpointProvider;

using DynamoDBClientContextParameters = Aws::Endpoint::ClientContextParameters;

using DynamoDBBuiltInParameters = Aws::Endpoint::BuiltInParameters;
class AWS_DYNAMODB_API DynamoDBBuiltInParameters : public Aws::Endpoint::BuiltInParameters
{
public:
virtual ~DynamoDBBuiltInParameters(){};
using Aws::Endpoint::BuiltInParameters::SetFromClientConfiguration;
virtual void SetFromClientConfiguration(const DynamoDBClientConfiguration& config);
};

/**
* The type for the DynamoDB Client Endpoint Provider.
Expand All @@ -40,6 +46,25 @@ using DynamoDBEndpointProviderBase =
using DynamoDBDefaultEpProviderBase =
DefaultEndpointProvider<DynamoDBClientConfiguration, DynamoDBBuiltInParameters, DynamoDBClientContextParameters>;

} // namespace Endpoint
} // namespace DynamoDB

namespace Endpoint
{
/**
* Export endpoint provider symbols for Windows DLL, otherwise declare as extern
*/
AWS_DYNAMODB_EXTERN template class AWS_DYNAMODB_API
Aws::Endpoint::EndpointProviderBase<DynamoDB::Endpoint::DynamoDBClientConfiguration, DynamoDB::Endpoint::DynamoDBBuiltInParameters, DynamoDB::Endpoint::DynamoDBClientContextParameters>;

AWS_DYNAMODB_EXTERN template class AWS_DYNAMODB_API
Aws::Endpoint::DefaultEndpointProvider<DynamoDB::Endpoint::DynamoDBClientConfiguration, DynamoDB::Endpoint::DynamoDBBuiltInParameters, DynamoDB::Endpoint::DynamoDBClientContextParameters>;
} // namespace Endpoint

namespace DynamoDB
{
namespace Endpoint
{
/**
* Default endpoint provider used for this service
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ namespace Model
* applied. A high <code>ScannedCount</code> value with few, or no,
* <code>Count</code> results indicates an inefficient <code>Query</code>
* operation. For more information, see <a
* href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.Count">Count
* href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#Count">Count
* and ScannedCount</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p> <p>If
* you did not use a filter in the request, then <code>ScannedCount</code> is the
* same as <code>Count</code>.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ void DynamoDBClientConfiguration::LoadDynamoDBSpecificConfig(const Aws::String&
if(!enableEndpointDiscovery) {
enableEndpointDiscovery = IsEndpointDiscoveryEnabled(this->endpointOverride, inputProfileName);
}
// accountId is intentionally not set here: AWS_ACCOUNT_ID env variable may not match the provided credentials.
// it must be set by an auth provider / identity resolver or by an SDK user.
static const char AWS_ACCOUNT_ID_ENDPOINT_MODE_ENVIRONMENT_VARIABLE[] = "AWS_ACCOUNT_ID_ENDPOINT_MODE";
static const char AWS_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_FILE_OPTION[] = "account_id_endpoint_mode";
accountIdEndpointMode = ClientConfiguration::LoadConfigFromEnvOrProfile(AWS_ACCOUNT_ID_ENDPOINT_MODE_ENVIRONMENT_VARIABLE,
inputProfileName,
AWS_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_FILE_OPTION,
{"required", "disabled", "preferred"}, /* allowed values */
"preferred" /* default value */);
}

DynamoDBClientConfiguration::DynamoDBClientConfiguration(const Client::ClientConfigurationInitValues &configuration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,37 @@

namespace Aws
{
#ifndef AWS_DYNAMODB_EXPORTS // Except for Windows DLL
namespace Endpoint
{
/**
* Instantiate endpoint providers
*/
template class Aws::Endpoint::EndpointProviderBase<DynamoDB::Endpoint::DynamoDBClientConfiguration,
DynamoDB::Endpoint::DynamoDBBuiltInParameters,
DynamoDB::Endpoint::DynamoDBClientContextParameters>;

template class Aws::Endpoint::DefaultEndpointProvider<DynamoDB::Endpoint::DynamoDBClientConfiguration,
DynamoDB::Endpoint::DynamoDBBuiltInParameters,
DynamoDB::Endpoint::DynamoDBClientContextParameters>;
} // namespace Endpoint
#endif

namespace DynamoDB
{
namespace Endpoint
{
void DynamoDBBuiltInParameters::SetFromClientConfiguration(const DynamoDBClientConfiguration& config)
{
SetFromClientConfiguration(static_cast<const DynamoDBClientConfiguration::BaseClientConfigClass&>(config));

if(!config.accountId.empty()) {
SetStringParameter("AccountId", config.accountId);
}
if(!config.accountIdEndpointMode.empty()) {
SetStringParameter("AccountIdEndpointMode", config.accountIdEndpointMode);
}
}
} // namespace Endpoint
} // namespace DynamoDB
} // namespace Aws
Loading

0 comments on commit 3c831d8

Please sign in to comment.