/** * 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 IoTWireless { namespace Model { WirelessGatewayLogOption::WirelessGatewayLogOption() : m_type(WirelessGatewayType::NOT_SET), m_typeHasBeenSet(false), m_logLevel(LogLevel::NOT_SET), m_logLevelHasBeenSet(false), m_eventsHasBeenSet(false) { } WirelessGatewayLogOption::WirelessGatewayLogOption(JsonView jsonValue) : m_type(WirelessGatewayType::NOT_SET), m_typeHasBeenSet(false), m_logLevel(LogLevel::NOT_SET), m_logLevelHasBeenSet(false), m_eventsHasBeenSet(false) { *this = jsonValue; } WirelessGatewayLogOption& WirelessGatewayLogOption::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Type")) { m_type = WirelessGatewayTypeMapper::GetWirelessGatewayTypeForName(jsonValue.GetString("Type")); m_typeHasBeenSet = true; } if(jsonValue.ValueExists("LogLevel")) { m_logLevel = LogLevelMapper::GetLogLevelForName(jsonValue.GetString("LogLevel")); m_logLevelHasBeenSet = true; } if(jsonValue.ValueExists("Events")) { Aws::Utils::Array eventsJsonList = jsonValue.GetArray("Events"); for(unsigned eventsIndex = 0; eventsIndex < eventsJsonList.GetLength(); ++eventsIndex) { m_events.push_back(eventsJsonList[eventsIndex].AsObject()); } m_eventsHasBeenSet = true; } return *this; } JsonValue WirelessGatewayLogOption::Jsonize() const { JsonValue payload; if(m_typeHasBeenSet) { payload.WithString("Type", WirelessGatewayTypeMapper::GetNameForWirelessGatewayType(m_type)); } if(m_logLevelHasBeenSet) { payload.WithString("LogLevel", LogLevelMapper::GetNameForLogLevel(m_logLevel)); } if(m_eventsHasBeenSet) { Aws::Utils::Array eventsJsonList(m_events.size()); for(unsigned eventsIndex = 0; eventsIndex < eventsJsonList.GetLength(); ++eventsIndex) { eventsJsonList[eventsIndex].AsObject(m_events[eventsIndex].Jsonize()); } payload.WithArray("Events", std::move(eventsJsonList)); } return payload; } } // namespace Model } // namespace IoTWireless } // namespace Aws