121 lines
2.4 KiB
C++
121 lines
2.4 KiB
C++
/**
|
|
* 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
|