feat(hos_client_create, hos_client_destory): 多次调用destory不会导致重复释放

This commit is contained in:
彭宣正
2020-12-14 17:24:58 +08:00
parent 505d529c32
commit 10b370e486
55976 changed files with 8544395 additions and 2 deletions

View File

@@ -0,0 +1,333 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/core/utils/Outcome.h>
#include <aws/core/auth/AWSAuthSigner.h>
#include <aws/core/client/CoreErrors.h>
#include <aws/core/client/RetryStrategy.h>
#include <aws/core/http/HttpClient.h>
#include <aws/core/http/HttpResponse.h>
#include <aws/core/http/HttpClientFactory.h>
#include <aws/core/auth/AWSCredentialsProviderChain.h>
#include <aws/core/utils/xml/XmlSerializer.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <aws/core/utils/threading/Executor.h>
#include <aws/core/utils/DNS.h>
#include <aws/core/utils/logging/LogMacros.h>
#include <aws/sts/STSClient.h>
#include <aws/sts/STSEndpoint.h>
#include <aws/sts/STSErrorMarshaller.h>
#include <aws/sts/model/AssumeRoleRequest.h>
#include <aws/sts/model/AssumeRoleWithSAMLRequest.h>
#include <aws/sts/model/AssumeRoleWithWebIdentityRequest.h>
#include <aws/sts/model/DecodeAuthorizationMessageRequest.h>
#include <aws/sts/model/GetAccessKeyInfoRequest.h>
#include <aws/sts/model/GetCallerIdentityRequest.h>
#include <aws/sts/model/GetFederationTokenRequest.h>
#include <aws/sts/model/GetSessionTokenRequest.h>
using namespace Aws;
using namespace Aws::Auth;
using namespace Aws::Client;
using namespace Aws::STS;
using namespace Aws::STS::Model;
using namespace Aws::Http;
using namespace Aws::Utils::Xml;
static const char* SERVICE_NAME = "sts";
static const char* ALLOCATION_TAG = "STSClient";
STSClient::STSClient(const Client::ClientConfiguration& clientConfiguration) :
BASECLASS(clientConfiguration,
Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG),
SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
Aws::MakeShared<STSErrorMarshaller>(ALLOCATION_TAG)),
m_executor(clientConfiguration.executor)
{
init(clientConfiguration);
}
STSClient::STSClient(const AWSCredentials& credentials, const Client::ClientConfiguration& clientConfiguration) :
BASECLASS(clientConfiguration,
Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<SimpleAWSCredentialsProvider>(ALLOCATION_TAG, credentials),
SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
Aws::MakeShared<STSErrorMarshaller>(ALLOCATION_TAG)),
m_executor(clientConfiguration.executor)
{
init(clientConfiguration);
}
STSClient::STSClient(const std::shared_ptr<AWSCredentialsProvider>& credentialsProvider,
const Client::ClientConfiguration& clientConfiguration) :
BASECLASS(clientConfiguration,
Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, credentialsProvider,
SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
Aws::MakeShared<STSErrorMarshaller>(ALLOCATION_TAG)),
m_executor(clientConfiguration.executor)
{
init(clientConfiguration);
}
STSClient::~STSClient()
{
}
void STSClient::init(const ClientConfiguration& config)
{
SetServiceClientName("STS");
m_configScheme = SchemeMapper::ToString(config.scheme);
if (config.endpointOverride.empty())
{
m_uri = m_configScheme + "://" + STSEndpoint::ForRegion(config.region, config.useDualStack);
}
else
{
OverrideEndpoint(config.endpointOverride);
}
}
void STSClient::OverrideEndpoint(const Aws::String& endpoint)
{
if (endpoint.compare(0, 7, "http://") == 0 || endpoint.compare(0, 8, "https://") == 0)
{
m_uri = endpoint;
}
else
{
m_uri = m_configScheme + "://" + endpoint;
}
}
Aws::String STSClient::ConvertRequestToPresignedUrl(const AmazonSerializableWebServiceRequest& requestToConvert, const char* region) const
{
Aws::StringStream ss;
ss << "https://" << STSEndpoint::ForRegion(region);
ss << "?" << requestToConvert.SerializePayload();
URI uri(ss.str());
return GeneratePresignedUrl(uri, Aws::Http::HttpMethod::HTTP_GET, region, 3600);
}
AssumeRoleOutcome STSClient::AssumeRole(const AssumeRoleRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/";
uri.SetPath(uri.GetPath() + ss.str());
return AssumeRoleOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST));
}
AssumeRoleOutcomeCallable STSClient::AssumeRoleCallable(const AssumeRoleRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< AssumeRoleOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->AssumeRole(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void STSClient::AssumeRoleAsync(const AssumeRoleRequest& request, const AssumeRoleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->AssumeRoleAsyncHelper( request, handler, context ); } );
}
void STSClient::AssumeRoleAsyncHelper(const AssumeRoleRequest& request, const AssumeRoleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, AssumeRole(request), context);
}
AssumeRoleWithSAMLOutcome STSClient::AssumeRoleWithSAML(const AssumeRoleWithSAMLRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/";
uri.SetPath(uri.GetPath() + ss.str());
return AssumeRoleWithSAMLOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST));
}
AssumeRoleWithSAMLOutcomeCallable STSClient::AssumeRoleWithSAMLCallable(const AssumeRoleWithSAMLRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< AssumeRoleWithSAMLOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->AssumeRoleWithSAML(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void STSClient::AssumeRoleWithSAMLAsync(const AssumeRoleWithSAMLRequest& request, const AssumeRoleWithSAMLResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->AssumeRoleWithSAMLAsyncHelper( request, handler, context ); } );
}
void STSClient::AssumeRoleWithSAMLAsyncHelper(const AssumeRoleWithSAMLRequest& request, const AssumeRoleWithSAMLResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, AssumeRoleWithSAML(request), context);
}
AssumeRoleWithWebIdentityOutcome STSClient::AssumeRoleWithWebIdentity(const AssumeRoleWithWebIdentityRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/";
uri.SetPath(uri.GetPath() + ss.str());
return AssumeRoleWithWebIdentityOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST));
}
AssumeRoleWithWebIdentityOutcomeCallable STSClient::AssumeRoleWithWebIdentityCallable(const AssumeRoleWithWebIdentityRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< AssumeRoleWithWebIdentityOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->AssumeRoleWithWebIdentity(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void STSClient::AssumeRoleWithWebIdentityAsync(const AssumeRoleWithWebIdentityRequest& request, const AssumeRoleWithWebIdentityResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->AssumeRoleWithWebIdentityAsyncHelper( request, handler, context ); } );
}
void STSClient::AssumeRoleWithWebIdentityAsyncHelper(const AssumeRoleWithWebIdentityRequest& request, const AssumeRoleWithWebIdentityResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, AssumeRoleWithWebIdentity(request), context);
}
DecodeAuthorizationMessageOutcome STSClient::DecodeAuthorizationMessage(const DecodeAuthorizationMessageRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/";
uri.SetPath(uri.GetPath() + ss.str());
return DecodeAuthorizationMessageOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST));
}
DecodeAuthorizationMessageOutcomeCallable STSClient::DecodeAuthorizationMessageCallable(const DecodeAuthorizationMessageRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< DecodeAuthorizationMessageOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DecodeAuthorizationMessage(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void STSClient::DecodeAuthorizationMessageAsync(const DecodeAuthorizationMessageRequest& request, const DecodeAuthorizationMessageResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->DecodeAuthorizationMessageAsyncHelper( request, handler, context ); } );
}
void STSClient::DecodeAuthorizationMessageAsyncHelper(const DecodeAuthorizationMessageRequest& request, const DecodeAuthorizationMessageResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, DecodeAuthorizationMessage(request), context);
}
GetAccessKeyInfoOutcome STSClient::GetAccessKeyInfo(const GetAccessKeyInfoRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/";
uri.SetPath(uri.GetPath() + ss.str());
return GetAccessKeyInfoOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST));
}
GetAccessKeyInfoOutcomeCallable STSClient::GetAccessKeyInfoCallable(const GetAccessKeyInfoRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< GetAccessKeyInfoOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetAccessKeyInfo(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void STSClient::GetAccessKeyInfoAsync(const GetAccessKeyInfoRequest& request, const GetAccessKeyInfoResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->GetAccessKeyInfoAsyncHelper( request, handler, context ); } );
}
void STSClient::GetAccessKeyInfoAsyncHelper(const GetAccessKeyInfoRequest& request, const GetAccessKeyInfoResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, GetAccessKeyInfo(request), context);
}
GetCallerIdentityOutcome STSClient::GetCallerIdentity(const GetCallerIdentityRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/";
uri.SetPath(uri.GetPath() + ss.str());
return GetCallerIdentityOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST));
}
GetCallerIdentityOutcomeCallable STSClient::GetCallerIdentityCallable(const GetCallerIdentityRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< GetCallerIdentityOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetCallerIdentity(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void STSClient::GetCallerIdentityAsync(const GetCallerIdentityRequest& request, const GetCallerIdentityResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->GetCallerIdentityAsyncHelper( request, handler, context ); } );
}
void STSClient::GetCallerIdentityAsyncHelper(const GetCallerIdentityRequest& request, const GetCallerIdentityResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, GetCallerIdentity(request), context);
}
GetFederationTokenOutcome STSClient::GetFederationToken(const GetFederationTokenRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/";
uri.SetPath(uri.GetPath() + ss.str());
return GetFederationTokenOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST));
}
GetFederationTokenOutcomeCallable STSClient::GetFederationTokenCallable(const GetFederationTokenRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< GetFederationTokenOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetFederationToken(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void STSClient::GetFederationTokenAsync(const GetFederationTokenRequest& request, const GetFederationTokenResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->GetFederationTokenAsyncHelper( request, handler, context ); } );
}
void STSClient::GetFederationTokenAsyncHelper(const GetFederationTokenRequest& request, const GetFederationTokenResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, GetFederationToken(request), context);
}
GetSessionTokenOutcome STSClient::GetSessionToken(const GetSessionTokenRequest& request) const
{
Aws::Http::URI uri = m_uri;
Aws::StringStream ss;
ss << "/";
uri.SetPath(uri.GetPath() + ss.str());
return GetSessionTokenOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST));
}
GetSessionTokenOutcomeCallable STSClient::GetSessionTokenCallable(const GetSessionTokenRequest& request) const
{
auto task = Aws::MakeShared< std::packaged_task< GetSessionTokenOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetSessionToken(request); } );
auto packagedFunction = [task]() { (*task)(); };
m_executor->Submit(packagedFunction);
return task->get_future();
}
void STSClient::GetSessionTokenAsync(const GetSessionTokenRequest& request, const GetSessionTokenResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
m_executor->Submit( [this, request, handler, context](){ this->GetSessionTokenAsyncHelper( request, handler, context ); } );
}
void STSClient::GetSessionTokenAsyncHelper(const GetSessionTokenRequest& request, const GetSessionTokenResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
{
handler(this, request, GetSessionToken(request), context);
}

View File

@@ -0,0 +1,64 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/STSEndpoint.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <aws/core/utils/HashingUtils.h>
using namespace Aws;
using namespace Aws::STS;
namespace Aws
{
namespace STS
{
namespace STSEndpoint
{
static const int CN_NORTH_1_HASH = Aws::Utils::HashingUtils::HashString("cn-north-1");
static const int CN_NORTHWEST_1_HASH = Aws::Utils::HashingUtils::HashString("cn-northwest-1");
static const int US_ISO_EAST_1_HASH = Aws::Utils::HashingUtils::HashString("us-iso-east-1");
static const int US_ISOB_EAST_1_HASH = Aws::Utils::HashingUtils::HashString("us-isob-east-1");
Aws::String ForRegion(const Aws::String& regionName, bool useDualStack)
{
// Fallback to us-east-1 if global endpoint does not exists.
Aws::String region = regionName == Aws::Region::AWS_GLOBAL ? Aws::Region::US_EAST_1 : regionName;
auto hash = Aws::Utils::HashingUtils::HashString(region.c_str());
Aws::StringStream ss;
ss << "sts" << ".";
if(useDualStack)
{
ss << "dualstack.";
}
ss << region;
if (hash == CN_NORTH_1_HASH || hash == CN_NORTHWEST_1_HASH)
{
ss << ".amazonaws.com.cn";
}
else if (hash == US_ISO_EAST_1_HASH)
{
ss << ".c2s.ic.gov";
}
else if (hash == US_ISOB_EAST_1_HASH)
{
ss << ".sc2s.sgov.gov";
}
else
{
ss << ".amazonaws.com";
}
return ss.str();
}
} // namespace STSEndpoint
} // namespace STS
} // namespace Aws

View File

@@ -0,0 +1,22 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/core/client/AWSError.h>
#include <aws/sts/STSErrorMarshaller.h>
#include <aws/sts/STSErrors.h>
using namespace Aws::Client;
using namespace Aws::STS;
AWSError<CoreErrors> STSErrorMarshaller::FindErrorByName(const char* errorName) const
{
AWSError<CoreErrors> error = STSErrorMapper::GetErrorForName(errorName);
if(error.GetErrorType() != CoreErrors::UNKNOWN)
{
return error;
}
return AWSErrorMarshaller::FindErrorByName(errorName);
}

View File

@@ -0,0 +1,72 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/core/client/AWSError.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/sts/STSErrors.h>
using namespace Aws::Client;
using namespace Aws::Utils;
using namespace Aws::STS;
namespace Aws
{
namespace STS
{
namespace STSErrorMapper
{
static const int MALFORMED_POLICY_DOCUMENT_HASH = HashingUtils::HashString("MalformedPolicyDocument");
static const int PACKED_POLICY_TOO_LARGE_HASH = HashingUtils::HashString("PackedPolicyTooLarge");
static const int I_D_P_COMMUNICATION_ERROR_HASH = HashingUtils::HashString("IDPCommunicationError");
static const int I_D_P_REJECTED_CLAIM_HASH = HashingUtils::HashString("IDPRejectedClaim");
static const int EXPIRED_TOKEN_HASH = HashingUtils::HashString("ExpiredTokenException");
static const int INVALID_IDENTITY_TOKEN_HASH = HashingUtils::HashString("InvalidIdentityToken");
static const int INVALID_AUTHORIZATION_MESSAGE_HASH = HashingUtils::HashString("InvalidAuthorizationMessageException");
static const int REGION_DISABLED_HASH = HashingUtils::HashString("RegionDisabledException");
AWSError<CoreErrors> GetErrorForName(const char* errorName)
{
int hashCode = HashingUtils::HashString(errorName);
if (hashCode == MALFORMED_POLICY_DOCUMENT_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(STSErrors::MALFORMED_POLICY_DOCUMENT), false);
}
else if (hashCode == PACKED_POLICY_TOO_LARGE_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(STSErrors::PACKED_POLICY_TOO_LARGE), false);
}
else if (hashCode == I_D_P_COMMUNICATION_ERROR_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(STSErrors::I_D_P_COMMUNICATION_ERROR), false);
}
else if (hashCode == I_D_P_REJECTED_CLAIM_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(STSErrors::I_D_P_REJECTED_CLAIM), false);
}
else if (hashCode == EXPIRED_TOKEN_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(STSErrors::EXPIRED_TOKEN), false);
}
else if (hashCode == INVALID_IDENTITY_TOKEN_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(STSErrors::INVALID_IDENTITY_TOKEN), false);
}
else if (hashCode == INVALID_AUTHORIZATION_MESSAGE_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(STSErrors::INVALID_AUTHORIZATION_MESSAGE), false);
}
else if (hashCode == REGION_DISABLED_HASH)
{
return AWSError<CoreErrors>(static_cast<CoreErrors>(STSErrors::REGION_DISABLED), false);
}
return AWSError<CoreErrors>(CoreErrors::UNKNOWN, false);
}
} // namespace STSErrorMapper
} // namespace STS
} // namespace Aws

