Skip to content

Commit

Permalink
reset unchanged files
Browse files Browse the repository at this point in the history
  • Loading branch information
sbera87 committed Nov 22, 2024
1 parent 58d1f31 commit 1addb58
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Client
class AWS_ACM_API ACMErrorMarshaller : public Aws::Client::JsonErrorMarshaller
{
public:

Aws::Client::AWSError<Aws::Client::CoreErrors> FindErrorByName(const char* exceptionName) const override;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ namespace Client
class AWS_SQS_API SQSErrorMarshaller : public Aws::Client::JsonErrorMarshaller
{
public:

explicit SQSErrorMarshaller(bool queryCompatibilityMode) : Aws::Client::JsonErrorMarshaller(queryCompatibilityMode){}
Aws::Client::AWSError<Aws::Client::CoreErrors> FindErrorByName(const char* exceptionName) const override;
};

Expand Down
1 change: 1 addition & 0 deletions generated/src/aws-cpp-sdk-sqs/include/aws/sqs/SQSRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ namespace SQS
if(headers.size() == 0 || (headers.size() > 0 && headers.count(Aws::Http::CONTENT_TYPE_HEADER) == 0))
{
headers.emplace(Aws::Http::HeaderValuePair(Aws::Http::CONTENT_TYPE_HEADER, Aws::AMZN_JSON_CONTENT_TYPE_1_0 ));
headers.emplace(Aws::Http::HeaderValuePair(Aws::Http::X_AMZN_QUERY_MODE,"True"));
}
headers.emplace(Aws::Http::HeaderValuePair(Aws::Http::API_VERSION_HEADER, "2012-11-05"));
return headers;
Expand Down
12 changes: 6 additions & 6 deletions generated/src/aws-cpp-sdk-sqs/source/SQSClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ SQSClient::SQSClient(const SQS::SQSClientConfiguration& clientConfiguration,
Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG),
SERVICE_NAME,
Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
Aws::MakeShared<SQSErrorMarshaller>(ALLOCATION_TAG)),
Aws::MakeShared<SQSErrorMarshaller>(ALLOCATION_TAG, true)),
m_clientConfiguration(clientConfiguration),
m_endpointProvider(endpointProvider ? std::move(endpointProvider) : Aws::MakeShared<SQSEndpointProvider>(ALLOCATION_TAG))
{
Expand All @@ -91,7 +91,7 @@ SQSClient::SQSClient(const AWSCredentials& credentials,
Aws::MakeShared<SimpleAWSCredentialsProvider>(ALLOCATION_TAG, credentials),
SERVICE_NAME,
Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
Aws::MakeShared<SQSErrorMarshaller>(ALLOCATION_TAG)),
Aws::MakeShared<SQSErrorMarshaller>(ALLOCATION_TAG, true)),
m_clientConfiguration(clientConfiguration),
m_endpointProvider(endpointProvider ? std::move(endpointProvider) : Aws::MakeShared<SQSEndpointProvider>(ALLOCATION_TAG))
{
Expand All @@ -106,7 +106,7 @@ SQSClient::SQSClient(const std::shared_ptr<AWSCredentialsProvider>& credentialsP
credentialsProvider,
SERVICE_NAME,
Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
Aws::MakeShared<SQSErrorMarshaller>(ALLOCATION_TAG)),
Aws::MakeShared<SQSErrorMarshaller>(ALLOCATION_TAG, true)),
m_clientConfiguration(clientConfiguration),
m_endpointProvider(endpointProvider ? std::move(endpointProvider) : Aws::MakeShared<SQSEndpointProvider>(ALLOCATION_TAG))
{
Expand All @@ -120,7 +120,7 @@ SQSClient::SQSClient(const std::shared_ptr<AWSCredentialsProvider>& credentialsP
Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG),
SERVICE_NAME,
Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
Aws::MakeShared<SQSErrorMarshaller>(ALLOCATION_TAG)),
Aws::MakeShared<SQSErrorMarshaller>(ALLOCATION_TAG, true)),
m_clientConfiguration(clientConfiguration),
m_endpointProvider(Aws::MakeShared<SQSEndpointProvider>(ALLOCATION_TAG))
{
Expand All @@ -134,7 +134,7 @@ SQSClient::SQSClient(const AWSCredentials& credentials,
Aws::MakeShared<SimpleAWSCredentialsProvider>(ALLOCATION_TAG, credentials),
SERVICE_NAME,
Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
Aws::MakeShared<SQSErrorMarshaller>(ALLOCATION_TAG)),
Aws::MakeShared<SQSErrorMarshaller>(ALLOCATION_TAG, true)),
m_clientConfiguration(clientConfiguration),
m_endpointProvider(Aws::MakeShared<SQSEndpointProvider>(ALLOCATION_TAG))
{
Expand All @@ -148,7 +148,7 @@ SQSClient::SQSClient(const std::shared_ptr<AWSCredentialsProvider>& credentialsP
credentialsProvider,
SERVICE_NAME,
Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
Aws::MakeShared<SQSErrorMarshaller>(ALLOCATION_TAG)),
Aws::MakeShared<SQSErrorMarshaller>(ALLOCATION_TAG, true)),
m_clientConfiguration(clientConfiguration),
m_endpointProvider(Aws::MakeShared<SQSEndpointProvider>(ALLOCATION_TAG))
{
Expand Down
14 changes: 7 additions & 7 deletions src/aws-cpp-sdk-core/include/smithy/client/AwsSmithyClientBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@ namespace client
virtual bool AdjustClockSkew(HttpResponseOutcome& outcome, const AuthSchemeOption& authSchemeOption) const = 0;

protected:
Aws::UniquePtr<Aws::Client::ClientConfiguration> m_clientConfig;
Aws::String m_serviceName;
Aws::String m_userAgent;
Aws::UniquePtr<Aws::Client::ClientConfiguration> m_clientConfig;
Aws::String m_serviceName;
Aws::String m_userAgent;

std::shared_ptr<Aws::Http::HttpClient> m_httpClient;
std::shared_ptr<Aws::Client::AWSErrorMarshaller> m_errorMarshaller;
Aws::Vector<std::shared_ptr<smithy::interceptor::Interceptor>> m_interceptors{};
std::shared_ptr<Aws::Http::HttpClient> m_httpClient;
std::shared_ptr<Aws::Client::AWSErrorMarshaller> m_errorMarshaller;
Aws::Vector<std::shared_ptr<smithy::interceptor::Interceptor>> m_interceptors{};
};
} // namespace client
} // namespace client
} // namespace smithy
127 changes: 73 additions & 54 deletions src/aws-cpp-sdk-core/source/smithy/client/AwsSmithyClientBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,62 +94,81 @@ AwsSmithyClientBase::BuildHttpRequest(const std::shared_ptr<AwsSmithyClientAsync
return httpRequest;
}

