This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
pxz-hos-client-cpp-module/support/aws-sdk-cpp-master/aws-cpp-sdk-ec2/source/model/SnapshotTaskDetail.cpp

249 lines
7.7 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ec2/model/SnapshotTaskDetail.h>
#include <aws/core/utils/xml/XmlSerializer.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <utility>
using namespace Aws::Utils::Xml;
using namespace Aws::Utils;
namespace Aws
{
namespace EC2
{
namespace Model
{
SnapshotTaskDetail::SnapshotTaskDetail() :
m_descriptionHasBeenSet(false),
m_diskImageSize(0.0),
m_diskImageSizeHasBeenSet(false),
m_encrypted(false),
m_encryptedHasBeenSet(false),
m_formatHasBeenSet(false),
m_kmsKeyIdHasBeenSet(false),
m_progressHasBeenSet(false),
m_snapshotIdHasBeenSet(false),
m_statusHasBeenSet(false),
m_statusMessageHasBeenSet(false),
m_urlHasBeenSet(false),
m_userBucketHasBeenSet(false)
{
}
SnapshotTaskDetail::SnapshotTaskDetail(const XmlNode& xmlNode) :
m_descriptionHasBeenSet(false),
m_diskImageSize(0.0),
m_diskImageSizeHasBeenSet(false),
m_encrypted(false),
m_encryptedHasBeenSet(false),
m_formatHasBeenSet(false),
m_kmsKeyIdHasBeenSet(false),
m_progressHasBeenSet(false),
m_snapshotIdHasBeenSet(false),
m_statusHasBeenSet(false),
m_statusMessageHasBeenSet(false),
m_urlHasBeenSet(false),
m_userBucketHasBeenSet(false)
{
*this = xmlNode;
}
SnapshotTaskDetail& SnapshotTaskDetail::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 diskImageSizeNode = resultNode.FirstChild("diskImageSize");
if(!diskImageSizeNode.IsNull())
{
m_diskImageSize = StringUtils::ConvertToDouble(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(diskImageSizeNode.GetText()).c_str()).c_str());
m_diskImageSizeHasBeenSet = true;
}
XmlNode encryptedNode = resultNode.FirstChild("encrypted");
if(!encryptedNode.IsNull())
{
m_encrypted = StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(encryptedNode.GetText()).c_str()).c_str());
m_encryptedHasBeenSet = true;
}
XmlNode formatNode = resultNode.FirstChild("format");
if(!formatNode.IsNull())
{
m_format = Aws::Utils::Xml::DecodeEscapedXmlText(formatNode.GetText());
m_formatHasBeenSet = true;
}
XmlNode kmsKeyIdNode = resultNode.FirstChild("kmsKeyId");
if(!kmsKeyIdNode.IsNull())
{
m_kmsKeyId = Aws::Utils::Xml::DecodeEscapedXmlText(kmsKeyIdNode.GetText());
m_kmsKeyIdHasBeenSet = true;
}
XmlNode progressNode = resultNode.FirstChild("progress");
if(!progressNode.IsNull())
{
m_progress = Aws::Utils::Xml::DecodeEscapedXmlText(progressNode.GetText());
m_progressHasBeenSet = true;
}
XmlNode snapshotIdNode = resultNode.FirstChild("snapshotId");
if(!snapshotIdNode.IsNull())
{
m_snapshotId = Aws::Utils::Xml::DecodeEscapedXmlText(snapshotIdNode.GetText());
m_snapshotIdHasBeenSet = 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 urlNode = resultNode.FirstChild("url");
if(!urlNode.IsNull())
{
m_url = Aws::Utils::Xml::DecodeEscapedXmlText(urlNode.GetText());
m_urlHasBeenSet = true;
}
XmlNode userBucketNode = resultNode.FirstChild("userBucket");
if(!userBucketNode.IsNull())
{
m_userBucket = userBucketNode;
m_userBucketHasBeenSet = true;
}
}
return *this;
}
void SnapshotTaskDetail::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_diskImageSizeHasBeenSet)
{
oStream << location << index << locationValue << ".DiskImageSize=" << StringUtils::URLEncode(m_diskImageSize) << "&";
}
if(m_encryptedHasBeenSet)
{
oStream << location << index << locationValue << ".Encrypted=" << std::boolalpha << m_encrypted << "&";
}
if(m_formatHasBeenSet)
{
oStream << location << index << locationValue << ".Format=" << StringUtils::URLEncode(m_format.c_str()) << "&";
}
if(m_kmsKeyIdHasBeenSet)
{
oStream << location << index << locationValue << ".KmsKeyId=" << StringUtils::URLEncode(m_kmsKeyId.c_str()) << "&";
}
if(m_progressHasBeenSet)
{
oStream << location << index << locationValue << ".Progress=" << StringUtils::URLEncode(m_progress.c_str()) << "&";
}
if(m_snapshotIdHasBeenSet)
{
oStream << location << index << locationValue << ".SnapshotId=" << StringUtils::URLEncode(m_snapshotId.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_urlHasBeenSet)
{
oStream << location << index << locationValue << ".Url=" << StringUtils::URLEncode(m_url.c_str()) << "&";
}
if(m_userBucketHasBeenSet)
{
Aws::StringStream userBucketLocationAndMemberSs;
userBucketLocationAndMemberSs << location << index << locationValue << ".UserBucket";
m_userBucket.OutputToStream(oStream, userBucketLocationAndMemberSs.str().c_str());
}
}
void SnapshotTaskDetail::OutputToStream(Aws::OStream& oStream, const char* location) const
{
if(m_descriptionHasBeenSet)
{
oStream << location << ".Description=" << StringUtils::URLEncode(m_description.c_str()) << "&";
}
if(m_diskImageSizeHasBeenSet)
{
oStream << location << ".DiskImageSize=" << StringUtils::URLEncode(m_diskImageSize) << "&";
}
if(m_encryptedHasBeenSet)
{
oStream << location << ".Encrypted=" << std::boolalpha << m_encrypted << "&";
}
if(m_formatHasBeenSet)
{
oStream << location << ".Format=" << StringUtils::URLEncode(m_format.c_str()) << "&";
}
if(m_kmsKeyIdHasBeenSet)
{
oStream << location << ".KmsKeyId=" << StringUtils::URLEncode(m_kmsKeyId.c_str()) << "&";
}
if(m_progressHasBeenSet)
{
oStream << location << ".Progress=" << StringUtils::URLEncode(m_progress.c_str()) << "&";
}
if(m_snapshotIdHasBeenSet)
{
oStream << location << ".SnapshotId=" << StringUtils::URLEncode(m_snapshotId.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_urlHasBeenSet)
{
oStream << location << ".Url=" << StringUtils::URLEncode(m_url.c_str()) << "&";
}
if(m_userBucketHasBeenSet)
{
Aws::String userBucketLocationAndMember(location);
userBucketLocationAndMember += ".UserBucket";
m_userBucket.OutputToStream(oStream, userBucketLocationAndMember.c_str());
}
}
} // namespace Model
} // namespace EC2
} // namespace Aws