View File

@@ -0,0 +1,106 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/AssumeRoleRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
using namespace Aws::STS::Model;
using namespace Aws::Utils;
AssumeRoleRequest::AssumeRoleRequest() :
m_roleArnHasBeenSet(false),
m_roleSessionNameHasBeenSet(false),
m_policyArnsHasBeenSet(false),
m_policyHasBeenSet(false),
m_durationSeconds(0),
m_durationSecondsHasBeenSet(false),
m_tagsHasBeenSet(false),
m_transitiveTagKeysHasBeenSet(false),
m_externalIdHasBeenSet(false),
m_serialNumberHasBeenSet(false),
m_tokenCodeHasBeenSet(false)
{
}
Aws::String AssumeRoleRequest::SerializePayload() const
{
Aws::StringStream ss;
ss << "Action=AssumeRole&";
if(m_roleArnHasBeenSet)
{
ss << "RoleArn=" << StringUtils::URLEncode(m_roleArn.c_str()) << "&";
}
if(m_roleSessionNameHasBeenSet)
{
ss << "RoleSessionName=" << StringUtils::URLEncode(m_roleSessionName.c_str()) << "&";
}
if(m_policyArnsHasBeenSet)
{
unsigned policyArnsCount = 1;
for(auto& item : m_policyArns)
{
item.OutputToStream(ss, "PolicyArns.member.", policyArnsCount, "");
policyArnsCount++;
}
}
if(m_policyHasBeenSet)
{
ss << "Policy=" << StringUtils::URLEncode(m_policy.c_str()) << "&";
}
if(m_durationSecondsHasBeenSet)
{
ss << "DurationSeconds=" << m_durationSeconds << "&";
}
if(m_tagsHasBeenSet)
{
unsigned tagsCount = 1;
for(auto& item : m_tags)
{
item.OutputToStream(ss, "Tags.member.", tagsCount, "");
tagsCount++;
}
}
if(m_transitiveTagKeysHasBeenSet)
{
unsigned transitiveTagKeysCount = 1;
for(auto& item : m_transitiveTagKeys)
{
ss << "TransitiveTagKeys.member." << transitiveTagKeysCount << "="
<< StringUtils::URLEncode(item.c_str()) << "&";
transitiveTagKeysCount++;
}
}
if(m_externalIdHasBeenSet)
{
ss << "ExternalId=" << StringUtils::URLEncode(m_externalId.c_str()) << "&";
}
if(m_serialNumberHasBeenSet)
{
ss << "SerialNumber=" << StringUtils::URLEncode(m_serialNumber.c_str()) << "&";
}
if(m_tokenCodeHasBeenSet)
{
ss << "TokenCode=" << StringUtils::URLEncode(m_tokenCode.c_str()) << "&";
}
ss << "Version=2011-06-15";
return ss.str();
}
void AssumeRoleRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
{
uri.SetQueryString(SerializePayload());
}

