/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::IoTWireless::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateWirelessDeviceRequest::CreateWirelessDeviceRequest() : m_type(WirelessDeviceType::NOT_SET), m_typeHasBeenSet(false), m_nameHasBeenSet(false), m_descriptionHasBeenSet(false), m_destinationNameHasBeenSet(false), m_clientRequestToken(Aws::Utils::UUID::PseudoRandomUUID()), m_clientRequestTokenHasBeenSet(true), m_loRaWANHasBeenSet(false), m_tagsHasBeenSet(false), m_positioning(PositioningConfigStatus::NOT_SET), m_positioningHasBeenSet(false), m_sidewalkHasBeenSet(false) { } Aws::String CreateWirelessDeviceRequest::SerializePayload() const { JsonValue payload; if(m_typeHasBeenSet) { payload.WithString("Type", WirelessDeviceTypeMapper::GetNameForWirelessDeviceType(m_type)); } if(m_nameHasBeenSet) { payload.WithString("Name", m_name); } if(m_descriptionHasBeenSet) { payload.WithString("Description", m_description); } if(m_destinationNameHasBeenSet) { payload.WithString("DestinationName", m_destinationName); } if(m_clientRequestTokenHasBeenSet) { payload.WithString("ClientRequestToken", m_clientRequestToken); } if(m_loRaWANHasBeenSet) { payload.WithObject("LoRaWAN", m_loRaWAN.Jsonize()); } if(m_tagsHasBeenSet) { Aws::Utils::Array tagsJsonList(m_tags.size()); for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex) { tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize()); } payload.WithArray("Tags", std::move(tagsJsonList)); } if(m_positioningHasBeenSet) { payload.WithString("Positioning", PositioningConfigStatusMapper::GetNameForPositioningConfigStatus(m_positioning)); } if(m_sidewalkHasBeenSet) { payload.WithObject("Sidewalk", m_sidewalk.Jsonize()); } return payload.View().WriteReadable(); }