/** * 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 { TransitGatewayAttachmentAssociation::TransitGatewayAttachmentAssociation() : m_transitGatewayRouteTableIdHasBeenSet(false), m_state(TransitGatewayAssociationState::NOT_SET), m_stateHasBeenSet(false) { } TransitGatewayAttachmentAssociation::TransitGatewayAttachmentAssociation(const XmlNode& xmlNode) : m_transitGatewayRouteTableIdHasBeenSet(false), m_state(TransitGatewayAssociationState::NOT_SET), m_stateHasBeenSet(false) { *this = xmlNode; } TransitGatewayAttachmentAssociation& TransitGatewayAttachmentAssociation::operator =(const XmlNode& xmlNode) { XmlNode resultNode = xmlNode; if(!resultNode.IsNull()) { XmlNode transitGatewayRouteTableIdNode = resultNode.FirstChild("transitGatewayRouteTableId"); if(!transitGatewayRouteTableIdNode.IsNull()) { m_transitGatewayRouteTableId = Aws::Utils::Xml::DecodeEscapedXmlText(transitGatewayRouteTableIdNode.GetText()); m_transitGatewayRouteTableIdHasBeenSet = true; } XmlNode stateNode = resultNode.FirstChild("state"); if(!stateNode.IsNull()) { m_state = TransitGatewayAssociationStateMapper::GetTransitGatewayAssociationStateForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(stateNode.GetText()).c_str()).c_str()); m_stateHasBeenSet = true; } } return *this; } void TransitGatewayAttachmentAssociation::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const { if(m_transitGatewayRouteTableIdHasBeenSet) { oStream << location << index << locationValue << ".TransitGatewayRouteTableId=" << StringUtils::URLEncode(m_transitGatewayRouteTableId.c_str()) << "&"; } if(m_stateHasBeenSet) { oStream << location << index << locationValue << ".State=" << TransitGatewayAssociationStateMapper::GetNameForTransitGatewayAssociationState(m_state) << "&"; } } void TransitGatewayAttachmentAssociation::OutputToStream(Aws::OStream& oStream, const char* location) const { if(m_transitGatewayRouteTableIdHasBeenSet) { oStream << location << ".TransitGatewayRouteTableId=" << StringUtils::URLEncode(m_transitGatewayRouteTableId.c_str()) << "&"; } if(m_stateHasBeenSet) { oStream << location << ".State=" << TransitGatewayAssociationStateMapper::GetNameForTransitGatewayAssociationState(m_state) << "&"; } } } // namespace Model } // namespace EC2 } // namespace Aws