View File

@@ -0,0 +1,66 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/AssumeRoleResult.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::STS::Model;
using namespace Aws::Utils::Xml;
using namespace Aws::Utils::Logging;
using namespace Aws::Utils;
using namespace Aws;
AssumeRoleResult::AssumeRoleResult() :
m_packedPolicySize(0)
{
}
AssumeRoleResult::AssumeRoleResult(const Aws::AmazonWebServiceResult<XmlDocument>& result) :
m_packedPolicySize(0)
{
*this = result;
}
AssumeRoleResult& AssumeRoleResult::operator =(const Aws::AmazonWebServiceResult<XmlDocument>& result)
{
const XmlDocument& xmlDocument = result.GetPayload();
XmlNode rootNode = xmlDocument.GetRootElement();
XmlNode resultNode = rootNode;
if (!rootNode.IsNull() && (rootNode.GetName() != "AssumeRoleResult"))
{
resultNode = rootNode.FirstChild("AssumeRoleResult");
}
if(!resultNode.IsNull())
{
XmlNode credentialsNode = resultNode.FirstChild("Credentials");
if(!credentialsNode.IsNull())
{
m_credentials = credentialsNode;
}
XmlNode assumedRoleUserNode = resultNode.FirstChild("AssumedRoleUser");
if(!assumedRoleUserNode.IsNull())
{
m_assumedRoleUser = assumedRoleUserNode;
}
XmlNode packedPolicySizeNode = resultNode.FirstChild("PackedPolicySize");
if(!packedPolicySizeNode.IsNull())
{
m_packedPolicySize = StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(packedPolicySizeNode.GetText()).c_str()).c_str());
}
}
if (!rootNode.IsNull()) {
XmlNode responseMetadataNode = rootNode.FirstChild("ResponseMetadata");
m_responseMetadata = responseMetadataNode;
AWS_LOGSTREAM_DEBUG("Aws::STS::Model::AssumeRoleResult", "x-amzn-request-id: " << m_responseMetadata.GetRequestId() );
}
return *this;
}

View File

