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,84 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/codebuild/model/BatchRestrictions.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace CodeBuild
{
namespace Model
{
BatchRestrictions::BatchRestrictions() :
m_maximumBuildsAllowed(0),
m_maximumBuildsAllowedHasBeenSet(false),
m_computeTypesAllowedHasBeenSet(false)
{
}
BatchRestrictions::BatchRestrictions(JsonView jsonValue) :
m_maximumBuildsAllowed(0),
m_maximumBuildsAllowedHasBeenSet(false),
m_computeTypesAllowedHasBeenSet(false)
{
*this = jsonValue;
}
BatchRestrictions& BatchRestrictions::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("maximumBuildsAllowed"))
{
m_maximumBuildsAllowed = jsonValue.GetInteger("maximumBuildsAllowed");
m_maximumBuildsAllowedHasBeenSet = true;
}
if(jsonValue.ValueExists("computeTypesAllowed"))
{
Array<JsonView> computeTypesAllowedJsonList = jsonValue.GetArray("computeTypesAllowed");
for(unsigned computeTypesAllowedIndex = 0; computeTypesAllowedIndex < computeTypesAllowedJsonList.GetLength(); ++computeTypesAllowedIndex)
{
m_computeTypesAllowed.push_back(computeTypesAllowedJsonList[computeTypesAllowedIndex].AsString());
}
m_computeTypesAllowedHasBeenSet = true;
}
return *this;
}
JsonValue BatchRestrictions::Jsonize() const
{
JsonValue payload;
if(m_maximumBuildsAllowedHasBeenSet)
{
payload.WithInteger("maximumBuildsAllowed", m_maximumBuildsAllowed);
}
if(m_computeTypesAllowedHasBeenSet)
{
Array<JsonValue> computeTypesAllowedJsonList(m_computeTypesAllowed.size());
for(unsigned computeTypesAllowedIndex = 0; computeTypesAllowedIndex < computeTypesAllowedJsonList.GetLength(); ++computeTypesAllowedIndex)
{
computeTypesAllowedJsonList[computeTypesAllowedIndex].AsString(m_computeTypesAllowed[computeTypesAllowedIndex]);
}
payload.WithArray("computeTypesAllowed", std::move(computeTypesAllowedJsonList));
}
return payload;
}
} // namespace Model
} // namespace CodeBuild
} // namespace Aws