120 lines
2.3 KiB
C++
120 lines
2.3 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/managedblockchain/model/NodeSummary.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace ManagedBlockchain
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
NodeSummary::NodeSummary() :
|
|
m_idHasBeenSet(false),
|
|
m_status(NodeStatus::NOT_SET),
|
|
m_statusHasBeenSet(false),
|
|
m_creationDateHasBeenSet(false),
|
|
m_availabilityZoneHasBeenSet(false),
|
|
m_instanceTypeHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
NodeSummary::NodeSummary(JsonView jsonValue) :
|
|
m_idHasBeenSet(false),
|
|
m_status(NodeStatus::NOT_SET),
|
|
m_statusHasBeenSet(false),
|
|
m_creationDateHasBeenSet(false),
|
|
m_availabilityZoneHasBeenSet(false),
|
|
m_instanceTypeHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
NodeSummary& NodeSummary::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("Id"))
|
|
{
|
|
m_id = jsonValue.GetString("Id");
|
|
|
|
m_idHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("Status"))
|
|
{
|
|
m_status = NodeStatusMapper::GetNodeStatusForName(jsonValue.GetString("Status"));
|
|
|
|
m_statusHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("CreationDate"))
|
|
{
|
|
m_creationDate = jsonValue.GetString("CreationDate");
|
|
|
|
m_creationDateHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("AvailabilityZone"))
|
|
{
|
|
m_availabilityZone = jsonValue.GetString("AvailabilityZone");
|
|
|
|
m_availabilityZoneHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("InstanceType"))
|
|
{
|
|
m_instanceType = jsonValue.GetString("InstanceType");
|
|
|
|
m_instanceTypeHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue NodeSummary::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_idHasBeenSet)
|
|
{
|
|
payload.WithString("Id", m_id);
|
|
|
|
}
|
|
|
|
if(m_statusHasBeenSet)
|
|
{
|
|
payload.WithString("Status", NodeStatusMapper::GetNameForNodeStatus(m_status));
|
|
}
|
|
|
|
if(m_creationDateHasBeenSet)
|
|
{
|
|
payload.WithString("CreationDate", m_creationDate.ToGmtString(DateFormat::ISO_8601));
|
|
}
|
|
|
|
if(m_availabilityZoneHasBeenSet)
|
|
{
|
|
payload.WithString("AvailabilityZone", m_availabilityZone);
|
|
|
|
}
|
|
|
|
if(m_instanceTypeHasBeenSet)
|
|
{
|
|
payload.WithString("InstanceType", m_instanceType);
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace ManagedBlockchain
|
|
} // namespace Aws
|