@@ -0,0 +1,71 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/AssumeRoleWithSAMLRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
using namespace Aws::STS::Model;
using namespace Aws::Utils;
AssumeRoleWithSAMLRequest::AssumeRoleWithSAMLRequest() :
m_roleArnHasBeenSet(false),
m_principalArnHasBeenSet(false),
m_sAMLAssertionHasBeenSet(false),
m_policyArnsHasBeenSet(false),
m_policyHasBeenSet(false),
m_durationSeconds(0),
m_durationSecondsHasBeenSet(false)
{
}
Aws::String AssumeRoleWithSAMLRequest::SerializePayload() const
{
Aws::StringStream ss;
ss << "Action=AssumeRoleWithSAML&";
if(m_roleArnHasBeenSet)
{
ss << "RoleArn=" << StringUtils::URLEncode(m_roleArn.c_str()) << "&";
}
if(m_principalArnHasBeenSet)
{
ss << "PrincipalArn=" << StringUtils::URLEncode(m_principalArn.c_str()) << "&";
}
if(m_sAMLAssertionHasBeenSet)
{
ss << "SAMLAssertion=" << StringUtils::URLEncode(m_sAMLAssertion.c_str()) << "&";
}
if(m_policyArnsHasBeenSet)
{
unsigned policyArnsCount = 1;
for(auto& item : m_policyArns)
{
item.OutputToStream(ss, "PolicyArns.member.", policyArnsCount, "");
policyArnsCount++;
}
}
if(m_policyHasBeenSet)
{
ss << "Policy=" << StringUtils::URLEncode(m_policy.c_str()) << "&";
}
if(m_durationSecondsHasBeenSet)
{
ss << "DurationSeconds=" << m_durationSeconds << "&";
}
ss << "Version=2011-06-15";
return ss.str();
}
void AssumeRoleWithSAMLRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
{
uri.SetQueryString(SerializePayload());
}

View File

@@ -0,0 +1,91 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/AssumeRoleWithSAMLResult.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::STS::Model;
using namespace Aws::Utils::Xml;
using namespace Aws::Utils::Logging;
using namespace Aws::Utils;
using namespace Aws;
AssumeRoleWithSAMLResult::AssumeRoleWithSAMLResult() :
m_packedPolicySize(0)
{
}
AssumeRoleWithSAMLResult::AssumeRoleWithSAMLResult(const Aws::AmazonWebServiceResult<XmlDocument>& result) :
m_packedPolicySize(0)
{
*this = result;
}
AssumeRoleWithSAMLResult& AssumeRoleWithSAMLResult::operator =(const Aws::AmazonWebServiceResult<XmlDocument>& result)
{
const XmlDocument& xmlDocument = result.GetPayload();
XmlNode rootNode = xmlDocument.GetRootElement();
XmlNode resultNode = rootNode;
if (!rootNode.IsNull() && (rootNode.GetName() != "AssumeRoleWithSAMLResult"))
{
resultNode = rootNode.FirstChild("AssumeRoleWithSAMLResult");
}
if(!resultNode.IsNull())
{
XmlNode credentialsNode = resultNode.FirstChild("Credentials");
if(!credentialsNode.IsNull())
{
m_credentials = credentialsNode;
}
XmlNode assumedRoleUserNode = resultNode.FirstChild("AssumedRoleUser");
if(!assumedRoleUserNode.IsNull())
{
m_assumedRoleUser = assumedRoleUserNode;
}
XmlNode packedPolicySizeNode = resultNode.FirstChild("PackedPolicySize");
if(!packedPolicySizeNode.IsNull())
{
m_packedPolicySize = StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(packedPolicySizeNode.GetText()).c_str()).c_str());
}
XmlNode subjectNode = resultNode.FirstChild("Subject");
if(!subjectNode.IsNull())
{
m_subject = Aws::Utils::Xml::DecodeEscapedXmlText(subjectNode.GetText());
}
XmlNode subjectTypeNode = resultNode.FirstChild("SubjectType");
if(!subjectTypeNode.IsNull())
{
m_subjectType = Aws::Utils::Xml::DecodeEscapedXmlText(subjectTypeNode.GetText());
}
XmlNode issuerNode = resultNode.FirstChild("Issuer");
if(!issuerNode.IsNull())
{
m_issuer = Aws::Utils::Xml::DecodeEscapedXmlText(issuerNode.GetText());
}
XmlNode audienceNode = resultNode.FirstChild("Audience");
if(!audienceNode.IsNull())
{
m_audience = Aws::Utils::Xml::DecodeEscapedXmlText(audienceNode.GetText());
}
XmlNode nameQualifierNode = resultNode.FirstChild("NameQualifier");
if(!nameQualifierNode.IsNull())
{
m_nameQualifier = Aws::Utils::Xml::DecodeEscapedXmlText(nameQualifierNode.GetText());
}
}
if (!rootNode.IsNull()) {
XmlNode responseMetadataNode = rootNode.FirstChild("ResponseMetadata");
m_responseMetadata = responseMetadataNode;
AWS_LOGSTREAM_DEBUG("Aws::STS::Model::AssumeRoleWithSAMLResult", "x-amzn-request-id: " << m_responseMetadata.GetRequestId() );
}
return *this;
}

View File

@@ -0,0 +1,77 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/AssumeRoleWithWebIdentityRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
using namespace Aws::STS::Model;
using namespace Aws::Utils;
AssumeRoleWithWebIdentityRequest::AssumeRoleWithWebIdentityRequest() :
m_roleArnHasBeenSet(false),
m_roleSessionNameHasBeenSet(false),
m_webIdentityTokenHasBeenSet(false),
m_providerIdHasBeenSet(false),
m_policyArnsHasBeenSet(false),
m_policyHasBeenSet(false),
m_durationSeconds(0),
m_durationSecondsHasBeenSet(false)
{
}
Aws::String AssumeRoleWithWebIdentityRequest::SerializePayload() const
{
Aws::StringStream ss;
ss << "Action=AssumeRoleWithWebIdentity&";
if(m_roleArnHasBeenSet)
{
ss << "RoleArn=" << StringUtils::URLEncode(m_roleArn.c_str()) << "&";
}
if(m_roleSessionNameHasBeenSet)
{
ss << "RoleSessionName=" << StringUtils::URLEncode(m_roleSessionName.c_str()) << "&";
}
if(m_webIdentityTokenHasBeenSet)
{
ss << "WebIdentityToken=" << StringUtils::URLEncode(m_webIdentityToken.c_str()) << "&";
}
if(m_providerIdHasBeenSet)
{
ss << "ProviderId=" << StringUtils::URLEncode(m_providerId.c_str()) << "&";
}
if(m_policyArnsHasBeenSet)
{
unsigned policyArnsCount = 1;
for(auto& item : m_policyArns)
{
item.OutputToStream(ss, "PolicyArns.member.", policyArnsCount, "");
policyArnsCount++;
}
}
if(m_policyHasBeenSet)
{
ss << "Policy=" << StringUtils::URLEncode(m_policy.c_str()) << "&";
}
if(m_durationSecondsHasBeenSet)
{
ss << "DurationSeconds=" << m_durationSeconds << "&";
}
ss << "Version=2011-06-15";
return ss.str();
}
void AssumeRoleWithWebIdentityRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
{
uri.SetQueryString(SerializePayload());
}

View File

