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,120 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/gamelift/model/InstanceAccess.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace GameLift
{
namespace Model
{
InstanceAccess::InstanceAccess() :
m_fleetIdHasBeenSet(false),
m_instanceIdHasBeenSet(false),
m_ipAddressHasBeenSet(false),
m_operatingSystem(OperatingSystem::NOT_SET),
m_operatingSystemHasBeenSet(false),
m_credentialsHasBeenSet(false)
{
}
InstanceAccess::InstanceAccess(JsonView jsonValue) :
m_fleetIdHasBeenSet(false),
m_instanceIdHasBeenSet(false),
m_ipAddressHasBeenSet(false),
m_operatingSystem(OperatingSystem::NOT_SET),
m_operatingSystemHasBeenSet(false),
m_credentialsHasBeenSet(false)
{
*this = jsonValue;
}
InstanceAccess& InstanceAccess::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("FleetId"))
{
m_fleetId = jsonValue.GetString("FleetId");
m_fleetIdHasBeenSet = true;
}
if(jsonValue.ValueExists("InstanceId"))
{
m_instanceId = jsonValue.GetString("InstanceId");
m_instanceIdHasBeenSet = true;
}
if(jsonValue.ValueExists("IpAddress"))
{
m_ipAddress = jsonValue.GetString("IpAddress");
m_ipAddressHasBeenSet = true;
}
if(jsonValue.ValueExists("OperatingSystem"))
{
m_operatingSystem = OperatingSystemMapper::GetOperatingSystemForName(jsonValue.GetString("OperatingSystem"));
m_operatingSystemHasBeenSet = true;
}
if(jsonValue.ValueExists("Credentials"))
{
m_credentials = jsonValue.GetObject("Credentials");
m_credentialsHasBeenSet = true;
}
return *this;
}
JsonValue InstanceAccess::Jsonize() const
{
JsonValue payload;
if(m_fleetIdHasBeenSet)
{
payload.WithString("FleetId", m_fleetId);
}
if(m_instanceIdHasBeenSet)
{
payload.WithString("InstanceId", m_instanceId);
}
if(m_ipAddressHasBeenSet)
{
payload.WithString("IpAddress", m_ipAddress);
}
if(m_operatingSystemHasBeenSet)
{
payload.WithString("OperatingSystem", OperatingSystemMapper::GetNameForOperatingSystem(m_operatingSystem));
}
if(m_credentialsHasBeenSet)
{
payload.WithObject("Credentials", m_credentials.Jsonize());
}
return payload;
}
} // namespace Model
} // namespace GameLift
} // namespace Aws