/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include namespace smithy { namespace client { class AwsSmithyClientAsyncRequestContext { public: using AwsCoreError = Aws::Client::AWSError; using HttpResponseOutcome = Aws::Utils::Outcome, AwsCoreError>; using ResponseHandlerFunc = std::function; struct RequestInfo { Aws::Utils::DateTime ttl; long attempt; long maxAttempts; Aws::String ToString() const { Aws::StringStream ss; if (ttl.WasParseSuccessful() && ttl != Aws::Utils::DateTime()) { assert(attempt > 1); ss << "ttl=" << ttl.ToGmtString(Aws::Utils::DateFormat::ISO_8601_BASIC) << "; "; } ss << "attempt=" << attempt; if (maxAttempts > 0) { ss << "; max=" << maxAttempts; } return ss.str(); } explicit operator Aws::String() const { return ToString(); } }; Aws::String m_invocationId; Aws::Http::HttpMethod m_method; const Aws::AmazonWebServiceRequest* m_pRequest; // optional RequestInfo m_requestInfo; Aws::String m_requestName; std::shared_ptr m_httpRequest; AuthSchemeOption m_authSchemeOption; Aws::Endpoint::AWSEndpoint m_endpoint; Aws::Crt::Optional m_lastError; size_t m_retryCount; Aws::Vector m_monitoringContexts; ResponseHandlerFunc m_responseHandler; std::shared_ptr m_pExecutor; std::shared_ptr m_interceptorContext; }; } // namespace client } // namespace smithy