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,128 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/devicefarm/model/ScheduleRunTest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace DeviceFarm
{
namespace Model
{
ScheduleRunTest::ScheduleRunTest() :
m_type(TestType::NOT_SET),
m_typeHasBeenSet(false),
m_testPackageArnHasBeenSet(false),
m_testSpecArnHasBeenSet(false),
m_filterHasBeenSet(false),
m_parametersHasBeenSet(false)
{
}
ScheduleRunTest::ScheduleRunTest(JsonView jsonValue) :
m_type(TestType::NOT_SET),
m_typeHasBeenSet(false),
m_testPackageArnHasBeenSet(false),
m_testSpecArnHasBeenSet(false),
m_filterHasBeenSet(false),
m_parametersHasBeenSet(false)
{
*this = jsonValue;
}
ScheduleRunTest& ScheduleRunTest::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("type"))
{
m_type = TestTypeMapper::GetTestTypeForName(jsonValue.GetString("type"));
m_typeHasBeenSet = true;
}
if(jsonValue.ValueExists("testPackageArn"))
{
m_testPackageArn = jsonValue.GetString("testPackageArn");
m_testPackageArnHasBeenSet = true;
}
if(jsonValue.ValueExists("testSpecArn"))
{
m_testSpecArn = jsonValue.GetString("testSpecArn");
m_testSpecArnHasBeenSet = true;
}
if(jsonValue.ValueExists("filter"))
{
m_filter = jsonValue.GetString("filter");
m_filterHasBeenSet = true;
}
if(jsonValue.ValueExists("parameters"))
{
Aws::Map<Aws::String, JsonView> parametersJsonMap = jsonValue.GetObject("parameters").GetAllObjects();
for(auto& parametersItem : parametersJsonMap)
{
m_parameters[parametersItem.first] = parametersItem.second.AsString();
}
m_parametersHasBeenSet = true;
}
return *this;
}
JsonValue ScheduleRunTest::Jsonize() const
{
JsonValue payload;
if(m_typeHasBeenSet)
{
payload.WithString("type", TestTypeMapper::GetNameForTestType(m_type));
}
if(m_testPackageArnHasBeenSet)
{
payload.WithString("testPackageArn", m_testPackageArn);
}
if(m_testSpecArnHasBeenSet)
{
payload.WithString("testSpecArn", m_testSpecArn);
}
if(m_filterHasBeenSet)
{
payload.WithString("filter", m_filter);
}
if(m_parametersHasBeenSet)
{
JsonValue parametersJsonMap;
for(auto& parametersItem : m_parameters)
{
parametersJsonMap.WithString(parametersItem.first, parametersItem.second);
}
payload.WithObject("parameters", std::move(parametersJsonMap));
}
return payload;
}
} // namespace Model
} // namespace DeviceFarm
} // namespace Aws