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,89 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sso/model/AccountInfo.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace SSO
{
namespace Model
{
AccountInfo::AccountInfo() :
m_accountIdHasBeenSet(false),
m_accountNameHasBeenSet(false),
m_emailAddressHasBeenSet(false)
{
}
AccountInfo::AccountInfo(JsonView jsonValue) :
m_accountIdHasBeenSet(false),
m_accountNameHasBeenSet(false),
m_emailAddressHasBeenSet(false)
{
*this = jsonValue;
}
AccountInfo& AccountInfo::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("accountId"))
{
m_accountId = jsonValue.GetString("accountId");
m_accountIdHasBeenSet = true;
}
if(jsonValue.ValueExists("accountName"))
{
m_accountName = jsonValue.GetString("accountName");
m_accountNameHasBeenSet = true;
}
if(jsonValue.ValueExists("emailAddress"))
{
m_emailAddress = jsonValue.GetString("emailAddress");
m_emailAddressHasBeenSet = true;
}
return *this;
}
JsonValue AccountInfo::Jsonize() const
{
JsonValue payload;
if(m_accountIdHasBeenSet)
{
payload.WithString("accountId", m_accountId);
}
if(m_accountNameHasBeenSet)
{
payload.WithString("accountName", m_accountName);
}
if(m_emailAddressHasBeenSet)
{
payload.WithString("emailAddress", m_emailAddress);
}
return payload;
}
} // namespace Model
} // namespace SSO
} // namespace Aws

View File

@@ -0,0 +1,65 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sso/model/GetRoleCredentialsRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/http/URI.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <utility>
using namespace Aws::SSO::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws::Http;
GetRoleCredentialsRequest::GetRoleCredentialsRequest() :
m_roleNameHasBeenSet(false),
m_accountIdHasBeenSet(false),
m_accessTokenHasBeenSet(false)
{
}
Aws::String GetRoleCredentialsRequest::SerializePayload() const
{
return {};
}
Aws::Http::HeaderValueCollection GetRoleCredentialsRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
Aws::StringStream ss;
if(m_accessTokenHasBeenSet)
{
ss << m_accessToken;
headers.emplace("x-amz-sso_bearer_token", ss.str());
ss.str("");
}
return headers;
}
void GetRoleCredentialsRequest::AddQueryStringParameters(URI& uri) const
{
Aws::StringStream ss;
if(m_roleNameHasBeenSet)
{
ss << m_roleName;
uri.AddQueryStringParameter("role_name", ss.str());
ss.str("");
}
if(m_accountIdHasBeenSet)
{
ss << m_accountId;
uri.AddQueryStringParameter("account_id", ss.str());
ss.str("");
}
}

View File

@@ -0,0 +1,40 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sso/model/GetRoleCredentialsResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::SSO::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
GetRoleCredentialsResult::GetRoleCredentialsResult()
{
}
GetRoleCredentialsResult::GetRoleCredentialsResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
GetRoleCredentialsResult& GetRoleCredentialsResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("roleCredentials"))
{
m_roleCredentials = jsonValue.GetObject("roleCredentials");
}
return *this;
}

View File

@@ -0,0 +1,74 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sso/model/ListAccountRolesRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/http/URI.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <utility>
using namespace Aws::SSO::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws::Http;
ListAccountRolesRequest::ListAccountRolesRequest() :
m_nextTokenHasBeenSet(false),
m_maxResults(0),
m_maxResultsHasBeenSet(false),
m_accessTokenHasBeenSet(false),
m_accountIdHasBeenSet(false)
{
}
Aws::String ListAccountRolesRequest::SerializePayload() const
{
return {};
}
Aws::Http::HeaderValueCollection ListAccountRolesRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
Aws::StringStream ss;
if(m_accessTokenHasBeenSet)
{
ss << m_accessToken;
headers.emplace("x-amz-sso_bearer_token", ss.str());
ss.str("");
}
return headers;
}
void ListAccountRolesRequest::AddQueryStringParameters(URI& uri) const
{
Aws::StringStream ss;
if(m_nextTokenHasBeenSet)
{
ss << m_nextToken;
uri.AddQueryStringParameter("next_token", ss.str());
ss.str("");
}
if(m_maxResultsHasBeenSet)
{
ss << m_maxResults;
uri.AddQueryStringParameter("max_result", ss.str());
ss.str("");
}
if(m_accountIdHasBeenSet)
{
ss << m_accountId;
uri.AddQueryStringParameter("account_id", ss.str());
ss.str("");
}
}

View File

@@ -0,0 +1,49 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sso/model/ListAccountRolesResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::SSO::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
ListAccountRolesResult::ListAccountRolesResult()
{
}
ListAccountRolesResult::ListAccountRolesResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
ListAccountRolesResult& ListAccountRolesResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("nextToken"))
{
m_nextToken = jsonValue.GetString("nextToken");
}
if(jsonValue.ValueExists("roleList"))
{
Array<JsonView> roleListJsonList = jsonValue.GetArray("roleList");
for(unsigned roleListIndex = 0; roleListIndex < roleListJsonList.GetLength(); ++roleListIndex)
{
m_roleList.push_back(roleListJsonList[roleListIndex].AsObject());
}
}
return *this;
}

View File