@@ -0,0 +1,81 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/AssumeRoleWithWebIdentityResult.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::STS::Model;
using namespace Aws::Utils::Xml;
using namespace Aws::Utils::Logging;
using namespace Aws::Utils;
using namespace Aws;
AssumeRoleWithWebIdentityResult::AssumeRoleWithWebIdentityResult() :
m_packedPolicySize(0)
{
}
AssumeRoleWithWebIdentityResult::AssumeRoleWithWebIdentityResult(const Aws::AmazonWebServiceResult<XmlDocument>& result) :
m_packedPolicySize(0)
{
*this = result;
}
AssumeRoleWithWebIdentityResult& AssumeRoleWithWebIdentityResult::operator =(const Aws::AmazonWebServiceResult<XmlDocument>& result)
{
const XmlDocument& xmlDocument = result.GetPayload();
XmlNode rootNode = xmlDocument.GetRootElement();
XmlNode resultNode = rootNode;
if (!rootNode.IsNull() && (rootNode.GetName() != "AssumeRoleWithWebIdentityResult"))
{
resultNode = rootNode.FirstChild("AssumeRoleWithWebIdentityResult");
}
if(!resultNode.IsNull())
{
XmlNode credentialsNode = resultNode.FirstChild("Credentials");
if(!credentialsNode.IsNull())
{
m_credentials = credentialsNode;
}
XmlNode subjectFromWebIdentityTokenNode = resultNode.FirstChild("SubjectFromWebIdentityToken");
if(!subjectFromWebIdentityTokenNode.IsNull())
{
m_subjectFromWebIdentityToken = Aws::Utils::Xml::DecodeEscapedXmlText(subjectFromWebIdentityTokenNode.GetText());
}
XmlNode assumedRoleUserNode = resultNode.FirstChild("AssumedRoleUser");
if(!assumedRoleUserNode.IsNull())
{
m_assumedRoleUser = assumedRoleUserNode;
}
XmlNode packedPolicySizeNode = resultNode.FirstChild("PackedPolicySize");
if(!packedPolicySizeNode.IsNull())
{
m_packedPolicySize = StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(packedPolicySizeNode.GetText()).c_str()).c_str());
}
XmlNode providerNode = resultNode.FirstChild("Provider");
if(!providerNode.IsNull())
{
m_provider = Aws::Utils::Xml::DecodeEscapedXmlText(providerNode.GetText());
}
XmlNode audienceNode = resultNode.FirstChild("Audience");
if(!audienceNode.IsNull())
{
m_audience = Aws::Utils::Xml::DecodeEscapedXmlText(audienceNode.GetText());
}
}
if (!rootNode.IsNull()) {
XmlNode responseMetadataNode = rootNode.FirstChild("ResponseMetadata");
m_responseMetadata = responseMetadataNode;
AWS_LOGSTREAM_DEBUG("Aws::STS::Model::AssumeRoleWithWebIdentityResult", "x-amzn-request-id: " << m_responseMetadata.GetRequestId() );
}
return *this;
}

View File

@@ -0,0 +1,87 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/AssumedRoleUser.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 STS
{
namespace Model
{
AssumedRoleUser::AssumedRoleUser() :
m_assumedRoleIdHasBeenSet(false),
m_arnHasBeenSet(false)
{
}
AssumedRoleUser::AssumedRoleUser(const XmlNode& xmlNode) :
m_assumedRoleIdHasBeenSet(false),
m_arnHasBeenSet(false)
{
*this = xmlNode;
}
AssumedRoleUser& AssumedRoleUser::operator =(const XmlNode& xmlNode)
{
XmlNode resultNode = xmlNode;
if(!resultNode.IsNull())
{
XmlNode assumedRoleIdNode = resultNode.FirstChild("AssumedRoleId");
if(!assumedRoleIdNode.IsNull())
{
m_assumedRoleId = Aws::Utils::Xml::DecodeEscapedXmlText(assumedRoleIdNode.GetText());
m_assumedRoleIdHasBeenSet = true;
}
XmlNode arnNode = resultNode.FirstChild("Arn");
if(!arnNode.IsNull())
{
m_arn = Aws::Utils::Xml::DecodeEscapedXmlText(arnNode.GetText());
m_arnHasBeenSet = true;
}
}
return *this;
}
void AssumedRoleUser::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
{
if(m_assumedRoleIdHasBeenSet)
{
oStream << location << index << locationValue << ".AssumedRoleId=" << StringUtils::URLEncode(m_assumedRoleId.c_str()) << "&";
}
if(m_arnHasBeenSet)
{
oStream << location << index << locationValue << ".Arn=" << StringUtils::URLEncode(m_arn.c_str()) << "&";
}
}
void AssumedRoleUser::OutputToStream(Aws::OStream& oStream, const char* location) const
{
if(m_assumedRoleIdHasBeenSet)
{
oStream << location << ".AssumedRoleId=" << StringUtils::URLEncode(m_assumedRoleId.c_str()) << "&";
}
if(m_arnHasBeenSet)
{
oStream << location << ".Arn=" << StringUtils::URLEncode(m_arn.c_str()) << "&";
}
}
} // namespace Model
} // namespace STS
} // namespace Aws

View File

@@ -0,0 +1,121 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/Credentials.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 STS
{
namespace Model
{
Credentials::Credentials() :
m_accessKeyIdHasBeenSet(false),
m_secretAccessKeyHasBeenSet(false),
m_sessionTokenHasBeenSet(false),
m_expirationHasBeenSet(false)
{
}
Credentials::Credentials(const XmlNode& xmlNode) :
m_accessKeyIdHasBeenSet(false),
m_secretAccessKeyHasBeenSet(false),
m_sessionTokenHasBeenSet(false),
m_expirationHasBeenSet(false)
{
*this = xmlNode;
}
Credentials& Credentials::operator =(const XmlNode& xmlNode)
{
XmlNode resultNode = xmlNode;
if(!resultNode.IsNull())
{
XmlNode accessKeyIdNode = resultNode.FirstChild("AccessKeyId");
if(!accessKeyIdNode.IsNull())
{
m_accessKeyId = Aws::Utils::Xml::DecodeEscapedXmlText(accessKeyIdNode.GetText());
m_accessKeyIdHasBeenSet = true;
}
XmlNode secretAccessKeyNode = resultNode.FirstChild("SecretAccessKey");
if(!secretAccessKeyNode.IsNull())
{
m_secretAccessKey = Aws::Utils::Xml::DecodeEscapedXmlText(secretAccessKeyNode.GetText());
m_secretAccessKeyHasBeenSet = true;
}
XmlNode sessionTokenNode = resultNode.FirstChild("SessionToken");
if(!sessionTokenNode.IsNull())
{
m_sessionToken = Aws::Utils::Xml::DecodeEscapedXmlText(sessionTokenNode.GetText());
m_sessionTokenHasBeenSet = true;
}
XmlNode expirationNode = resultNode.FirstChild("Expiration");
if(!expirationNode.IsNull())
{
m_expiration = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(expirationNode.GetText()).c_str()).c_str(), DateFormat::ISO_8601);
m_expirationHasBeenSet = true;
}
}
return *this;
}
void Credentials::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
{
if(m_accessKeyIdHasBeenSet)
{
oStream << location << index << locationValue << ".AccessKeyId=" << StringUtils::URLEncode(m_accessKeyId.c_str()) << "&";
}
if(m_secretAccessKeyHasBeenSet)
{
oStream << location << index << locationValue << ".SecretAccessKey=" << StringUtils::URLEncode(m_secretAccessKey.c_str()) << "&";
}
if(m_sessionTokenHasBeenSet)
{
oStream << location << index << locationValue << ".SessionToken=" << StringUtils::URLEncode(m_sessionToken.c_str()) << "&";
}
if(m_expirationHasBeenSet)
{
oStream << location << index << locationValue << ".Expiration=" << StringUtils::URLEncode(m_expiration.ToGmtString(DateFormat::ISO_8601).c_str()) << "&";
}
}
void Credentials::OutputToStream(Aws::OStream& oStream, const char* location) const
{
if(m_accessKeyIdHasBeenSet)
{
oStream << location << ".AccessKeyId=" << StringUtils::URLEncode(m_accessKeyId.c_str()) << "&";
}
if(m_secretAccessKeyHasBeenSet)
{
oStream << location << ".SecretAccessKey=" << StringUtils::URLEncode(m_secretAccessKey.c_str()) << "&";
}
if(m_sessionTokenHasBeenSet)
{
oStream << location << ".SessionToken=" << StringUtils::URLEncode(m_sessionToken.c_str()) << "&";
}
if(m_expirationHasBeenSet)
{
oStream << location << ".Expiration=" << StringUtils::URLEncode(m_expiration.ToGmtString(DateFormat::ISO_8601).c_str()) << "&";
}
}
} // namespace Model
} // namespace STS
} // namespace Aws

