128 lines
4.3 KiB
C++
128 lines
4.3 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/ec2/model/TransitGatewayMulticastDomainAssociation.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
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
TransitGatewayMulticastDomainAssociation::TransitGatewayMulticastDomainAssociation() :
|
|||
|
|
m_transitGatewayAttachmentIdHasBeenSet(false),
|
|||
|
|
m_resourceIdHasBeenSet(false),
|
|||
|
|
m_resourceType(TransitGatewayAttachmentResourceType::NOT_SET),
|
|||
|
|
m_resourceTypeHasBeenSet(false),
|
|||
|
|
m_subnetHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
TransitGatewayMulticastDomainAssociation::TransitGatewayMulticastDomainAssociation(const XmlNode& xmlNode) :
|
|||
|
|
m_transitGatewayAttachmentIdHasBeenSet(false),
|
|||
|
|
m_resourceIdHasBeenSet(false),
|
|||
|
|
m_resourceType(TransitGatewayAttachmentResourceType::NOT_SET),
|
|||
|
|
m_resourceTypeHasBeenSet(false),
|
|||
|
|
m_subnetHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
*this = xmlNode;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
TransitGatewayMulticastDomainAssociation& TransitGatewayMulticastDomainAssociation::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 subnetNode = resultNode.FirstChild("subnet");
|
|||
|
|
if(!subnetNode.IsNull())
|
|||
|
|
{
|
|||
|
|
m_subnet = subnetNode;
|
|||
|
|
m_subnetHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return *this;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void TransitGatewayMulticastDomainAssociation::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_subnetHasBeenSet)
|
|||
|
|
{
|
|||
|
|
Aws::StringStream subnetLocationAndMemberSs;
|
|||
|
|
subnetLocationAndMemberSs << location << index << locationValue << ".Subnet";
|
|||
|
|
m_subnet.OutputToStream(oStream, subnetLocationAndMemberSs.str().c_str());
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void TransitGatewayMulticastDomainAssociation::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_subnetHasBeenSet)
|
|||
|
|
{
|
|||
|
|
Aws::String subnetLocationAndMember(location);
|
|||
|
|
subnetLocationAndMember += ".Subnet";
|
|||
|
|
m_subnet.OutputToStream(oStream, subnetLocationAndMember.c_str());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} // namespace Model
|
|||
|
|
} // namespace EC2
|
|||
|
|
} // namespace Aws
|