1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #include <aws/cloudformation/model/ListTypeVersionsResult.h> 7 #include <aws/core/utils/xml/XmlSerializer.h> 8 #include <aws/core/AmazonWebServiceResult.h> 9 #include <aws/core/utils/StringUtils.h> 10 #include <aws/core/utils/logging/LogMacros.h> 11 12 #include <utility> 13 14 using namespace Aws::CloudFormation::Model; 15 using namespace Aws::Utils::Xml; 16 using namespace Aws::Utils::Logging; 17 using namespace Aws::Utils; 18 using namespace Aws; 19 ListTypeVersionsResult()20ListTypeVersionsResult::ListTypeVersionsResult() 21 { 22 } 23 ListTypeVersionsResult(const Aws::AmazonWebServiceResult<XmlDocument> & result)24ListTypeVersionsResult::ListTypeVersionsResult(const Aws::AmazonWebServiceResult<XmlDocument>& result) 25 { 26 *this = result; 27 } 28 operator =(const Aws::AmazonWebServiceResult<XmlDocument> & result)29ListTypeVersionsResult& ListTypeVersionsResult::operator =(const Aws::AmazonWebServiceResult<XmlDocument>& result) 30 { 31 const XmlDocument& xmlDocument = result.GetPayload(); 32 XmlNode rootNode = xmlDocument.GetRootElement(); 33 XmlNode resultNode = rootNode; 34 if (!rootNode.IsNull() && (rootNode.GetName() != "ListTypeVersionsResult")) 35 { 36 resultNode = rootNode.FirstChild("ListTypeVersionsResult"); 37 } 38 39 if(!resultNode.IsNull()) 40 { 41 XmlNode typeVersionSummariesNode = resultNode.FirstChild("TypeVersionSummaries"); 42 if(!typeVersionSummariesNode.IsNull()) 43 { 44 XmlNode typeVersionSummariesMember = typeVersionSummariesNode.FirstChild("member"); 45 while(!typeVersionSummariesMember.IsNull()) 46 { 47 m_typeVersionSummaries.push_back(typeVersionSummariesMember); 48 typeVersionSummariesMember = typeVersionSummariesMember.NextNode("member"); 49 } 50 51 } 52 XmlNode nextTokenNode = resultNode.FirstChild("NextToken"); 53 if(!nextTokenNode.IsNull()) 54 { 55 m_nextToken = Aws::Utils::Xml::DecodeEscapedXmlText(nextTokenNode.GetText()); 56 } 57 } 58 59 if (!rootNode.IsNull()) { 60 XmlNode responseMetadataNode = rootNode.FirstChild("ResponseMetadata"); 61 m_responseMetadata = responseMetadataNode; 62 AWS_LOGSTREAM_DEBUG("Aws::CloudFormation::Model::ListTypeVersionsResult", "x-amzn-request-id: " << m_responseMetadata.GetRequestId() ); 63 } 64 return *this; 65 } 66