STS SDK Auto Released By shenshi,Version:1.34.19

Signed-off-by: haowei.yao <haowei.yao@alibaba-inc.com>
This commit is contained in:
haowei.yao
2019-03-14 13:35:32 +08:00
parent 26d4cdb3b5
commit a59527266e
19 changed files with 1045 additions and 2 deletions

View File

@@ -0,0 +1,70 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_STS_STSCLIENT_H_
#define ALIBABACLOUD_STS_STSCLIENT_H_
#include <future>
#include <alibabacloud/core/AsyncCallerContext.h>
#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"
namespace AlibabaCloud
{
namespace Sts
{
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;
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;
private:
std::shared_ptr<EndpointProvider> endpointProvider_;
};
}
}
#endif // !ALIBABACLOUD_STS_STSCLIENT_H_

View File

@@ -0,0 +1,32 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_STS_STSEXPORT_H_
#define ALIBABACLOUD_STS_STSEXPORT_H_
#include <alibabacloud/core/Global.h>
#if defined(ALIBABACLOUD_SHARED)
# if defined(ALIBABACLOUD_STS_LIBRARY)
# define ALIBABACLOUD_STS_EXPORT ALIBABACLOUD_DECL_EXPORT
# else
# define ALIBABACLOUD_STS_EXPORT ALIBABACLOUD_DECL_IMPORT
# endif
#else
# define ALIBABACLOUD_STS_EXPORT
#endif
#endif // !ALIBABACLOUD_STS_STSEXPORT_H_

View File

@@ -0,0 +1,57 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_STS_MODEL_ASSUMEROLEREQUEST_H_
#define ALIBABACLOUD_STS_MODEL_ASSUMEROLEREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/sts/StsExport.h>
namespace AlibabaCloud
{
namespace Sts
{
namespace Model
{
class ALIBABACLOUD_STS_EXPORT AssumeRoleRequest : public RpcServiceRequest
{
public:
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);
private:
std::string roleArn_;
std::string roleSessionName_;
long durationSeconds_;
std::string policy_;
};
}
}
}
#endif // !ALIBABACLOUD_STS_MODEL_ASSUMEROLEREQUEST_H_

View File

@@ -0,0 +1,65 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_STS_MODEL_ASSUMEROLERESULT_H_
#define ALIBABACLOUD_STS_MODEL_ASSUMEROLERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/sts/StsExport.h>
namespace AlibabaCloud
{
namespace Sts
{
namespace Model
{
class ALIBABACLOUD_STS_EXPORT AssumeRoleResult : public ServiceResult
{
public:
struct Credentials
{
std::string securityToken;
std::string accessKeyId;
std::string accessKeySecret;
std::string expiration;
};
struct AssumedRoleUser
{
std::string arn;
std::string assumedRoleId;
};
AssumeRoleResult();
explicit AssumeRoleResult(const std::string &payload);
~AssumeRoleResult();
AssumedRoleUser getAssumedRoleUser()const;
Credentials getCredentials()const;
protected:
void parse(const std::string &payload);
private:
AssumedRoleUser assumedRoleUser_;
Credentials credentials_;
};
}
}
}
#endif // !ALIBABACLOUD_STS_MODEL_ASSUMEROLERESULT_H_

View File

@@ -0,0 +1,48 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_STS_MODEL_GENERATESESSIONACCESSKEYREQUEST_H_
#define ALIBABACLOUD_STS_MODEL_GENERATESESSIONACCESSKEYREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/sts/StsExport.h>
namespace AlibabaCloud
{
namespace Sts
{
namespace Model
{
class ALIBABACLOUD_STS_EXPORT GenerateSessionAccessKeyRequest : public RpcServiceRequest
{
public:
GenerateSessionAccessKeyRequest();
~GenerateSessionAccessKeyRequest();
long getDurationSeconds()const;
void setDurationSeconds(long durationSeconds);
private:
long durationSeconds_;
};
}
}
}
#endif // !ALIBABACLOUD_STS_MODEL_GENERATESESSIONACCESSKEYREQUEST_H_

View File

@@ -0,0 +1,57 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_STS_MODEL_GENERATESESSIONACCESSKEYRESULT_H_
#define ALIBABACLOUD_STS_MODEL_GENERATESESSIONACCESSKEYRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/sts/StsExport.h>
namespace AlibabaCloud
{
namespace Sts
{
namespace Model
{
class ALIBABACLOUD_STS_EXPORT GenerateSessionAccessKeyResult : public ServiceResult
{
public:
struct SessionAccessKey
{
std::string sessionAccessKeyId;
std::string expiration;
std::string sessionAccessKeySecret;
};
GenerateSessionAccessKeyResult();
explicit GenerateSessionAccessKeyResult(const std::string &payload);
~GenerateSessionAccessKeyResult();
SessionAccessKey getSessionAccessKey()const;
protected:
void parse(const std::string &payload);
private:
SessionAccessKey sessionAccessKey_;
};
}
}
}
#endif // !ALIBABACLOUD_STS_MODEL_GENERATESESSIONACCESSKEYRESULT_H_

View File

@@ -0,0 +1,45 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_STS_MODEL_GETCALLERIDENTITYREQUEST_H_
#define ALIBABACLOUD_STS_MODEL_GETCALLERIDENTITYREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/sts/StsExport.h>
namespace AlibabaCloud
{
namespace Sts
{
namespace Model
{
class ALIBABACLOUD_STS_EXPORT GetCallerIdentityRequest : public RpcServiceRequest
{
public:
GetCallerIdentityRequest();
~GetCallerIdentityRequest();
private:
};
}
}
}
#endif // !ALIBABACLOUD_STS_MODEL_GETCALLERIDENTITYREQUEST_H_

View File

@@ -0,0 +1,61 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_STS_MODEL_GETCALLERIDENTITYRESULT_H_
#define ALIBABACLOUD_STS_MODEL_GETCALLERIDENTITYRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/sts/StsExport.h>
namespace AlibabaCloud
{
namespace Sts
{
namespace Model
{
class ALIBABACLOUD_STS_EXPORT GetCallerIdentityResult : public ServiceResult
{
public:
GetCallerIdentityResult();
explicit GetCallerIdentityResult(const std::string &payload);
~GetCallerIdentityResult();
std::string getIdentityType()const;
std::string getAccountId()const;
std::string getPrincipalId()const;
std::string getUserId()const;
std::string getArn()const;
std::string getRoleId()const;
protected:
void parse(const std::string &payload);
private:
std::string identityType_;
std::string accountId_;
std::string principalId_;
std::string userId_;
std::string arn_;
std::string roleId_;
};
}
}
}
#endif // !ALIBABACLOUD_STS_MODEL_GETCALLERIDENTITYRESULT_H_