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/xml/XmlSerializer.h>
10#include <smithy/tracing/TracingUtils.h>
11#include <smithy/tracing/TelemetryProvider.h>
30 : m_telemetryProvider(telemetryProvider)
45 if (!httpOutcome.IsSuccess())
47 return TracingUtils::MakeCallWithTiming<XmlOutcome>(
49 return {std::move(httpOutcome)};
52 *m_telemetryProvider->getMeter(serviceName, {}),
56 if (httpOutcome.GetResult()->GetResponseBody().good() &&
57 httpOutcome.GetResult()->GetResponseBody().tellp() > 0)
59 return TracingUtils::MakeCallWithTiming<XmlOutcome>(
65 AWS_LOGSTREAM_ERROR(
"XmlOutcomeSerializer",
"Xml parsing for error failed with message " << xmlDoc.
GetErrorMessage().c_str());
73 httpOutcome.GetResult()->GetHeaders(),
74 httpOutcome.GetResult()->GetResponseCode())};
77 *m_telemetryProvider->getMeter(serviceName, {}),
84 std::shared_ptr<TelemetryProvider> m_telemetryProvider;
Aws::String GetErrorMessage() const
bool WasParseSuccessful() const
static XmlDocument CreateFromXmlStream(Aws::IOStream &)
XmlOutcomeSerializer(const XmlOutcomeSerializer &other)=delete
XmlOutcomeSerializer(const std::shared_ptr< TelemetryProvider > &telemetryProvider)
XmlOutcome Deserialize(HttpResponseOutcome &&httpOutcome, const Aws::String &serviceName, const Aws::String &requestName) const
XmlOutcomeSerializer(XmlOutcomeSerializer &&other) noexcept=default
virtual ~XmlOutcomeSerializer()=default
XmlOutcomeSerializer & operator=(const XmlOutcomeSerializer &other)=delete
XmlOutcomeSerializer & operator=(XmlOutcomeSerializer &&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
components::tracing::TracingUtils TracingUtils
Aws::AmazonWebServiceResult< XmlDocument > XmlServiceResult
Aws::Utils::Xml::XmlDocument XmlDocument
Aws::Client::AWSError< CoreErrors > AWSError
Aws::Client::CoreErrors CoreErrors