Generate SDK by new Generator
This commit is contained in:
@@ -21,25 +21,25 @@ set(sts_public_header
|
||||
include/alibabacloud/sts/StsExport.h )
|
||||
|
||||
set(sts_public_header_model
|
||||
include/alibabacloud/sts/model/GetCallerIdentityRequest.h
|
||||
include/alibabacloud/sts/model/GetCallerIdentityResult.h
|
||||
include/alibabacloud/sts/model/GenerateSessionAccessKeyRequest.h
|
||||
include/alibabacloud/sts/model/GenerateSessionAccessKeyResult.h
|
||||
include/alibabacloud/sts/model/AssumeRoleRequest.h
|
||||
include/alibabacloud/sts/model/AssumeRoleResult.h
|
||||
include/alibabacloud/sts/model/AssumeRoleWithSAMLRequest.h
|
||||
include/alibabacloud/sts/model/AssumeRoleWithSAMLResult.h )
|
||||
include/alibabacloud/sts/model/AssumeRoleWithSAMLResult.h
|
||||
include/alibabacloud/sts/model/GenerateSessionAccessKeyRequest.h
|
||||
include/alibabacloud/sts/model/GenerateSessionAccessKeyResult.h
|
||||
include/alibabacloud/sts/model/GetCallerIdentityRequest.h
|
||||
include/alibabacloud/sts/model/GetCallerIdentityResult.h )
|
||||
|
||||
set(sts_src
|
||||
src/StsClient.cc
|
||||
src/model/GetCallerIdentityRequest.cc
|
||||
src/model/GetCallerIdentityResult.cc
|
||||
src/model/GenerateSessionAccessKeyRequest.cc
|
||||
src/model/GenerateSessionAccessKeyResult.cc
|
||||
src/model/AssumeRoleRequest.cc
|
||||
src/model/AssumeRoleResult.cc
|
||||
src/model/AssumeRoleWithSAMLRequest.cc
|
||||
src/model/AssumeRoleWithSAMLResult.cc )
|
||||
src/model/AssumeRoleWithSAMLResult.cc
|
||||
src/model/GenerateSessionAccessKeyRequest.cc
|
||||
src/model/GenerateSessionAccessKeyResult.cc
|
||||
src/model/GetCallerIdentityRequest.cc
|
||||
src/model/GetCallerIdentityResult.cc )
|
||||
|
||||
add_library(sts ${LIB_TYPE}
|
||||
${sts_public_header}
|
||||
|
||||
@@ -22,14 +22,14 @@
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <alibabacloud/core/RpcServiceClient.h>
|
||||
#include "StsExport.h"
|
||||
#include "model/GetCallerIdentityRequest.h"
|
||||
#include "model/GetCallerIdentityResult.h"
|
||||
#include "model/GenerateSessionAccessKeyRequest.h"
|
||||
#include "model/GenerateSessionAccessKeyResult.h"
|
||||
#include "model/AssumeRoleRequest.h"
|
||||
#include "model/AssumeRoleResult.h"
|
||||
#include "model/AssumeRoleWithSAMLRequest.h"
|
||||
#include "model/AssumeRoleWithSAMLResult.h"
|
||||
#include "model/GenerateSessionAccessKeyRequest.h"
|
||||
#include "model/GenerateSessionAccessKeyResult.h"
|
||||
#include "model/GetCallerIdentityRequest.h"
|
||||
#include "model/GetCallerIdentityResult.h"
|
||||
|
||||
|
||||
namespace AlibabaCloud
|
||||
@@ -39,35 +39,35 @@ namespace AlibabaCloud
|
||||
class ALIBABACLOUD_STS_EXPORT StsClient : public RpcServiceClient
|
||||
{
|
||||
public:
|
||||
typedef Outcome<Error, Model::GetCallerIdentityResult> GetCallerIdentityOutcome;
|
||||
typedef std::future<GetCallerIdentityOutcome> GetCallerIdentityOutcomeCallable;
|
||||
typedef std::function<void(const StsClient*, const Model::GetCallerIdentityRequest&, const GetCallerIdentityOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetCallerIdentityAsyncHandler;
|
||||
typedef Outcome<Error, Model::GenerateSessionAccessKeyResult> GenerateSessionAccessKeyOutcome;
|
||||
typedef std::future<GenerateSessionAccessKeyOutcome> GenerateSessionAccessKeyOutcomeCallable;
|
||||
typedef std::function<void(const StsClient*, const Model::GenerateSessionAccessKeyRequest&, const GenerateSessionAccessKeyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GenerateSessionAccessKeyAsyncHandler;
|
||||
typedef Outcome<Error, Model::AssumeRoleResult> AssumeRoleOutcome;
|
||||
typedef std::future<AssumeRoleOutcome> AssumeRoleOutcomeCallable;
|
||||
typedef std::function<void(const StsClient*, const Model::AssumeRoleRequest&, const AssumeRoleOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> AssumeRoleAsyncHandler;
|
||||
typedef Outcome<Error, Model::AssumeRoleWithSAMLResult> AssumeRoleWithSAMLOutcome;
|
||||
typedef std::future<AssumeRoleWithSAMLOutcome> AssumeRoleWithSAMLOutcomeCallable;
|
||||
typedef std::function<void(const StsClient*, const Model::AssumeRoleWithSAMLRequest&, const AssumeRoleWithSAMLOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> AssumeRoleWithSAMLAsyncHandler;
|
||||
typedef Outcome<Error, Model::GenerateSessionAccessKeyResult> GenerateSessionAccessKeyOutcome;
|
||||
typedef std::future<GenerateSessionAccessKeyOutcome> GenerateSessionAccessKeyOutcomeCallable;
|
||||
typedef std::function<void(const StsClient*, const Model::GenerateSessionAccessKeyRequest&, const GenerateSessionAccessKeyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GenerateSessionAccessKeyAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetCallerIdentityResult> GetCallerIdentityOutcome;
|
||||
typedef std::future<GetCallerIdentityOutcome> GetCallerIdentityOutcomeCallable;
|
||||
typedef std::function<void(const StsClient*, const Model::GetCallerIdentityRequest&, const GetCallerIdentityOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetCallerIdentityAsyncHandler;
|
||||
|
||||
StsClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||
StsClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
StsClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||
~StsClient();
|
||||
GetCallerIdentityOutcome getCallerIdentity(const Model::GetCallerIdentityRequest &request)const;
|
||||
void getCallerIdentityAsync(const Model::GetCallerIdentityRequest& request, const GetCallerIdentityAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetCallerIdentityOutcomeCallable getCallerIdentityCallable(const Model::GetCallerIdentityRequest& request) const;
|
||||
GenerateSessionAccessKeyOutcome generateSessionAccessKey(const Model::GenerateSessionAccessKeyRequest &request)const;
|
||||
void generateSessionAccessKeyAsync(const Model::GenerateSessionAccessKeyRequest& request, const GenerateSessionAccessKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GenerateSessionAccessKeyOutcomeCallable generateSessionAccessKeyCallable(const Model::GenerateSessionAccessKeyRequest& request) const;
|
||||
AssumeRoleOutcome assumeRole(const Model::AssumeRoleRequest &request)const;
|
||||
void assumeRoleAsync(const Model::AssumeRoleRequest& request, const AssumeRoleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
AssumeRoleOutcomeCallable assumeRoleCallable(const Model::AssumeRoleRequest& request) const;
|
||||
AssumeRoleWithSAMLOutcome assumeRoleWithSAML(const Model::AssumeRoleWithSAMLRequest &request)const;
|
||||
void assumeRoleWithSAMLAsync(const Model::AssumeRoleWithSAMLRequest& request, const AssumeRoleWithSAMLAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
AssumeRoleWithSAMLOutcomeCallable assumeRoleWithSAMLCallable(const Model::AssumeRoleWithSAMLRequest& request) const;
|
||||
GenerateSessionAccessKeyOutcome generateSessionAccessKey(const Model::GenerateSessionAccessKeyRequest &request)const;
|
||||
void generateSessionAccessKeyAsync(const Model::GenerateSessionAccessKeyRequest& request, const GenerateSessionAccessKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GenerateSessionAccessKeyOutcomeCallable generateSessionAccessKeyCallable(const Model::GenerateSessionAccessKeyRequest& request) const;
|
||||
GetCallerIdentityOutcome getCallerIdentity(const Model::GetCallerIdentityRequest &request)const;
|
||||
void getCallerIdentityAsync(const Model::GetCallerIdentityRequest& request, const GetCallerIdentityAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetCallerIdentityOutcomeCallable getCallerIdentityCallable(const Model::GetCallerIdentityRequest& request) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||
|
||||
@@ -35,20 +35,20 @@ namespace AlibabaCloud
|
||||
AssumeRoleRequest();
|
||||
~AssumeRoleRequest();
|
||||
|
||||
std::string getRoleArn()const;
|
||||
void setRoleArn(const std::string& roleArn);
|
||||
std::string getRoleSessionName()const;
|
||||
void setRoleSessionName(const std::string& roleSessionName);
|
||||
long getDurationSeconds()const;
|
||||
void setDurationSeconds(long durationSeconds);
|
||||
std::string getPolicy()const;
|
||||
void setPolicy(const std::string& policy);
|
||||
std::string getRoleArn()const;
|
||||
void setRoleArn(const std::string& roleArn);
|
||||
long getDurationSeconds()const;
|
||||
void setDurationSeconds(long durationSeconds);
|
||||
|
||||
private:
|
||||
std::string roleArn_;
|
||||
std::string roleSessionName_;
|
||||
long durationSeconds_;
|
||||
std::string policy_;
|
||||
std::string roleArn_;
|
||||
long durationSeconds_;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -35,21 +35,21 @@ namespace AlibabaCloud
|
||||
AssumeRoleWithSAMLRequest();
|
||||
~AssumeRoleWithSAMLRequest();
|
||||
|
||||
std::string getSAMLAssertion()const;
|
||||
void setSAMLAssertion(const std::string& sAMLAssertion);
|
||||
std::string getRoleArn()const;
|
||||
void setRoleArn(const std::string& roleArn);
|
||||
std::string getSAMLProviderArn()const;
|
||||
void setSAMLProviderArn(const std::string& sAMLProviderArn);
|
||||
std::string getSAMLAssertion()const;
|
||||
void setSAMLAssertion(const std::string& sAMLAssertion);
|
||||
long getDurationSeconds()const;
|
||||
void setDurationSeconds(long durationSeconds);
|
||||
std::string getPolicy()const;
|
||||
void setPolicy(const std::string& policy);
|
||||
|
||||
private:
|
||||
std::string sAMLAssertion_;
|
||||
std::string roleArn_;
|
||||
std::string sAMLProviderArn_;
|
||||
std::string sAMLAssertion_;
|
||||
long durationSeconds_;
|
||||
std::string policy_;
|
||||
|
||||
|
||||
@@ -51,78 +51,6 @@ StsClient::StsClient(const std::string & accessKeyId, const std::string & access
|
||||
StsClient::~StsClient()
|
||||
{}
|
||||
|
||||
StsClient::GetCallerIdentityOutcome StsClient::getCallerIdentity(const GetCallerIdentityRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetCallerIdentityOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetCallerIdentityOutcome(GetCallerIdentityResult(outcome.result()));
|
||||
else
|
||||
return GetCallerIdentityOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void StsClient::getCallerIdentityAsync(const GetCallerIdentityRequest& request, const GetCallerIdentityAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getCallerIdentity(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
StsClient::GetCallerIdentityOutcomeCallable StsClient::getCallerIdentityCallable(const GetCallerIdentityRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetCallerIdentityOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getCallerIdentity(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
StsClient::GenerateSessionAccessKeyOutcome StsClient::generateSessionAccessKey(const GenerateSessionAccessKeyRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GenerateSessionAccessKeyOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GenerateSessionAccessKeyOutcome(GenerateSessionAccessKeyResult(outcome.result()));
|
||||
else
|
||||
return GenerateSessionAccessKeyOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void StsClient::generateSessionAccessKeyAsync(const GenerateSessionAccessKeyRequest& request, const GenerateSessionAccessKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, generateSessionAccessKey(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
StsClient::GenerateSessionAccessKeyOutcomeCallable StsClient::generateSessionAccessKeyCallable(const GenerateSessionAccessKeyRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GenerateSessionAccessKeyOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->generateSessionAccessKey(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
StsClient::AssumeRoleOutcome StsClient::assumeRole(const AssumeRoleRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -195,3 +123,75 @@ StsClient::AssumeRoleWithSAMLOutcomeCallable StsClient::assumeRoleWithSAMLCallab
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
StsClient::GenerateSessionAccessKeyOutcome StsClient::generateSessionAccessKey(const GenerateSessionAccessKeyRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GenerateSessionAccessKeyOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GenerateSessionAccessKeyOutcome(GenerateSessionAccessKeyResult(outcome.result()));
|
||||
else
|
||||
return GenerateSessionAccessKeyOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void StsClient::generateSessionAccessKeyAsync(const GenerateSessionAccessKeyRequest& request, const GenerateSessionAccessKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, generateSessionAccessKey(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
StsClient::GenerateSessionAccessKeyOutcomeCallable StsClient::generateSessionAccessKeyCallable(const GenerateSessionAccessKeyRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GenerateSessionAccessKeyOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->generateSessionAccessKey(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
StsClient::GetCallerIdentityOutcome StsClient::getCallerIdentity(const GetCallerIdentityRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetCallerIdentityOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetCallerIdentityOutcome(GetCallerIdentityResult(outcome.result()));
|
||||
else
|
||||
return GetCallerIdentityOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void StsClient::getCallerIdentityAsync(const GetCallerIdentityRequest& request, const GetCallerIdentityAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getCallerIdentity(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
StsClient::GetCallerIdentityOutcomeCallable StsClient::getCallerIdentityCallable(const GetCallerIdentityRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetCallerIdentityOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getCallerIdentity(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,17 +25,6 @@ AssumeRoleRequest::AssumeRoleRequest() :
|
||||
AssumeRoleRequest::~AssumeRoleRequest()
|
||||
{}
|
||||
|
||||
std::string AssumeRoleRequest::getRoleArn()const
|
||||
{
|
||||
return roleArn_;
|
||||
}
|
||||
|
||||
void AssumeRoleRequest::setRoleArn(const std::string& roleArn)
|
||||
{
|
||||
roleArn_ = roleArn;
|
||||
setCoreParameter("RoleArn", roleArn);
|
||||
}
|
||||
|
||||
std::string AssumeRoleRequest::getRoleSessionName()const
|
||||
{
|
||||
return roleSessionName_;
|
||||
@@ -47,17 +36,6 @@ void AssumeRoleRequest::setRoleSessionName(const std::string& roleSessionName)
|
||||
setCoreParameter("RoleSessionName", roleSessionName);
|
||||
}
|
||||
|
||||
long AssumeRoleRequest::getDurationSeconds()const
|
||||
{
|
||||
return durationSeconds_;
|
||||
}
|
||||
|
||||
void AssumeRoleRequest::setDurationSeconds(long durationSeconds)
|
||||
{
|
||||
durationSeconds_ = durationSeconds;
|
||||
setCoreParameter("DurationSeconds", std::to_string(durationSeconds));
|
||||
}
|
||||
|
||||
std::string AssumeRoleRequest::getPolicy()const
|
||||
{
|
||||
return policy_;
|
||||
@@ -69,3 +47,25 @@ void AssumeRoleRequest::setPolicy(const std::string& policy)
|
||||
setCoreParameter("Policy", policy);
|
||||
}
|
||||
|
||||
std::string AssumeRoleRequest::getRoleArn()const
|
||||
{
|
||||
return roleArn_;
|
||||
}
|
||||
|
||||
void AssumeRoleRequest::setRoleArn(const std::string& roleArn)
|
||||
{
|
||||
roleArn_ = roleArn;
|
||||
setCoreParameter("RoleArn", roleArn);
|
||||
}
|
||||
|
||||
long AssumeRoleRequest::getDurationSeconds()const
|
||||
{
|
||||
return durationSeconds_;
|
||||
}
|
||||
|
||||
void AssumeRoleRequest::setDurationSeconds(long durationSeconds)
|
||||
{
|
||||
durationSeconds_ = durationSeconds;
|
||||
setCoreParameter("DurationSeconds", std::to_string(durationSeconds));
|
||||
}
|
||||
|
||||
|
||||
@@ -35,13 +35,9 @@ AssumeRoleResult::~AssumeRoleResult()
|
||||
|
||||
void AssumeRoleResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReader *reader = builder.newCharReader();
|
||||
Json::Value *val;
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
JSONCPP_STRING *errs;
|
||||
reader->parse(payload.data(), payload.data() + payload.size(), val, errs);
|
||||
value = *val;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto credentialsNode = value["Credentials"];
|
||||
if(!credentialsNode["SecurityToken"].isNull())
|
||||
|
||||
@@ -25,6 +25,17 @@ AssumeRoleWithSAMLRequest::AssumeRoleWithSAMLRequest() :
|
||||
AssumeRoleWithSAMLRequest::~AssumeRoleWithSAMLRequest()
|
||||
{}
|
||||
|
||||
std::string AssumeRoleWithSAMLRequest::getSAMLAssertion()const
|
||||
{
|
||||
return sAMLAssertion_;
|
||||
}
|
||||
|
||||
void AssumeRoleWithSAMLRequest::setSAMLAssertion(const std::string& sAMLAssertion)
|
||||
{
|
||||
sAMLAssertion_ = sAMLAssertion;
|
||||
setCoreParameter("SAMLAssertion", sAMLAssertion);
|
||||
}
|
||||
|
||||
std::string AssumeRoleWithSAMLRequest::getRoleArn()const
|
||||
{
|
||||
return roleArn_;
|
||||
@@ -47,17 +58,6 @@ void AssumeRoleWithSAMLRequest::setSAMLProviderArn(const std::string& sAMLProvid
|
||||
setCoreParameter("SAMLProviderArn", sAMLProviderArn);
|
||||
}
|
||||
|
||||
std::string AssumeRoleWithSAMLRequest::getSAMLAssertion()const
|
||||
{
|
||||
return sAMLAssertion_;
|
||||
}
|
||||
|
||||
void AssumeRoleWithSAMLRequest::setSAMLAssertion(const std::string& sAMLAssertion)
|
||||
{
|
||||
sAMLAssertion_ = sAMLAssertion;
|
||||
setCoreParameter("SAMLAssertion", sAMLAssertion);
|
||||
}
|
||||
|
||||
long AssumeRoleWithSAMLRequest::getDurationSeconds()const
|
||||
{
|
||||
return durationSeconds_;
|
||||
|
||||
@@ -35,13 +35,9 @@ AssumeRoleWithSAMLResult::~AssumeRoleWithSAMLResult()
|
||||
|
||||
void AssumeRoleWithSAMLResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReader *reader = builder.newCharReader();
|
||||
Json::Value *val;
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
JSONCPP_STRING *errs;
|
||||
reader->parse(payload.data(), payload.data() + payload.size(), val, errs);
|
||||
value = *val;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto credentialsNode = value["Credentials"];
|
||||
if(!credentialsNode["SecurityToken"].isNull())
|
||||
|
||||
@@ -35,13 +35,9 @@ GetCallerIdentityResult::~GetCallerIdentityResult()
|
||||
|
||||
void GetCallerIdentityResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReader *reader = builder.newCharReader();
|
||||
Json::Value *val;
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
JSONCPP_STRING *errs;
|
||||
reader->parse(payload.data(), payload.data() + payload.size(), val, errs);
|
||||
value = *val;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["AccountId"].isNull())
|
||||
accountId_ = value["AccountId"].asString();
|
||||
|
||||
Reference in New Issue
Block a user