View File

@@ -0,0 +1,35 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/DecodeAuthorizationMessageRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
using namespace Aws::STS::Model;
using namespace Aws::Utils;
DecodeAuthorizationMessageRequest::DecodeAuthorizationMessageRequest() :
m_encodedMessageHasBeenSet(false)
{
}
Aws::String DecodeAuthorizationMessageRequest::SerializePayload() const
{
Aws::StringStream ss;
ss << "Action=DecodeAuthorizationMessage&";
if(m_encodedMessageHasBeenSet)
{
ss << "EncodedMessage=" << StringUtils::URLEncode(m_encodedMessage.c_str()) << "&";
}
ss << "Version=2011-06-15";
return ss.str();
}
void DecodeAuthorizationMessageRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
{
uri.SetQueryString(SerializePayload());
}

View File

@@ -0,0 +1,54 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/DecodeAuthorizationMessageResult.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::STS::Model;
using namespace Aws::Utils::Xml;
using namespace Aws::Utils::Logging;
using namespace Aws::Utils;
using namespace Aws;
DecodeAuthorizationMessageResult::DecodeAuthorizationMessageResult()
{
}
DecodeAuthorizationMessageResult::DecodeAuthorizationMessageResult(const Aws::AmazonWebServiceResult<XmlDocument>& result)
{
*this = result;
}
DecodeAuthorizationMessageResult& DecodeAuthorizationMessageResult::operator =(const Aws::AmazonWebServiceResult<XmlDocument>& result)
{
const XmlDocument& xmlDocument = result.GetPayload();
XmlNode rootNode = xmlDocument.GetRootElement();
XmlNode resultNode = rootNode;
if (!rootNode.IsNull() && (rootNode.GetName() != "DecodeAuthorizationMessageResult"))
{
resultNode = rootNode.FirstChild("DecodeAuthorizationMessageResult");
}
if(!resultNode.IsNull())
{
XmlNode decodedMessageNode = resultNode.FirstChild("DecodedMessage");
if(!decodedMessageNode.IsNull())
{
m_decodedMessage = Aws::Utils::Xml::DecodeEscapedXmlText(decodedMessageNode.GetText());
}
}
if (!rootNode.IsNull()) {
XmlNode responseMetadataNode = rootNode.FirstChild("ResponseMetadata");
m_responseMetadata = responseMetadataNode;
AWS_LOGSTREAM_DEBUG("Aws::STS::Model::DecodeAuthorizationMessageResult", "x-amzn-request-id: " << m_responseMetadata.GetRequestId() );
}
return *this;
}

View File

@@ -0,0 +1,87 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/FederatedUser.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 STS
{
namespace Model
{
FederatedUser::FederatedUser() :
m_federatedUserIdHasBeenSet(false),
m_arnHasBeenSet(false)
{
}
FederatedUser::FederatedUser(const XmlNode& xmlNode) :
m_federatedUserIdHasBeenSet(false),
m_arnHasBeenSet(false)
{
*this = xmlNode;
}
FederatedUser& FederatedUser::operator =(const XmlNode& xmlNode)
{
XmlNode resultNode = xmlNode;
if(!resultNode.IsNull())
{
XmlNode federatedUserIdNode = resultNode.FirstChild("FederatedUserId");
if(!federatedUserIdNode.IsNull())
{
m_federatedUserId = Aws::Utils::Xml::DecodeEscapedXmlText(federatedUserIdNode.GetText());
m_federatedUserIdHasBeenSet = true;
}
XmlNode arnNode = resultNode.FirstChild("Arn");
if(!arnNode.IsNull())
{
m_arn = Aws::Utils::Xml::DecodeEscapedXmlText(arnNode.GetText());
m_arnHasBeenSet = true;
}
}
return *this;
}
void FederatedUser::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
{
if(m_federatedUserIdHasBeenSet)
{
oStream << location << index << locationValue << ".FederatedUserId=" << StringUtils::URLEncode(m_federatedUserId.c_str()) << "&";
}
if(m_arnHasBeenSet)
{
oStream << location << index << locationValue << ".Arn=" << StringUtils::URLEncode(m_arn.c_str()) << "&";
}
}
void FederatedUser::OutputToStream(Aws::OStream& oStream, const char* location) const
{
if(m_federatedUserIdHasBeenSet)
{
oStream << location << ".FederatedUserId=" << StringUtils::URLEncode(m_federatedUserId.c_str()) << "&";
}
if(m_arnHasBeenSet)
{
oStream << location << ".Arn=" << StringUtils::URLEncode(m_arn.c_str()) << "&";
}
}
} // namespace Model
} // namespace STS
} // namespace Aws

View File

@@ -0,0 +1,35 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/GetAccessKeyInfoRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
using namespace Aws::STS::Model;
using namespace Aws::Utils;
GetAccessKeyInfoRequest::GetAccessKeyInfoRequest() :
m_accessKeyIdHasBeenSet(false)
{
}
Aws::String GetAccessKeyInfoRequest::SerializePayload() const
{
Aws::StringStream ss;
ss << "Action=GetAccessKeyInfo&";
if(m_accessKeyIdHasBeenSet)
{
ss << "AccessKeyId=" << StringUtils::URLEncode(m_accessKeyId.c_str()) << "&";
}
ss << "Version=2011-06-15";
return ss.str();
}
void GetAccessKeyInfoRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
{
uri.SetQueryString(SerializePayload());
}

View File

