/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include #include using namespace Aws::IAM::Model; using namespace Aws::Utils::Xml; using namespace Aws::Utils::Logging; using namespace Aws::Utils; using namespace Aws; ListGroupsForUserResult::ListGroupsForUserResult() : m_isTruncated(false) { } ListGroupsForUserResult::ListGroupsForUserResult(const Aws::AmazonWebServiceResult& result) : m_isTruncated(false) { *this = result; } ListGroupsForUserResult& ListGroupsForUserResult::operator =(const Aws::AmazonWebServiceResult& result) { const XmlDocument& xmlDocument = result.GetPayload(); XmlNode rootNode = xmlDocument.GetRootElement(); XmlNode resultNode = rootNode; if (!rootNode.IsNull() && (rootNode.GetName() != "ListGroupsForUserResult")) { resultNode = rootNode.FirstChild("ListGroupsForUserResult"); } if(!resultNode.IsNull()) { XmlNode groupsNode = resultNode.FirstChild("Groups"); if(!groupsNode.IsNull()) { XmlNode groupsMember = groupsNode.FirstChild("member"); while(!groupsMember.IsNull()) { m_groups.push_back(groupsMember); groupsMember = groupsMember.NextNode("member"); } } XmlNode isTruncatedNode = resultNode.FirstChild("IsTruncated"); if(!isTruncatedNode.IsNull()) { m_isTruncated = StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(isTruncatedNode.GetText()).c_str()).c_str()); } XmlNode markerNode = resultNode.FirstChild("Marker"); if(!markerNode.IsNull()) { m_marker = Aws::Utils::Xml::DecodeEscapedXmlText(markerNode.GetText()); } } if (!rootNode.IsNull()) { XmlNode responseMetadataNode = rootNode.FirstChild("ResponseMetadata"); m_responseMetadata = responseMetadataNode; AWS_LOGSTREAM_DEBUG("Aws::IAM::Model::ListGroupsForUserResult", "x-amzn-request-id: " << m_responseMetadata.GetRequestId() ); } return *this; }