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,90 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ssm/model/PatchStatus.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace SSM
{
namespace Model
{
PatchStatus::PatchStatus() :
m_deploymentStatus(PatchDeploymentStatus::NOT_SET),
m_deploymentStatusHasBeenSet(false),
m_complianceLevel(PatchComplianceLevel::NOT_SET),
m_complianceLevelHasBeenSet(false),
m_approvalDateHasBeenSet(false)
{
}
PatchStatus::PatchStatus(JsonView jsonValue) :
m_deploymentStatus(PatchDeploymentStatus::NOT_SET),
m_deploymentStatusHasBeenSet(false),
m_complianceLevel(PatchComplianceLevel::NOT_SET),
m_complianceLevelHasBeenSet(false),
m_approvalDateHasBeenSet(false)
{
*this = jsonValue;
}
PatchStatus& PatchStatus::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("DeploymentStatus"))
{
m_deploymentStatus = PatchDeploymentStatusMapper::GetPatchDeploymentStatusForName(jsonValue.GetString("DeploymentStatus"));
m_deploymentStatusHasBeenSet = true;
}
if(jsonValue.ValueExists("ComplianceLevel"))
{
m_complianceLevel = PatchComplianceLevelMapper::GetPatchComplianceLevelForName(jsonValue.GetString("ComplianceLevel"));
m_complianceLevelHasBeenSet = true;
}
if(jsonValue.ValueExists("ApprovalDate"))
{
m_approvalDate = jsonValue.GetDouble("ApprovalDate");
m_approvalDateHasBeenSet = true;
}
return *this;
}
JsonValue PatchStatus::Jsonize() const
{
JsonValue payload;
if(m_deploymentStatusHasBeenSet)
{
payload.WithString("DeploymentStatus", PatchDeploymentStatusMapper::GetNameForPatchDeploymentStatus(m_deploymentStatus));
}
if(m_complianceLevelHasBeenSet)
{
payload.WithString("ComplianceLevel", PatchComplianceLevelMapper::GetNameForPatchComplianceLevel(m_complianceLevel));
}
if(m_approvalDateHasBeenSet)
{
payload.WithDouble("ApprovalDate", m_approvalDate.SecondsWithMSPrecision());
}
return payload;
}
} // namespace Model
} // namespace SSM
} // namespace Aws