@@ -0,0 +1,54 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/GetAccessKeyInfoResult.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::STS::Model;
using namespace Aws::Utils::Xml;
using namespace Aws::Utils::Logging;
using namespace Aws::Utils;
using namespace Aws;
GetAccessKeyInfoResult::GetAccessKeyInfoResult()
{
}
GetAccessKeyInfoResult::GetAccessKeyInfoResult(const Aws::AmazonWebServiceResult<XmlDocument>& result)
{
*this = result;
}
GetAccessKeyInfoResult& GetAccessKeyInfoResult::operator =(const Aws::AmazonWebServiceResult<XmlDocument>& result)
{
const XmlDocument& xmlDocument = result.GetPayload();
XmlNode rootNode = xmlDocument.GetRootElement();
XmlNode resultNode = rootNode;
if (!rootNode.IsNull() && (rootNode.GetName() != "GetAccessKeyInfoResult"))
{
resultNode = rootNode.FirstChild("GetAccessKeyInfoResult");
}
if(!resultNode.IsNull())
{
XmlNode accountNode = resultNode.FirstChild("Account");
if(!accountNode.IsNull())
{
m_account = Aws::Utils::Xml::DecodeEscapedXmlText(accountNode.GetText());
}
}
if (!rootNode.IsNull()) {
XmlNode responseMetadataNode = rootNode.FirstChild("ResponseMetadata");
m_responseMetadata = responseMetadataNode;
AWS_LOGSTREAM_DEBUG("Aws::STS::Model::GetAccessKeyInfoResult", "x-amzn-request-id: " << m_responseMetadata.GetRequestId() );
}
return *this;
}

View File

@@ -0,0 +1,29 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/GetCallerIdentityRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
using namespace Aws::STS::Model;
using namespace Aws::Utils;
GetCallerIdentityRequest::GetCallerIdentityRequest()
{
}
Aws::String GetCallerIdentityRequest::SerializePayload() const
{
Aws::StringStream ss;
ss << "Action=GetCallerIdentity&";
ss << "Version=2011-06-15";
return ss.str();
}
void GetCallerIdentityRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
{
uri.SetQueryString(SerializePayload());
}

View File

@@ -0,0 +1,64 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/GetCallerIdentityResult.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::STS::Model;
using namespace Aws::Utils::Xml;
using namespace Aws::Utils::Logging;
using namespace Aws::Utils;
using namespace Aws;
GetCallerIdentityResult::GetCallerIdentityResult()
{
}
GetCallerIdentityResult::GetCallerIdentityResult(const Aws::AmazonWebServiceResult<XmlDocument>& result)
{
*this = result;
}
GetCallerIdentityResult& GetCallerIdentityResult::operator =(const Aws::AmazonWebServiceResult<XmlDocument>& result)
{
const XmlDocument& xmlDocument = result.GetPayload();
XmlNode rootNode = xmlDocument.GetRootElement();
XmlNode resultNode = rootNode;
if (!rootNode.IsNull() && (rootNode.GetName() != "GetCallerIdentityResult"))
{
resultNode = rootNode.FirstChild("GetCallerIdentityResult");
}
if(!resultNode.IsNull())
{
XmlNode userIdNode = resultNode.FirstChild("UserId");
if(!userIdNode.IsNull())
{
m_userId = Aws::Utils::Xml::DecodeEscapedXmlText(userIdNode.GetText());
}
XmlNode accountNode = resultNode.FirstChild("Account");
if(!accountNode.IsNull())
{
m_account = Aws::Utils::Xml::DecodeEscapedXmlText(accountNode.GetText());
}
XmlNode arnNode = resultNode.FirstChild("Arn");
if(!arnNode.IsNull())
{
m_arn = Aws::Utils::Xml::DecodeEscapedXmlText(arnNode.GetText());
}
}
if (!rootNode.IsNull()) {
XmlNode responseMetadataNode = rootNode.FirstChild("ResponseMetadata");
m_responseMetadata = responseMetadataNode;
AWS_LOGSTREAM_DEBUG("Aws::STS::Model::GetCallerIdentityResult", "x-amzn-request-id: " << m_responseMetadata.GetRequestId() );
}
return *this;
}

View File

@@ -0,0 +1,70 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/GetFederationTokenRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
using namespace Aws::STS::Model;
using namespace Aws::Utils;
GetFederationTokenRequest::GetFederationTokenRequest() :
m_nameHasBeenSet(false),
m_policyHasBeenSet(false),
m_policyArnsHasBeenSet(false),
m_durationSeconds(0),
m_durationSecondsHasBeenSet(false),
m_tagsHasBeenSet(false)
{
}
Aws::String GetFederationTokenRequest::SerializePayload() const
{
Aws::StringStream ss;
ss << "Action=GetFederationToken&";
if(m_nameHasBeenSet)
{
ss << "Name=" << StringUtils::URLEncode(m_name.c_str()) << "&";
}
if(m_policyHasBeenSet)
{
ss << "Policy=" << StringUtils::URLEncode(m_policy.c_str()) << "&";
}
if(m_policyArnsHasBeenSet)
{
unsigned policyArnsCount = 1;
for(auto& item : m_policyArns)
{
item.OutputToStream(ss, "PolicyArns.member.", policyArnsCount, "");
policyArnsCount++;
}
}
if(m_durationSecondsHasBeenSet)
{
ss << "DurationSeconds=" << m_durationSeconds << "&";
}
if(m_tagsHasBeenSet)
{
unsigned tagsCount = 1;
for(auto& item : m_tags)
{
item.OutputToStream(ss, "Tags.member.", tagsCount, "");
tagsCount++;
}
}
ss << "Version=2011-06-15";
return ss.str();
}
void GetFederationTokenRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
{
uri.SetQueryString(SerializePayload());
}

View File

@@ -0,0 +1,66 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/GetFederationTokenResult.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::STS::Model;
using namespace Aws::Utils::Xml;
using namespace Aws::Utils::Logging;
using namespace Aws::Utils;
using namespace Aws;
GetFederationTokenResult::GetFederationTokenResult() :
m_packedPolicySize(0)
{
}
GetFederationTokenResult::GetFederationTokenResult(const Aws::AmazonWebServiceResult<XmlDocument>& result) :
m_packedPolicySize(0)
{
*this = result;
}
GetFederationTokenResult& GetFederationTokenResult::operator =(const Aws::AmazonWebServiceResult<XmlDocument>& result)
{
const XmlDocument& xmlDocument = result.GetPayload();
XmlNode rootNode = xmlDocument.GetRootElement();
XmlNode resultNode = rootNode;
if (!rootNode.IsNull() && (rootNode.GetName() != "GetFederationTokenResult"))
{
resultNode = rootNode.FirstChild("GetFederationTokenResult");
}
if(!resultNode.IsNull())
{
XmlNode credentialsNode = resultNode.FirstChild("Credentials");
if(!credentialsNode.IsNull())
{
m_credentials = credentialsNode;
}
XmlNode federatedUserNode = resultNode.FirstChild("FederatedUser");
if(!federatedUserNode.IsNull())
{
m_federatedUser = federatedUserNode;
}
XmlNode packedPolicySizeNode = resultNode.FirstChild("PackedPolicySize");
if(!packedPolicySizeNode.IsNull())
{
m_packedPolicySize = StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(packedPolicySizeNode.GetText()).c_str()).c_str());
}
}
if (!rootNode.IsNull()) {
XmlNode responseMetadataNode = rootNode.FirstChild("ResponseMetadata");
m_responseMetadata = responseMetadataNode;
AWS_LOGSTREAM_DEBUG("Aws::STS::Model::GetFederationTokenResult", "x-amzn-request-id: " << m_responseMetadata.GetRequestId() );
}
return *this;
}