@@ -0,0 +1,66 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sso/model/ListAccountsRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/http/URI.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <utility>
using namespace Aws::SSO::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws::Http;
ListAccountsRequest::ListAccountsRequest() :
m_nextTokenHasBeenSet(false),
m_maxResults(0),
m_maxResultsHasBeenSet(false),
m_accessTokenHasBeenSet(false)
{
}
Aws::String ListAccountsRequest::SerializePayload() const
{
return {};
}
Aws::Http::HeaderValueCollection ListAccountsRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
Aws::StringStream ss;
if(m_accessTokenHasBeenSet)
{
ss << m_accessToken;
headers.emplace("x-amz-sso_bearer_token", ss.str());
ss.str("");
}
return headers;
}
void ListAccountsRequest::AddQueryStringParameters(URI& uri) const
{
Aws::StringStream ss;
if(m_nextTokenHasBeenSet)
{
ss << m_nextToken;
uri.AddQueryStringParameter("next_token", ss.str());
ss.str("");
}
if(m_maxResultsHasBeenSet)
{
ss << m_maxResults;
uri.AddQueryStringParameter("max_result", ss.str());
ss.str("");
}
}

View File

@@ -0,0 +1,49 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sso/model/ListAccountsResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::SSO::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
ListAccountsResult::ListAccountsResult()
{
}
ListAccountsResult::ListAccountsResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
ListAccountsResult& ListAccountsResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("nextToken"))
{
m_nextToken = jsonValue.GetString("nextToken");
}
if(jsonValue.ValueExists("accountList"))
{
Array<JsonView> accountListJsonList = jsonValue.GetArray("accountList");
for(unsigned accountListIndex = 0; accountListIndex < accountListJsonList.GetLength(); ++accountListIndex)
{
m_accountList.push_back(accountListJsonList[accountListIndex].AsObject());
}
}
return *this;
}

View File

@@ -0,0 +1,43 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sso/model/LogoutRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <utility>
using namespace Aws::SSO::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
LogoutRequest::LogoutRequest() :
m_accessTokenHasBeenSet(false)
{
}
Aws::String LogoutRequest::SerializePayload() const
{
return {};
}
Aws::Http::HeaderValueCollection LogoutRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
Aws::StringStream ss;
if(m_accessTokenHasBeenSet)
{
ss << m_accessToken;
headers.emplace("x-amz-sso_bearer_token", ss.str());
ss.str("");
}
return headers;
}

View File

@@ -0,0 +1,106 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sso/model/RoleCredentials.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace SSO
{
namespace Model
{
RoleCredentials::RoleCredentials() :
m_accessKeyIdHasBeenSet(false),
m_secretAccessKeyHasBeenSet(false),
m_sessionTokenHasBeenSet(false),
m_expiration(0),
m_expirationHasBeenSet(false)
{
}
RoleCredentials::RoleCredentials(JsonView jsonValue) :
m_accessKeyIdHasBeenSet(false),
m_secretAccessKeyHasBeenSet(false),
m_sessionTokenHasBeenSet(false),
m_expiration(0),
m_expirationHasBeenSet(false)
{
*this = jsonValue;
}
RoleCredentials& RoleCredentials::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("accessKeyId"))
{
m_accessKeyId = jsonValue.GetString("accessKeyId");
m_accessKeyIdHasBeenSet = true;
}
if(jsonValue.ValueExists("secretAccessKey"))
{
m_secretAccessKey = jsonValue.GetString("secretAccessKey");
m_secretAccessKeyHasBeenSet = true;
}
if(jsonValue.ValueExists("sessionToken"))
{
m_sessionToken = jsonValue.GetString("sessionToken");
m_sessionTokenHasBeenSet = true;
}
if(jsonValue.ValueExists("expiration"))
{
m_expiration = jsonValue.GetInt64("expiration");
m_expirationHasBeenSet = true;
}
return *this;
}
JsonValue RoleCredentials::Jsonize() const
{
JsonValue payload;
if(m_accessKeyIdHasBeenSet)
{
payload.WithString("accessKeyId", m_accessKeyId);
}
if(m_secretAccessKeyHasBeenSet)
{
payload.WithString("secretAccessKey", m_secretAccessKey);
}
if(m_sessionTokenHasBeenSet)
{
payload.WithString("sessionToken", m_sessionToken);
}
if(m_expirationHasBeenSet)
{
payload.WithInt64("expiration", m_expiration);
}
return payload;
}
} // namespace Model
} // namespace SSO
} // namespace Aws

View File

@@ -0,0 +1,74 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sso/model/RoleInfo.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace SSO
{
namespace Model
{
RoleInfo::RoleInfo() :
m_roleNameHasBeenSet(false),
m_accountIdHasBeenSet(false)
{
}
RoleInfo::RoleInfo(JsonView jsonValue) :
m_roleNameHasBeenSet(false),
m_accountIdHasBeenSet(false)
{
*this = jsonValue;
}
RoleInfo& RoleInfo::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("roleName"))
{
m_roleName = jsonValue.GetString("roleName");
m_roleNameHasBeenSet = true;
}
if(jsonValue.ValueExists("accountId"))
{
m_accountId = jsonValue.GetString("accountId");
m_accountIdHasBeenSet = true;
}
return *this;
}
JsonValue RoleInfo::Jsonize() const
{
JsonValue payload;
if(m_roleNameHasBeenSet)
{
payload.WithString("roleName", m_roleName);
}
if(m_accountIdHasBeenSet)
{
payload.WithString("accountId", m_accountId);
}
return payload;
}
} // namespace Model
} // namespace SSO
} // namespace Aws