/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include #include using namespace Aws::EC2::Model; using namespace Aws::Utils::Xml; using namespace Aws::Utils::Logging; using namespace Aws::Utils; using namespace Aws; RestoreSnapshotFromRecycleBinResponse::RestoreSnapshotFromRecycleBinResponse() : m_encrypted(false), m_state(SnapshotState::NOT_SET), m_volumeSize(0), m_sseType(SSEType::NOT_SET) { } RestoreSnapshotFromRecycleBinResponse::RestoreSnapshotFromRecycleBinResponse(const Aws::AmazonWebServiceResult& result) : m_encrypted(false), m_state(SnapshotState::NOT_SET), m_volumeSize(0), m_sseType(SSEType::NOT_SET) { *this = result; } RestoreSnapshotFromRecycleBinResponse& RestoreSnapshotFromRecycleBinResponse::operator =(const Aws::AmazonWebServiceResult& result) { const XmlDocument& xmlDocument = result.GetPayload(); XmlNode rootNode = xmlDocument.GetRootElement(); XmlNode resultNode = rootNode; if (!rootNode.IsNull() && (rootNode.GetName() != "RestoreSnapshotFromRecycleBinResponse")) { resultNode = rootNode.FirstChild("RestoreSnapshotFromRecycleBinResponse"); } if(!resultNode.IsNull()) { XmlNode snapshotIdNode = resultNode.FirstChild("snapshotId"); if(!snapshotIdNode.IsNull()) { m_snapshotId = Aws::Utils::Xml::DecodeEscapedXmlText(snapshotIdNode.GetText()); } XmlNode outpostArnNode = resultNode.FirstChild("outpostArn"); if(!outpostArnNode.IsNull()) { m_outpostArn = Aws::Utils::Xml::DecodeEscapedXmlText(outpostArnNode.GetText()); } XmlNode descriptionNode = resultNode.FirstChild("description"); if(!descriptionNode.IsNull()) { m_description = Aws::Utils::Xml::DecodeEscapedXmlText(descriptionNode.GetText()); } XmlNode encryptedNode = resultNode.FirstChild("encrypted"); if(!encryptedNode.IsNull()) { m_encrypted = StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(encryptedNode.GetText()).c_str()).c_str()); } XmlNode ownerIdNode = resultNode.FirstChild("ownerId"); if(!ownerIdNode.IsNull()) { m_ownerId = Aws::Utils::Xml::DecodeEscapedXmlText(ownerIdNode.GetText()); } XmlNode progressNode = resultNode.FirstChild("progress"); if(!progressNode.IsNull()) { m_progress = Aws::Utils::Xml::DecodeEscapedXmlText(progressNode.GetText()); } XmlNode startTimeNode = resultNode.FirstChild("startTime"); if(!startTimeNode.IsNull()) { m_startTime = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(startTimeNode.GetText()).c_str()).c_str(), Aws::Utils::DateFormat::ISO_8601); } XmlNode stateNode = resultNode.FirstChild("status"); if(!stateNode.IsNull()) { m_state = SnapshotStateMapper::GetSnapshotStateForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(stateNode.GetText()).c_str()).c_str()); } XmlNode volumeIdNode = resultNode.FirstChild("volumeId"); if(!volumeIdNode.IsNull()) { m_volumeId = Aws::Utils::Xml::DecodeEscapedXmlText(volumeIdNode.GetText()); } XmlNode volumeSizeNode = resultNode.FirstChild("volumeSize"); if(!volumeSizeNode.IsNull()) { m_volumeSize = StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(volumeSizeNode.GetText()).c_str()).c_str()); } XmlNode sseTypeNode = resultNode.FirstChild("sseType"); if(!sseTypeNode.IsNull()) { m_sseType = SSETypeMapper::GetSSETypeForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(sseTypeNode.GetText()).c_str()).c_str()); } } if (!rootNode.IsNull()) { XmlNode requestIdNode = rootNode.FirstChild("requestId"); if (!requestIdNode.IsNull()) { m_responseMetadata.SetRequestId(StringUtils::Trim(requestIdNode.GetText().c_str())); } AWS_LOGSTREAM_DEBUG("Aws::EC2::Model::RestoreSnapshotFromRecycleBinResponse", "x-amzn-request-id: " << m_responseMetadata.GetRequestId() ); } return *this; }