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,174 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/quicksight/model/ThemeVersion.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace QuickSight
{
namespace Model
{
ThemeVersion::ThemeVersion() :
m_versionNumber(0),
m_versionNumberHasBeenSet(false),
m_arnHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_baseThemeIdHasBeenSet(false),
m_createdTimeHasBeenSet(false),
m_configurationHasBeenSet(false),
m_errorsHasBeenSet(false),
m_status(ResourceStatus::NOT_SET),
m_statusHasBeenSet(false)
{
}
ThemeVersion::ThemeVersion(JsonView jsonValue) :
m_versionNumber(0),
m_versionNumberHasBeenSet(false),
m_arnHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_baseThemeIdHasBeenSet(false),
m_createdTimeHasBeenSet(false),
m_configurationHasBeenSet(false),
m_errorsHasBeenSet(false),
m_status(ResourceStatus::NOT_SET),
m_statusHasBeenSet(false)
{
*this = jsonValue;
}
ThemeVersion& ThemeVersion::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("VersionNumber"))
{
m_versionNumber = jsonValue.GetInt64("VersionNumber");
m_versionNumberHasBeenSet = true;
}
if(jsonValue.ValueExists("Arn"))
{
m_arn = jsonValue.GetString("Arn");
m_arnHasBeenSet = true;
}
if(jsonValue.ValueExists("Description"))
{
m_description = jsonValue.GetString("Description");
m_descriptionHasBeenSet = true;
}
if(jsonValue.ValueExists("BaseThemeId"))
{
m_baseThemeId = jsonValue.GetString("BaseThemeId");
m_baseThemeIdHasBeenSet = true;
}
if(jsonValue.ValueExists("CreatedTime"))
{
m_createdTime = jsonValue.GetDouble("CreatedTime");
m_createdTimeHasBeenSet = true;
}
if(jsonValue.ValueExists("Configuration"))
{
m_configuration = jsonValue.GetObject("Configuration");
m_configurationHasBeenSet = true;
}
if(jsonValue.ValueExists("Errors"))
{
Array<JsonView> errorsJsonList = jsonValue.GetArray("Errors");
for(unsigned errorsIndex = 0; errorsIndex < errorsJsonList.GetLength(); ++errorsIndex)
{
m_errors.push_back(errorsJsonList[errorsIndex].AsObject());
}
m_errorsHasBeenSet = true;
}
if(jsonValue.ValueExists("Status"))
{
m_status = ResourceStatusMapper::GetResourceStatusForName(jsonValue.GetString("Status"));
m_statusHasBeenSet = true;
}
return *this;
}
JsonValue ThemeVersion::Jsonize() const
{
JsonValue payload;
if(m_versionNumberHasBeenSet)
{
payload.WithInt64("VersionNumber", m_versionNumber);
}
if(m_arnHasBeenSet)
{
payload.WithString("Arn", m_arn);
}
if(m_descriptionHasBeenSet)
{
payload.WithString("Description", m_description);
}
if(m_baseThemeIdHasBeenSet)
{
payload.WithString("BaseThemeId", m_baseThemeId);
}
if(m_createdTimeHasBeenSet)
{
payload.WithDouble("CreatedTime", m_createdTime.SecondsWithMSPrecision());
}
if(m_configurationHasBeenSet)
{
payload.WithObject("Configuration", m_configuration.Jsonize());
}
if(m_errorsHasBeenSet)
{
Array<JsonValue> errorsJsonList(m_errors.size());
for(unsigned errorsIndex = 0; errorsIndex < errorsJsonList.GetLength(); ++errorsIndex)
{
errorsJsonList[errorsIndex].AsObject(m_errors[errorsIndex].Jsonize());
}
payload.WithArray("Errors", std::move(errorsJsonList));
}
if(m_statusHasBeenSet)
{
payload.WithString("Status", ResourceStatusMapper::GetNameForResourceStatus(m_status));
}
return payload;
}
} // namespace Model
} // namespace QuickSight
} // namespace Aws