139 lines
3.8 KiB
C++
139 lines
3.8 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/iam/model/Group.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 IAM
|
|||
|
|
{
|
|||
|
|
namespace Model
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
Group::Group() :
|
|||
|
|
m_pathHasBeenSet(false),
|
|||
|
|
m_groupNameHasBeenSet(false),
|
|||
|
|
m_groupIdHasBeenSet(false),
|
|||
|
|
m_arnHasBeenSet(false),
|
|||
|
|
m_createDateHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Group::Group(const XmlNode& xmlNode) :
|
|||
|
|
m_pathHasBeenSet(false),
|
|||
|
|
m_groupNameHasBeenSet(false),
|
|||
|
|
m_groupIdHasBeenSet(false),
|
|||
|
|
m_arnHasBeenSet(false),
|
|||
|
|
m_createDateHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
*this = xmlNode;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Group& Group::operator =(const XmlNode& xmlNode)
|
|||
|
|
{
|
|||
|
|
XmlNode resultNode = xmlNode;
|
|||
|
|
|
|||
|
|
if(!resultNode.IsNull())
|
|||
|
|
{
|
|||
|
|
XmlNode pathNode = resultNode.FirstChild("Path");
|
|||
|
|
if(!pathNode.IsNull())
|
|||
|
|
{
|
|||
|
|
m_path = Aws::Utils::Xml::DecodeEscapedXmlText(pathNode.GetText());
|
|||
|
|
m_pathHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
XmlNode groupNameNode = resultNode.FirstChild("GroupName");
|
|||
|
|
if(!groupNameNode.IsNull())
|
|||
|
|
{
|
|||
|
|
m_groupName = Aws::Utils::Xml::DecodeEscapedXmlText(groupNameNode.GetText());
|
|||
|
|
m_groupNameHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
XmlNode groupIdNode = resultNode.FirstChild("GroupId");
|
|||
|
|
if(!groupIdNode.IsNull())
|
|||
|
|
{
|
|||
|
|
m_groupId = Aws::Utils::Xml::DecodeEscapedXmlText(groupIdNode.GetText());
|
|||
|
|
m_groupIdHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
XmlNode arnNode = resultNode.FirstChild("Arn");
|
|||
|
|
if(!arnNode.IsNull())
|
|||
|
|
{
|
|||
|
|
m_arn = Aws::Utils::Xml::DecodeEscapedXmlText(arnNode.GetText());
|
|||
|
|
m_arnHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
XmlNode createDateNode = resultNode.FirstChild("CreateDate");
|
|||
|
|
if(!createDateNode.IsNull())
|
|||
|
|
{
|
|||
|
|
m_createDate = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(createDateNode.GetText()).c_str()).c_str(), DateFormat::ISO_8601);
|
|||
|
|
m_createDateHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return *this;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Group::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
|
|||
|
|
{
|
|||
|
|
if(m_pathHasBeenSet)
|
|||
|
|
{
|
|||
|
|
oStream << location << index << locationValue << ".Path=" << StringUtils::URLEncode(m_path.c_str()) << "&";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_groupNameHasBeenSet)
|
|||
|
|
{
|
|||
|
|
oStream << location << index << locationValue << ".GroupName=" << StringUtils::URLEncode(m_groupName.c_str()) << "&";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_groupIdHasBeenSet)
|
|||
|
|
{
|
|||
|
|
oStream << location << index << locationValue << ".GroupId=" << StringUtils::URLEncode(m_groupId.c_str()) << "&";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_arnHasBeenSet)
|
|||
|
|
{
|
|||
|
|
oStream << location << index << locationValue << ".Arn=" << StringUtils::URLEncode(m_arn.c_str()) << "&";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_createDateHasBeenSet)
|
|||
|
|
{
|
|||
|
|
oStream << location << index << locationValue << ".CreateDate=" << StringUtils::URLEncode(m_createDate.ToGmtString(DateFormat::ISO_8601).c_str()) << "&";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Group::OutputToStream(Aws::OStream& oStream, const char* location) const
|
|||
|
|
{
|
|||
|
|
if(m_pathHasBeenSet)
|
|||
|
|
{
|
|||
|
|
oStream << location << ".Path=" << StringUtils::URLEncode(m_path.c_str()) << "&";
|
|||
|
|
}
|
|||
|
|
if(m_groupNameHasBeenSet)
|
|||
|
|
{
|
|||
|
|
oStream << location << ".GroupName=" << StringUtils::URLEncode(m_groupName.c_str()) << "&";
|
|||
|
|
}
|
|||
|
|
if(m_groupIdHasBeenSet)
|
|||
|
|
{
|
|||
|
|
oStream << location << ".GroupId=" << StringUtils::URLEncode(m_groupId.c_str()) << "&";
|
|||
|
|
}
|
|||
|
|
if(m_arnHasBeenSet)
|
|||
|
|
{
|
|||
|
|
oStream << location << ".Arn=" << StringUtils::URLEncode(m_arn.c_str()) << "&";
|
|||
|
|
}
|
|||
|
|
if(m_createDateHasBeenSet)
|
|||
|
|
{
|
|||
|
|
oStream << location << ".CreateDate=" << StringUtils::URLEncode(m_createDate.ToGmtString(DateFormat::ISO_8601).c_str()) << "&";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} // namespace Model
|
|||
|
|
} // namespace IAM
|
|||
|
|
} // namespace Aws
|