6#include <aws/core/AmazonWebServiceResult.h>
7#include <aws/core/client/AWSError.h>
8#include <aws/core/utils/Outcome.h>
9#include <aws/core/utils/json/JsonSerializer.h>
10#include <smithy/tracing/TracingUtils.h>
11#include <smithy/tracing/TelemetryProvider.h>
29 : m_telemetryProvider(telemetryProvider)
43 if (!httpOutcome.IsSuccess())
45 return TracingUtils::MakeCallWithTiming<JsonOutcome>(
50 *m_telemetryProvider->getMeter(serviceName, {}),
55 if (httpOutcome.GetResult()->GetResponseBody().good() &&
56 httpOutcome.GetResult()->GetResponseBody().tellp() > 0)
58 JsonValue jsonValue(httpOutcome.GetResult()->GetResponseBody());
60 return TracingUtils::MakeCallWithTiming<JsonOutcome>(
68 *m_telemetryProvider->getMeter(serviceName, {}),
73 return TracingUtils::MakeCallWithTiming<JsonOutcome>(
76 httpOutcome.GetResult()->GetHeaders(),
77 httpOutcome.GetResult()->GetResponseCode())};
80 *m_telemetryProvider->getMeter(serviceName, {}),
85 return TracingUtils::MakeCallWithTiming<JsonOutcome>(
88 httpOutcome.GetResult()->GetHeaders())};
91 *m_telemetryProvider->getMeter(serviceName, {}),
97 std::shared_ptr<TelemetryProvider> m_telemetryProvider;
const Aws::String & GetErrorMessage() const
bool WasParseSuccessful() const
JsonOutcomeSerializer & operator=(JsonOutcomeSerializer &&other) noexcept=default
JsonOutcomeSerializer & operator=(const JsonOutcomeSerializer &other)=delete
JsonOutcomeSerializer(const std::shared_ptr< TelemetryProvider > &telemetryProvider)
virtual ~JsonOutcomeSerializer()=default
JsonOutcome Deserialize(HttpResponseOutcome &&httpOutcome, const Aws::String &serviceName, const Aws::String &requestName) const
JsonOutcomeSerializer(const JsonOutcomeSerializer &other)=delete
JsonOutcomeSerializer(JsonOutcomeSerializer &&other) noexcept=default
static const char SMITHY_CLIENT_DESERIALIZATION_METRIC[]
static const char SMITHY_METHOD_DIMENSION[]
static const char SMITHY_SERVICE_DIMENSION[]
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Aws::Client::AWSError< CoreErrors > AWSError
Aws::Utils::Json::JsonValue JsonValue