/** * 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 { LocalGateway::LocalGateway() : m_localGatewayIdHasBeenSet(false), m_outpostArnHasBeenSet(false), m_ownerIdHasBeenSet(false), m_stateHasBeenSet(false), m_tagsHasBeenSet(false) { } LocalGateway::LocalGateway(const XmlNode& xmlNode) : m_localGatewayIdHasBeenSet(false), m_outpostArnHasBeenSet(false), m_ownerIdHasBeenSet(false), m_stateHasBeenSet(false), m_tagsHasBeenSet(false) { *this = xmlNode; } LocalGateway& LocalGateway::operator =(const XmlNode& xmlNode) { XmlNode resultNode = xmlNode; if(!resultNode.IsNull()) { XmlNode localGatewayIdNode = resultNode.FirstChild("localGatewayId"); if(!localGatewayIdNode.IsNull()) { m_localGatewayId = Aws::Utils::Xml::DecodeEscapedXmlText(localGatewayIdNode.GetText()); m_localGatewayIdHasBeenSet = true; } XmlNode outpostArnNode = resultNode.FirstChild("outpostArn"); if(!outpostArnNode.IsNull()) { m_outpostArn = Aws::Utils::Xml::DecodeEscapedXmlText(outpostArnNode.GetText()); m_outpostArnHasBeenSet = true; } XmlNode ownerIdNode = resultNode.FirstChild("ownerId"); if(!ownerIdNode.IsNull()) { m_ownerId = Aws::Utils::Xml::DecodeEscapedXmlText(ownerIdNode.GetText()); m_ownerIdHasBeenSet = true; } XmlNode stateNode = resultNode.FirstChild("state"); if(!stateNode.IsNull()) { m_state = Aws::Utils::Xml::DecodeEscapedXmlText(stateNode.GetText()); m_stateHasBeenSet = 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 LocalGateway::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const { if(m_localGatewayIdHasBeenSet) { oStream << location << index << locationValue << ".LocalGatewayId=" << StringUtils::URLEncode(m_localGatewayId.c_str()) << "&"; } if(m_outpostArnHasBeenSet) { oStream << location << index << locationValue << ".OutpostArn=" << StringUtils::URLEncode(m_outpostArn.c_str()) << "&"; } if(m_ownerIdHasBeenSet) { oStream << location << index << locationValue << ".OwnerId=" << StringUtils::URLEncode(m_ownerId.c_str()) << "&"; } if(m_stateHasBeenSet) { oStream << location << index << locationValue << ".State=" << StringUtils::URLEncode(m_state.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 LocalGateway::OutputToStream(Aws::OStream& oStream, const char* location) const { if(m_localGatewayIdHasBeenSet) { oStream << location << ".LocalGatewayId=" << StringUtils::URLEncode(m_localGatewayId.c_str()) << "&"; } if(m_outpostArnHasBeenSet) { oStream << location << ".OutpostArn=" << StringUtils::URLEncode(m_outpostArn.c_str()) << "&"; } if(m_ownerIdHasBeenSet) { oStream << location << ".OwnerId=" << StringUtils::URLEncode(m_ownerId.c_str()) << "&"; } if(m_stateHasBeenSet) { oStream << location << ".State=" << StringUtils::URLEncode(m_state.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