126 lines
4.4 KiB
C++
126 lines
4.4 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/ec2/model/TransitGatewayRouteTableAssociation.h>
|
|
#include <aws/core/utils/xml/XmlSerializer.h>
|
|
#include <aws/core/utils/StringUtils.h>
|
|
#include <aws/core/utils/memory/stl/AWSStringStream.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Xml;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace EC2
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
TransitGatewayRouteTableAssociation::TransitGatewayRouteTableAssociation() :
|
|
m_transitGatewayAttachmentIdHasBeenSet(false),
|
|
m_resourceIdHasBeenSet(false),
|
|
m_resourceType(TransitGatewayAttachmentResourceType::NOT_SET),
|
|
m_resourceTypeHasBeenSet(false),
|
|
m_state(TransitGatewayAssociationState::NOT_SET),
|
|
m_stateHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
TransitGatewayRouteTableAssociation::TransitGatewayRouteTableAssociation(const XmlNode& xmlNode) :
|
|
m_transitGatewayAttachmentIdHasBeenSet(false),
|
|
m_resourceIdHasBeenSet(false),
|
|
m_resourceType(TransitGatewayAttachmentResourceType::NOT_SET),
|
|
m_resourceTypeHasBeenSet(false),
|
|
m_state(TransitGatewayAssociationState::NOT_SET),
|
|
m_stateHasBeenSet(false)
|
|
{
|
|
*this = xmlNode;
|
|
}
|
|
|
|
TransitGatewayRouteTableAssociation& TransitGatewayRouteTableAssociation::operator =(const XmlNode& xmlNode)
|
|
{
|
|
XmlNode resultNode = xmlNode;
|
|
|
|
if(!resultNode.IsNull())
|
|
{
|
|
XmlNode transitGatewayAttachmentIdNode = resultNode.FirstChild("transitGatewayAttachmentId");
|
|
if(!transitGatewayAttachmentIdNode.IsNull())
|
|
{
|
|
m_transitGatewayAttachmentId = Aws::Utils::Xml::DecodeEscapedXmlText(transitGatewayAttachmentIdNode.GetText());
|
|
m_transitGatewayAttachmentIdHasBeenSet = true;
|
|
}
|
|
XmlNode resourceIdNode = resultNode.FirstChild("resourceId");
|
|
if(!resourceIdNode.IsNull())
|
|
{
|
|
m_resourceId = Aws::Utils::Xml::DecodeEscapedXmlText(resourceIdNode.GetText());
|
|
m_resourceIdHasBeenSet = true;
|
|
}
|
|
XmlNode resourceTypeNode = resultNode.FirstChild("resourceType");
|
|
if(!resourceTypeNode.IsNull())
|
|
{
|
|
m_resourceType = TransitGatewayAttachmentResourceTypeMapper::GetTransitGatewayAttachmentResourceTypeForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(resourceTypeNode.GetText()).c_str()).c_str());
|
|
m_resourceTypeHasBeenSet = 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 TransitGatewayRouteTableAssociation::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
|
|
{
|
|
if(m_transitGatewayAttachmentIdHasBeenSet)
|
|
{
|
|
oStream << location << index << locationValue << ".TransitGatewayAttachmentId=" << StringUtils::URLEncode(m_transitGatewayAttachmentId.c_str()) << "&";
|
|
}
|
|
|
|
if(m_resourceIdHasBeenSet)
|
|
{
|
|
oStream << location << index << locationValue << ".ResourceId=" << StringUtils::URLEncode(m_resourceId.c_str()) << "&";
|
|
}
|
|
|
|
if(m_resourceTypeHasBeenSet)
|
|
{
|
|
oStream << location << index << locationValue << ".ResourceType=" << TransitGatewayAttachmentResourceTypeMapper::GetNameForTransitGatewayAttachmentResourceType(m_resourceType) << "&";
|
|
}
|
|
|
|
if(m_stateHasBeenSet)
|
|
{
|
|
oStream << location << index << locationValue << ".State=" << TransitGatewayAssociationStateMapper::GetNameForTransitGatewayAssociationState(m_state) << "&";
|
|
}
|
|
|
|
}
|
|
|
|
void TransitGatewayRouteTableAssociation::OutputToStream(Aws::OStream& oStream, const char* location) const
|
|
{
|
|
if(m_transitGatewayAttachmentIdHasBeenSet)
|
|
{
|
|
oStream << location << ".TransitGatewayAttachmentId=" << StringUtils::URLEncode(m_transitGatewayAttachmentId.c_str()) << "&";
|
|
}
|
|
if(m_resourceIdHasBeenSet)
|
|
{
|
|
oStream << location << ".ResourceId=" << StringUtils::URLEncode(m_resourceId.c_str()) << "&";
|
|
}
|
|
if(m_resourceTypeHasBeenSet)
|
|
{
|
|
oStream << location << ".ResourceType=" << TransitGatewayAttachmentResourceTypeMapper::GetNameForTransitGatewayAttachmentResourceType(m_resourceType) << "&";
|
|
}
|
|
if(m_stateHasBeenSet)
|
|
{
|
|
oStream << location << ".State=" << TransitGatewayAssociationStateMapper::GetNameForTransitGatewayAssociationState(m_state) << "&";
|
|
}
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace EC2
|
|
} // namespace Aws
|