/** * 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 { NetworkInterfaceAttachmentChanges::NetworkInterfaceAttachmentChanges() : m_attachmentIdHasBeenSet(false), m_deleteOnTermination(false), m_deleteOnTerminationHasBeenSet(false) { } NetworkInterfaceAttachmentChanges::NetworkInterfaceAttachmentChanges(const XmlNode& xmlNode) : m_attachmentIdHasBeenSet(false), m_deleteOnTermination(false), m_deleteOnTerminationHasBeenSet(false) { *this = xmlNode; } NetworkInterfaceAttachmentChanges& NetworkInterfaceAttachmentChanges::operator =(const XmlNode& xmlNode) { XmlNode resultNode = xmlNode; if(!resultNode.IsNull()) { XmlNode attachmentIdNode = resultNode.FirstChild("attachmentId"); if(!attachmentIdNode.IsNull()) { m_attachmentId = Aws::Utils::Xml::DecodeEscapedXmlText(attachmentIdNode.GetText()); m_attachmentIdHasBeenSet = true; } XmlNode deleteOnTerminationNode = resultNode.FirstChild("deleteOnTermination"); if(!deleteOnTerminationNode.IsNull()) { m_deleteOnTermination = StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(deleteOnTerminationNode.GetText()).c_str()).c_str()); m_deleteOnTerminationHasBeenSet = true; } } return *this; } void NetworkInterfaceAttachmentChanges::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const { if(m_attachmentIdHasBeenSet) { oStream << location << index << locationValue << ".AttachmentId=" << StringUtils::URLEncode(m_attachmentId.c_str()) << "&"; } if(m_deleteOnTerminationHasBeenSet) { oStream << location << index << locationValue << ".DeleteOnTermination=" << std::boolalpha << m_deleteOnTermination << "&"; } } void NetworkInterfaceAttachmentChanges::OutputToStream(Aws::OStream& oStream, const char* location) const { if(m_attachmentIdHasBeenSet) { oStream << location << ".AttachmentId=" << StringUtils::URLEncode(m_attachmentId.c_str()) << "&"; } if(m_deleteOnTerminationHasBeenSet) { oStream << location << ".DeleteOnTermination=" << std::boolalpha << m_deleteOnTermination << "&"; } } } // namespace Model } // namespace EC2 } // namespace Aws