View File

@@ -0,0 +1,48 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/GetSessionTokenRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
using namespace Aws::STS::Model;
using namespace Aws::Utils;
GetSessionTokenRequest::GetSessionTokenRequest() :
m_durationSeconds(0),
m_durationSecondsHasBeenSet(false),
m_serialNumberHasBeenSet(false),
m_tokenCodeHasBeenSet(false)
{
}
Aws::String GetSessionTokenRequest::SerializePayload() const
{
Aws::StringStream ss;
ss << "Action=GetSessionToken&";
if(m_durationSecondsHasBeenSet)
{
ss << "DurationSeconds=" << m_durationSeconds << "&";
}
if(m_serialNumberHasBeenSet)
{
ss << "SerialNumber=" << StringUtils::URLEncode(m_serialNumber.c_str()) << "&";
}
if(m_tokenCodeHasBeenSet)
{
ss << "TokenCode=" << StringUtils::URLEncode(m_tokenCode.c_str()) << "&";
}
ss << "Version=2011-06-15";
return ss.str();
}
void GetSessionTokenRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
{
uri.SetQueryString(SerializePayload());
}

View File

@@ -0,0 +1,54 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/GetSessionTokenResult.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::STS::Model;
using namespace Aws::Utils::Xml;
using namespace Aws::Utils::Logging;
using namespace Aws::Utils;
using namespace Aws;
GetSessionTokenResult::GetSessionTokenResult()
{
}
GetSessionTokenResult::GetSessionTokenResult(const Aws::AmazonWebServiceResult<XmlDocument>& result)
{
*this = result;
}
GetSessionTokenResult& GetSessionTokenResult::operator =(const Aws::AmazonWebServiceResult<XmlDocument>& result)
{
const XmlDocument& xmlDocument = result.GetPayload();
XmlNode rootNode = xmlDocument.GetRootElement();
XmlNode resultNode = rootNode;
if (!rootNode.IsNull() && (rootNode.GetName() != "GetSessionTokenResult"))
{
resultNode = rootNode.FirstChild("GetSessionTokenResult");
}
if(!resultNode.IsNull())
{
XmlNode credentialsNode = resultNode.FirstChild("Credentials");
if(!credentialsNode.IsNull())
{
m_credentials = credentialsNode;
}
}
if (!rootNode.IsNull()) {
XmlNode responseMetadataNode = rootNode.FirstChild("ResponseMetadata");
m_responseMetadata = responseMetadataNode;
AWS_LOGSTREAM_DEBUG("Aws::STS::Model::GetSessionTokenResult", "x-amzn-request-id: " << m_responseMetadata.GetRequestId() );
}
return *this;
}

View File

@@ -0,0 +1,70 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/PolicyDescriptorType.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 STS
{
namespace Model
{
PolicyDescriptorType::PolicyDescriptorType() :
m_arnHasBeenSet(false)
{
}
PolicyDescriptorType::PolicyDescriptorType(const XmlNode& xmlNode) :
m_arnHasBeenSet(false)
{
*this = xmlNode;
}
PolicyDescriptorType& PolicyDescriptorType::operator =(const XmlNode& xmlNode)
{
XmlNode resultNode = xmlNode;
if(!resultNode.IsNull())
{
XmlNode arnNode = resultNode.FirstChild("arn");
if(!arnNode.IsNull())
{
m_arn = Aws::Utils::Xml::DecodeEscapedXmlText(arnNode.GetText());
m_arnHasBeenSet = true;
}
}
return *this;
}
void PolicyDescriptorType::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
{
if(m_arnHasBeenSet)
{
oStream << location << index << locationValue << ".arn=" << StringUtils::URLEncode(m_arn.c_str()) << "&";
}
}
void PolicyDescriptorType::OutputToStream(Aws::OStream& oStream, const char* location) const
{
if(m_arnHasBeenSet)
{
oStream << location << ".arn=" << StringUtils::URLEncode(m_arn.c_str()) << "&";
}
}
} // namespace Model
} // namespace STS
} // namespace Aws

View File

@@ -0,0 +1,70 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/ResponseMetadata.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 STS
{
namespace Model
{
ResponseMetadata::ResponseMetadata() :
m_requestIdHasBeenSet(false)
{
}
ResponseMetadata::ResponseMetadata(const XmlNode& xmlNode) :
m_requestIdHasBeenSet(false)
{
*this = xmlNode;
}
ResponseMetadata& ResponseMetadata::operator =(const XmlNode& xmlNode)
{
XmlNode resultNode = xmlNode;
if(!resultNode.IsNull())
{
XmlNode requestIdNode = resultNode.FirstChild("RequestId");
if(!requestIdNode.IsNull())
{
m_requestId = Aws::Utils::Xml::DecodeEscapedXmlText(requestIdNode.GetText());
m_requestIdHasBeenSet = true;
}
}
return *this;
}
void ResponseMetadata::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
{
if(m_requestIdHasBeenSet)
{
oStream << location << index << locationValue << ".RequestId=" << StringUtils::URLEncode(m_requestId.c_str()) << "&";
}
}
void ResponseMetadata::OutputToStream(Aws::OStream& oStream, const char* location) const
{
if(m_requestIdHasBeenSet)
{
oStream << location << ".RequestId=" << StringUtils::URLEncode(m_requestId.c_str()) << "&";
}
}
} // namespace Model
} // namespace STS
} // namespace Aws

View File

@@ -0,0 +1,87 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sts/model/Tag.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 STS
{
namespace Model
{
Tag::Tag() :
m_keyHasBeenSet(false),
m_valueHasBeenSet(false)
{
}
Tag::Tag(const XmlNode& xmlNode) :
m_keyHasBeenSet(false),
m_valueHasBeenSet(false)
{
*this = xmlNode;
}
Tag& Tag::operator =(const XmlNode& xmlNode)
{
XmlNode resultNode = xmlNode;
if(!resultNode.IsNull())
{
XmlNode keyNode = resultNode.FirstChild("Key");
if(!keyNode.IsNull())
{
m_key = Aws::Utils::Xml::DecodeEscapedXmlText(keyNode.GetText());
m_keyHasBeenSet = true;
}
XmlNode valueNode = resultNode.FirstChild("Value");
if(!valueNode.IsNull())
{
m_value = Aws::Utils::Xml::DecodeEscapedXmlText(valueNode.GetText());
m_valueHasBeenSet = true;
}
}
return *this;
}
void Tag::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
{
if(m_keyHasBeenSet)
{
oStream << location << index << locationValue << ".Key=" << StringUtils::URLEncode(m_key.c_str()) << "&";
}
if(m_valueHasBeenSet)
{
oStream << location << index << locationValue << ".Value=" << StringUtils::URLEncode(m_value.c_str()) << "&";
}
}
void Tag::OutputToStream(Aws::OStream& oStream, const char* location) const
{
if(m_keyHasBeenSet)
{
oStream << location << ".Key=" << StringUtils::URLEncode(m_key.c_str()) << "&";
}
if(m_valueHasBeenSet)
{
oStream << location << ".Value=" << StringUtils::URLEncode(m_value.c_str()) << "&";
}
}
} // namespace Model
} // namespace STS
} // namespace Aws