15 #include <aws/core/Version.h> 16 #include <aws/core/client/DefaultRetryStrategy.h> 17 #include <aws/core/platform/OSVersionInfo.h> 24 #ifndef CLIENT_CONFIG_PREFIX 25 #define CLIENT_CONFIG_PREFIX "aws_client_configuration" 40 bool ShouldRetry(
const AWSError<CoreErrors> & error,
long attemptedRetries)
const override 42 AWS_UNREFERENCED_PARAM(error);
43 AWS_UNREFERENCED_PARAM(attemptedRetries);
50 AWS_UNREFERENCED_PARAM(error);
51 AWS_UNREFERENCED_PARAM(attemptedRetries);
57 bool operator==(
const ClientConfiguration & left,
const ClientConfiguration & right)
61 result &= (right.region == left.region);
62 result &= (right.userAgent == left.userAgent);
63 result &= (right.endpointOverride == left.endpointOverride);
64 result &= (right.proxyHost == left.proxyHost);
65 result &= (right.proxyUserName == left.proxyUserName);
66 result &= (right.proxyPassword == left.proxyPassword);
67 result &= (right.caPath == left.caPath);
68 result &= (right.caFile == left.caFile);
70 result &= (left.requestTimeoutMs == right.requestTimeoutMs);
71 result &= (left.connectTimeoutMs == right.connectTimeoutMs);
72 result &= (left.maxConnections == right.maxConnections);
73 result &= (left.proxyPort == right.proxyPort);
74 result &= (left.useDualStack == right.useDualStack);
75 result &= (left.enableClockSkewAdjustment == right.enableClockSkewAdjustment);
76 result &= (left.followRedirects == right.followRedirects);
77 result &= (left.verifySSL == right.verifySSL);
82 bool operator!=(
const ClientConfiguration & left,
const ClientConfiguration & right)
84 return !(left == right);
88 std::shared_ptr<ParameterReaderInterface> reader)
90 this->reader_ = std::move(reader);
94 const std::string & ros_version_override)
96 Aws::String ros_user_agent_suffix =
" exec-env/AWS_RoboMaker ros-" CMAKE_ROS_DISTRO
"/";
97 if (ros_version_override.empty()) {
98 ros_user_agent_suffix += CMAKE_ROS_VERSION;
100 ros_user_agent_suffix += ros_version_override.c_str();
102 user_agent += ros_user_agent_suffix;
106 const std::string & ros_version_override)
108 ClientConfiguration config;
116 config.region = profile_provider.
GetProfile().GetRegion();
118 PopulateUserAgent(config.userAgent, ros_version_override);
129 config.requestTimeoutMs = temp;
132 config.connectTimeoutMs = temp;
135 config.maxConnections = temp;
138 config.proxyPort = temp;
143 config.enableClockSkewAdjustment);
148 bool strategy =
false;
152 config.retryStrategy = std::make_shared<NoRetryStrategy>();
157 config.retryStrategy = std::make_shared<Aws::Client::DefaultRetryStrategy>(max_retries);
#define CLIENT_CONFIG_PREFIX
bool operator==(const ClientConfiguration &left, const ClientConfiguration &right)
void PopulateUserAgent(Aws::String &user_agent, const std::string &ros_version_override="")
bool operator!=(const ClientConfiguration &left, const ClientConfiguration &right)
NoRetryStrategy()=default
bool ShouldRetry(const AWSError< CoreErrors > &error, long attemptedRetries) const override
const Aws::Config::Profile GetProfile()
ClientConfigurationProvider(std::shared_ptr< ParameterReaderInterface > reader)
Creates a new ClientConfigurationProvider that uses the provided reader for loading configuraiton...
long CalculateDelayBeforeNextRetry(const AWSError< CoreErrors > &error, long attemptedRetries) const override
ClientConfiguration GetClientConfiguration(const std::string &ros_version_override="")