71 lines
1.5 KiB
C++
71 lines
1.5 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/sns/model/Topic.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 SNS
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
Topic::Topic() :
|
|
m_topicArnHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
Topic::Topic(const XmlNode& xmlNode) :
|
|
m_topicArnHasBeenSet(false)
|
|
{
|
|
*this = xmlNode;
|
|
}
|
|
|
|
Topic& Topic::operator =(const XmlNode& xmlNode)
|
|
{
|
|
XmlNode resultNode = xmlNode;
|
|
|
|
if(!resultNode.IsNull())
|
|
{
|
|
XmlNode topicArnNode = resultNode.FirstChild("TopicArn");
|
|
if(!topicArnNode.IsNull())
|
|
{
|
|
m_topicArn = Aws::Utils::Xml::DecodeEscapedXmlText(topicArnNode.GetText());
|
|
m_topicArnHasBeenSet = true;
|
|
}
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
void Topic::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
|
|
{
|
|
if(m_topicArnHasBeenSet)
|
|
{
|
|
oStream << location << index << locationValue << ".TopicArn=" << StringUtils::URLEncode(m_topicArn.c_str()) << "&";
|
|
}
|
|
|
|
}
|
|
|
|
void Topic::OutputToStream(Aws::OStream& oStream, const char* location) const
|
|
{
|
|
if(m_topicArnHasBeenSet)
|
|
{
|
|
oStream << location << ".TopicArn=" << StringUtils::URLEncode(m_topicArn.c_str()) << "&";
|
|
}
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace SNS
|
|
} // namespace Aws
|