/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include using namespace Aws::Utils::Xml; using namespace Aws::Utils; namespace Aws { namespace EC2 { namespace Model { ExportImageTask::ExportImageTask() : m_descriptionHasBeenSet(false), m_exportImageTaskIdHasBeenSet(false), m_imageIdHasBeenSet(false), m_progressHasBeenSet(false), m_s3ExportLocationHasBeenSet(false), m_statusHasBeenSet(false), m_statusMessageHasBeenSet(false), m_tagsHasBeenSet(false) { } ExportImageTask::ExportImageTask(const XmlNode& xmlNode) : m_descriptionHasBeenSet(false), m_exportImageTaskIdHasBeenSet(false), m_imageIdHasBeenSet(false), m_progressHasBeenSet(false), m_s3ExportLocationHasBeenSet(false), m_statusHasBeenSet(false), m_statusMessageHasBeenSet(false), m_tagsHasBeenSet(false) { *this = xmlNode; } ExportImageTask& ExportImageTask::operator =(const XmlNode& xmlNode) { XmlNode resultNode = xmlNode; if(!resultNode.IsNull()) { XmlNode descriptionNode = resultNode.FirstChild("description"); if(!descriptionNode.IsNull()) { m_description = Aws::Utils::Xml::DecodeEscapedXmlText(descriptionNode.GetText()); m_descriptionHasBeenSet = true; } XmlNode exportImageTaskIdNode = resultNode.FirstChild("exportImageTaskId"); if(!exportImageTaskIdNode.IsNull()) { m_exportImageTaskId = Aws::Utils::Xml::DecodeEscapedXmlText(exportImageTaskIdNode.GetText()); m_exportImageTaskIdHasBeenSet = true; } XmlNode imageIdNode = resultNode.FirstChild("imageId"); if(!imageIdNode.IsNull()) { m_imageId = Aws::Utils::Xml::DecodeEscapedXmlText(imageIdNode.GetText()); m_imageIdHasBeenSet = true; } XmlNode progressNode = resultNode.FirstChild("progress"); if(!progressNode.IsNull()) { m_progress = Aws::Utils::Xml::DecodeEscapedXmlText(progressNode.GetText()); m_progressHasBeenSet = true; } XmlNode s3ExportLocationNode = resultNode.FirstChild("s3ExportLocation"); if(!s3ExportLocationNode.IsNull()) { m_s3ExportLocation = s3ExportLocationNode; m_s3ExportLocationHasBeenSet = true; } XmlNode statusNode = resultNode.FirstChild("status"); if(!statusNode.IsNull()) { m_status = Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()); m_statusHasBeenSet = true; } XmlNode statusMessageNode = resultNode.FirstChild("statusMessage"); if(!statusMessageNode.IsNull()) { m_statusMessage = Aws::Utils::Xml::DecodeEscapedXmlText(statusMessageNode.GetText()); m_statusMessageHasBeenSet = true; } XmlNode tagsNode = resultNode.FirstChild("tagSet"); if(!tagsNode.IsNull()) { XmlNode tagsMember = tagsNode.FirstChild("item"); while(!tagsMember.IsNull()) { m_tags.push_back(tagsMember); tagsMember = tagsMember.NextNode("item"); } m_tagsHasBeenSet = true; } } return *this; } void ExportImageTask::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const { if(m_descriptionHasBeenSet) { oStream << location << index << locationValue << ".Description=" << StringUtils::URLEncode(m_description.c_str()) << "&"; } if(m_exportImageTaskIdHasBeenSet) { oStream << location << index << locationValue << ".ExportImageTaskId=" << StringUtils::URLEncode(m_exportImageTaskId.c_str()) << "&"; } if(m_imageIdHasBeenSet) { oStream << location << index << locationValue << ".ImageId=" << StringUtils::URLEncode(m_imageId.c_str()) << "&"; } if(m_progressHasBeenSet) { oStream << location << index << locationValue << ".Progress=" << StringUtils::URLEncode(m_progress.c_str()) << "&"; } if(m_s3ExportLocationHasBeenSet) { Aws::StringStream s3ExportLocationLocationAndMemberSs; s3ExportLocationLocationAndMemberSs << location << index << locationValue << ".S3ExportLocation"; m_s3ExportLocation.OutputToStream(oStream, s3ExportLocationLocationAndMemberSs.str().c_str()); } if(m_statusHasBeenSet) { oStream << location << index << locationValue << ".Status=" << StringUtils::URLEncode(m_status.c_str()) << "&"; } if(m_statusMessageHasBeenSet) { oStream << location << index << locationValue << ".StatusMessage=" << StringUtils::URLEncode(m_statusMessage.c_str()) << "&"; } if(m_tagsHasBeenSet) { unsigned tagsIdx = 1; for(auto& item : m_tags) { Aws::StringStream tagsSs; tagsSs << location << index << locationValue << ".TagSet." << tagsIdx++; item.OutputToStream(oStream, tagsSs.str().c_str()); } } } void ExportImageTask::OutputToStream(Aws::OStream& oStream, const char* location) const { if(m_descriptionHasBeenSet) { oStream << location << ".Description=" << StringUtils::URLEncode(m_description.c_str()) << "&"; } if(m_exportImageTaskIdHasBeenSet) { oStream << location << ".ExportImageTaskId=" << StringUtils::URLEncode(m_exportImageTaskId.c_str()) << "&"; } if(m_imageIdHasBeenSet) { oStream << location << ".ImageId=" << StringUtils::URLEncode(m_imageId.c_str()) << "&"; } if(m_progressHasBeenSet) { oStream << location << ".Progress=" << StringUtils::URLEncode(m_progress.c_str()) << "&"; } if(m_s3ExportLocationHasBeenSet) { Aws::String s3ExportLocationLocationAndMember(location); s3ExportLocationLocationAndMember += ".S3ExportLocation"; m_s3ExportLocation.OutputToStream(oStream, s3ExportLocationLocationAndMember.c_str()); } if(m_statusHasBeenSet) { oStream << location << ".Status=" << StringUtils::URLEncode(m_status.c_str()) << "&"; } if(m_statusMessageHasBeenSet) { oStream << location << ".StatusMessage=" << StringUtils::URLEncode(m_statusMessage.c_str()) << "&"; } if(m_tagsHasBeenSet) { unsigned tagsIdx = 1; for(auto& item : m_tags) { Aws::StringStream tagsSs; tagsSs << location << ".TagSet." << tagsIdx++; item.OutputToStream(oStream, tagsSs.str().c_str()); } } } } // namespace Model } // namespace EC2 } // namespace Aws