void AwsSmithyClientBase::MakeRequestAsync(Aws::AmazonWebServiceRequest const* const request, const char* requestName,
Aws::Http::HttpMethod method, EndpointUpdateCallback&& endpointCallback,
void AwsSmithyClientBase::MakeRequestAsync(Aws::AmazonWebServiceRequest const* const request,
const char* requestName,
Aws::Http::HttpMethod method,
EndpointUpdateCallback&& endpointCallback,
ResponseHandlerFunc&& responseHandler,
std::shared_ptr<Aws::Utils::Threading::Executor> pExecutor) const {
if (!responseHandler) {
assert(!"Missing a mandatory response handler!");
AWS_LOGSTREAM_FATAL(AWS_SMITHY_CLIENT_LOG, "Unable to continue AWSClient request: response handler is missing!");
return;
}

std::shared_ptr<AwsSmithyClientAsyncRequestContext> pRequestCtx =
Aws::MakeShared<AwsSmithyClientAsyncRequestContext>(AWS_SMITHY_CLIENT_LOG);
if (!pRequestCtx) {
AWS_LOGSTREAM_ERROR(AWS_SMITHY_CLIENT_LOG, "Failed to allocate an AwsSmithyClientAsyncRequestContext under a shared ptr");
auto outcome = HttpResponseOutcome(
ClientError(CoreErrors::MEMORY_ALLOCATION, "", "Failed to allocate async request context", false /*retryable*/));
pExecutor->Submit([outcome, responseHandler]() mutable { responseHandler(std::move(outcome)); });
return;
}
pRequestCtx->m_responseHandler = std::move(responseHandler);
pRequestCtx->m_pExecutor = pExecutor;
pRequestCtx->m_pRequest = request;
if (requestName)
pRequestCtx->m_requestName = requestName;
else if (pRequestCtx->m_pRequest)
pRequestCtx->m_requestName = pRequestCtx->m_pRequest->GetServiceRequestName();
pRequestCtx->m_method = method;
pRequestCtx->m_retryCount = 0;
pRequestCtx->m_invocationId = Aws::Utils::UUID::PseudoRandomUUID();
auto authSchemeOptionOutcome = this->SelectAuthSchemeOption(*pRequestCtx);
if (!authSchemeOptionOutcome.IsSuccess()) {
pExecutor->Submit([authSchemeOptionOutcome, responseHandler]() mutable { responseHandler(std::move(authSchemeOptionOutcome)); });
return;
}
pRequestCtx->m_authSchemeOption = std::move(authSchemeOptionOutcome.GetResultWithOwnership());
assert(pRequestCtx->m_authSchemeOption.schemeId);
Aws::Endpoint::EndpointParameters epParams = request ? request->GetEndpointContextParams() : Aws::Endpoint::EndpointParameters();
const auto authSchemeEpParams = pRequestCtx->m_authSchemeOption.endpointParameters();
epParams.insert(epParams.end(), authSchemeEpParams.begin(), authSchemeEpParams.end());
auto epResolutionOutcome = this->ResolveEndpoint(std::move(epParams), std::move(endpointCallback));
if (!epResolutionOutcome.IsSuccess()) {
pExecutor->Submit([epResolutionOutcome, responseHandler]() mutable { responseHandler(std::move(epResolutionOutcome)); });
return;
}
pRequestCtx->m_endpoint = std::move(epResolutionOutcome.GetResultWithOwnership());
if (!Aws::Utils::IsValidHost(pRequestCtx->m_endpoint.GetURI().GetAuthority())) {
AWS_LOGSTREAM_ERROR(AWS_SMITHY_CLIENT_LOG, "Invalid DNS Label found in URI host");
auto outcome = HttpResponseOutcome(ClientError(CoreErrors::VALIDATION, "", "Invalid DNS Label found in URI host", false /*retryable*/));
pExecutor->Submit([outcome, responseHandler]() mutable { responseHandler(std::move(outcome)); });
return;
}
pRequestCtx->m_requestInfo.attempt = 1;
pRequestCtx->m_requestInfo.maxAttempts = 0;
pRequestCtx->m_interceptorContext = Aws::MakeShared<InterceptorContext>(AWS_SMITHY_CLIENT_LOG, *request);
std::shared_ptr<Aws::Utils::Threading::Executor> pExecutor) const
{
if(!responseHandler)
{
assert(!"Missing a mandatory response handler!");
AWS_LOGSTREAM_FATAL(AWS_SMITHY_CLIENT_LOG, "Unable to continue AWSClient request: response handler is missing!");
return;
}

std::shared_ptr<AwsSmithyClientAsyncRequestContext> pRequestCtx =
Aws::MakeShared<AwsSmithyClientAsyncRequestContext>(AWS_SMITHY_CLIENT_LOG);
if (!pRequestCtx)
{
AWS_LOGSTREAM_ERROR(AWS_SMITHY_CLIENT_LOG, "Failed to allocate an AwsSmithyClientAsyncRequestContext under a shared ptr");
auto outcome = HttpResponseOutcome(ClientError(CoreErrors::MEMORY_ALLOCATION, "", "Failed to allocate async request context", false/*retryable*/));
pExecutor->Submit([outcome, responseHandler]() mutable
{
responseHandler(std::move(outcome));
} );
return;
}
pRequestCtx->m_responseHandler = std::move(responseHandler);
pRequestCtx->m_pExecutor = pExecutor;
pRequestCtx->m_pRequest = request;
if (requestName)
pRequestCtx->m_requestName = requestName;
else if (pRequestCtx->m_pRequest)
pRequestCtx->m_requestName = pRequestCtx->m_pRequest->GetServiceRequestName();
pRequestCtx->m_method = method;
pRequestCtx->m_retryCount = 0;
pRequestCtx->m_invocationId = Aws::Utils::UUID::PseudoRandomUUID();
auto authSchemeOptionOutcome = this->SelectAuthSchemeOption(*pRequestCtx);
if (!authSchemeOptionOutcome.IsSuccess())
{
pExecutor->Submit([authSchemeOptionOutcome, responseHandler]() mutable
{
responseHandler(std::move(authSchemeOptionOutcome));
} );
return;
}
pRequestCtx->m_authSchemeOption = std::move(authSchemeOptionOutcome.GetResultWithOwnership());
assert(pRequestCtx->m_authSchemeOption.schemeId);
Aws::Endpoint::EndpointParameters epParams = request ? request->GetEndpointContextParams() : Aws::Endpoint::EndpointParameters();
const auto authSchemeEpParams = pRequestCtx->m_authSchemeOption.endpointParameters();
epParams.insert(epParams.end(), authSchemeEpParams.begin(), authSchemeEpParams.end());
auto epResolutionOutcome = this->ResolveEndpoint(std::move(epParams), std::move(endpointCallback));
if (!epResolutionOutcome.IsSuccess())
{
pExecutor->Submit([epResolutionOutcome, responseHandler]() mutable
{
responseHandler(std::move(epResolutionOutcome));
} );
return;
}
pRequestCtx->m_endpoint = std::move(epResolutionOutcome.GetResultWithOwnership());
if (!Aws::Utils::IsValidHost(pRequestCtx->m_endpoint.GetURI().GetAuthority()))
{
AWS_LOGSTREAM_ERROR(AWS_SMITHY_CLIENT_LOG, "Invalid DNS Label found in URI host");
auto outcome = HttpResponseOutcome(ClientError(CoreErrors::VALIDATION, "", "Invalid DNS Label found in URI host", false/*retryable*/));
pExecutor->Submit([outcome, responseHandler]() mutable
{
responseHandler(std::move(outcome));
} );
return;
}
pRequestCtx->m_requestInfo.attempt = 1;
pRequestCtx->m_requestInfo.maxAttempts = 0;
pRequestCtx->m_interceptorContext = Aws::MakeShared<InterceptorContext>(AWS_SMITHY_CLIENT_LOG, *request);

AttemptOneRequestAsync(std::move(pRequestCtx));
AttemptOneRequestAsync(std::move(pRequestCtx));
}

/*HttpResponseOutcome*/
Expand Down

0 comments on commit 1addb58

Please sign in to comment.