/** * 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 { VerifiedAccessEndpointLoadBalancerOptions::VerifiedAccessEndpointLoadBalancerOptions() : m_protocol(VerifiedAccessEndpointProtocol::NOT_SET), m_protocolHasBeenSet(false), m_port(0), m_portHasBeenSet(false), m_loadBalancerArnHasBeenSet(false), m_subnetIdsHasBeenSet(false) { } VerifiedAccessEndpointLoadBalancerOptions::VerifiedAccessEndpointLoadBalancerOptions(const XmlNode& xmlNode) : m_protocol(VerifiedAccessEndpointProtocol::NOT_SET), m_protocolHasBeenSet(false), m_port(0), m_portHasBeenSet(false), m_loadBalancerArnHasBeenSet(false), m_subnetIdsHasBeenSet(false) { *this = xmlNode; } VerifiedAccessEndpointLoadBalancerOptions& VerifiedAccessEndpointLoadBalancerOptions::operator =(const XmlNode& xmlNode) { XmlNode resultNode = xmlNode; if(!resultNode.IsNull()) { XmlNode protocolNode = resultNode.FirstChild("protocol"); if(!protocolNode.IsNull()) { m_protocol = VerifiedAccessEndpointProtocolMapper::GetVerifiedAccessEndpointProtocolForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(protocolNode.GetText()).c_str()).c_str()); m_protocolHasBeenSet = true; } XmlNode portNode = resultNode.FirstChild("port"); if(!portNode.IsNull()) { m_port = StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(portNode.GetText()).c_str()).c_str()); m_portHasBeenSet = true; } XmlNode loadBalancerArnNode = resultNode.FirstChild("loadBalancerArn"); if(!loadBalancerArnNode.IsNull()) { m_loadBalancerArn = Aws::Utils::Xml::DecodeEscapedXmlText(loadBalancerArnNode.GetText()); m_loadBalancerArnHasBeenSet = true; } XmlNode subnetIdsNode = resultNode.FirstChild("subnetIdSet"); if(!subnetIdsNode.IsNull()) { XmlNode subnetIdsMember = subnetIdsNode.FirstChild("item"); while(!subnetIdsMember.IsNull()) { m_subnetIds.push_back(subnetIdsMember.GetText()); subnetIdsMember = subnetIdsMember.NextNode("item"); } m_subnetIdsHasBeenSet = true; } } return *this; } void VerifiedAccessEndpointLoadBalancerOptions::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const { if(m_protocolHasBeenSet) { oStream << location << index << locationValue << ".Protocol=" << VerifiedAccessEndpointProtocolMapper::GetNameForVerifiedAccessEndpointProtocol(m_protocol) << "&"; } if(m_portHasBeenSet) { oStream << location << index << locationValue << ".Port=" << m_port << "&"; } if(m_loadBalancerArnHasBeenSet) { oStream << location << index << locationValue << ".LoadBalancerArn=" << StringUtils::URLEncode(m_loadBalancerArn.c_str()) << "&"; } if(m_subnetIdsHasBeenSet) { unsigned subnetIdsIdx = 1; for(auto& item : m_subnetIds) { oStream << location << index << locationValue << ".SubnetIdSet." << subnetIdsIdx++ << "=" << StringUtils::URLEncode(item.c_str()) << "&"; } } } void VerifiedAccessEndpointLoadBalancerOptions::OutputToStream(Aws::OStream& oStream, const char* location) const { if(m_protocolHasBeenSet) { oStream << location << ".Protocol=" << VerifiedAccessEndpointProtocolMapper::GetNameForVerifiedAccessEndpointProtocol(m_protocol) << "&"; } if(m_portHasBeenSet) { oStream << location << ".Port=" << m_port << "&"; } if(m_loadBalancerArnHasBeenSet) { oStream << location << ".LoadBalancerArn=" << StringUtils::URLEncode(m_loadBalancerArn.c_str()) << "&"; } if(m_subnetIdsHasBeenSet) { unsigned subnetIdsIdx = 1; for(auto& item : m_subnetIds) { oStream << location << ".SubnetIdSet." << subnetIdsIdx++ << "=" << StringUtils::URLEncode(item.c_str()) << "&"; } } } } // namespace Model } // namespace EC2 } // namespace Aws