This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
pxz-hos-client-cpp-module/support/aws-sdk-cpp-master/aws-cpp-sdk-ec2/source/model/CreateKeyPairResponse.cpp

84 lines
2.5 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ec2/model/CreateKeyPairResponse.h>
#include <aws/core/utils/xml/XmlSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/logging/LogMacros.h>
#include <utility>
using namespace Aws::EC2::Model;
using namespace Aws::Utils::Xml;
using namespace Aws::Utils::Logging;
using namespace Aws::Utils;
using namespace Aws;
CreateKeyPairResponse::CreateKeyPairResponse()
{
}
CreateKeyPairResponse::CreateKeyPairResponse(const Aws::AmazonWebServiceResult<XmlDocument>& result)
{
*this = result;
}
CreateKeyPairResponse& CreateKeyPairResponse::operator =(const Aws::AmazonWebServiceResult<XmlDocument>& result)
{
const XmlDocument& xmlDocument = result.GetPayload();
XmlNode rootNode = xmlDocument.GetRootElement();
XmlNode resultNode = rootNode;
if (!rootNode.IsNull() && (rootNode.GetName() != "CreateKeyPairResponse"))
{
resultNode = rootNode.FirstChild("CreateKeyPairResponse");
}
if(!resultNode.IsNull())
{
XmlNode keyFingerprintNode = resultNode.FirstChild("keyFingerprint");
if(!keyFingerprintNode.IsNull())
{
m_keyFingerprint = Aws::Utils::Xml::DecodeEscapedXmlText(keyFingerprintNode.GetText());
}
XmlNode keyMaterialNode = resultNode.FirstChild("keyMaterial");
if(!keyMaterialNode.IsNull())
{
m_keyMaterial = Aws::Utils::Xml::DecodeEscapedXmlText(keyMaterialNode.GetText());
}
XmlNode keyNameNode = resultNode.FirstChild("keyName");
if(!keyNameNode.IsNull())
{
m_keyName = Aws::Utils::Xml::DecodeEscapedXmlText(keyNameNode.GetText());
}
XmlNode keyPairIdNode = resultNode.FirstChild("keyPairId");
if(!keyPairIdNode.IsNull())
{
m_keyPairId = Aws::Utils::Xml::DecodeEscapedXmlText(keyPairIdNode.GetText());
}
XmlNode tagsNode = resultNode.FirstChild("tagSet");
if(!tagsNode.IsNull())
{
XmlNode tagsMember = tagsNode.FirstChild("item");
while(!tagsMember.IsNull())
{
m_tags.push_back(tagsMember);
tagsMember = tagsMember.NextNode("item");
}
}
}
if (!rootNode.IsNull()) {
XmlNode requestIdNode = rootNode.FirstChild("requestId");
if (!requestIdNode.IsNull())
{
m_responseMetadata.SetRequestId(StringUtils::Trim(requestIdNode.GetText().c_str()));
}
AWS_LOGSTREAM_DEBUG("Aws::EC2::Model::CreateKeyPairResponse", "x-amzn-request-id: " << m_responseMetadata.GetRequestId() );
}
return *this;
}