/** * 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 Redshift { namespace Model { IPRange::IPRange() : m_statusHasBeenSet(false), m_cIDRIPHasBeenSet(false), m_tagsHasBeenSet(false) { } IPRange::IPRange(const XmlNode& xmlNode) : m_statusHasBeenSet(false), m_cIDRIPHasBeenSet(false), m_tagsHasBeenSet(false) { *this = xmlNode; } IPRange& IPRange::operator =(const XmlNode& xmlNode) { XmlNode resultNode = xmlNode; if(!resultNode.IsNull()) { XmlNode statusNode = resultNode.FirstChild("Status"); if(!statusNode.IsNull()) { m_status = Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText()); m_statusHasBeenSet = true; } XmlNode cIDRIPNode = resultNode.FirstChild("CIDRIP"); if(!cIDRIPNode.IsNull()) { m_cIDRIP = Aws::Utils::Xml::DecodeEscapedXmlText(cIDRIPNode.GetText()); m_cIDRIPHasBeenSet = true; } XmlNode tagsNode = resultNode.FirstChild("Tags"); if(!tagsNode.IsNull()) { XmlNode tagsMember = tagsNode.FirstChild("Tag"); while(!tagsMember.IsNull()) { m_tags.push_back(tagsMember); tagsMember = tagsMember.NextNode("Tag"); } m_tagsHasBeenSet = true; } } return *this; } void IPRange::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const { if(m_statusHasBeenSet) { oStream << location << index << locationValue << ".Status=" << StringUtils::URLEncode(m_status.c_str()) << "&"; } if(m_cIDRIPHasBeenSet) { oStream << location << index << locationValue << ".CIDRIP=" << StringUtils::URLEncode(m_cIDRIP.c_str()) << "&"; } if(m_tagsHasBeenSet) { unsigned tagsIdx = 1; for(auto& item : m_tags) { Aws::StringStream tagsSs; tagsSs << location << index << locationValue << ".Tag." << tagsIdx++; item.OutputToStream(oStream, tagsSs.str().c_str()); } } } void IPRange::OutputToStream(Aws::OStream& oStream, const char* location) const { if(m_statusHasBeenSet) { oStream << location << ".Status=" << StringUtils::URLEncode(m_status.c_str()) << "&"; } if(m_cIDRIPHasBeenSet) { oStream << location << ".CIDRIP=" << StringUtils::URLEncode(m_cIDRIP.c_str()) << "&"; } if(m_tagsHasBeenSet) { unsigned tagsIdx = 1; for(auto& item : m_tags) { Aws::StringStream tagsSs; tagsSs << location << ".Tag." << tagsIdx++; item.OutputToStream(oStream, tagsSs.str().c_str()); } } } } // namespace Model } // namespace Redshift } // namespace Aws