/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include 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), m_arnHasBeenSet(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), m_arnHasBeenSet(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; } if(jsonValue.ValueExists("Arn")) { m_arn = jsonValue.GetString("Arn"); m_arnHasBeenSet = 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(Aws::Utils::DateFormat::ISO_8601)); } if(m_availabilityZoneHasBeenSet) { payload.WithString("AvailabilityZone", m_availabilityZone); } if(m_instanceTypeHasBeenSet) { payload.WithString("InstanceType", m_instanceType); } if(m_arnHasBeenSet) { payload.WithString("Arn", m_arn); } return payload; } } // namespace Model } // namespace ManagedBlockchain } // namespace Aws