This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
pxz-hos-client-cpp-module/support/aws-sdk-cpp-master/aws-cpp-sdk-alexaforbusiness/source/model/DeviceData.cpp

240 lines
5.0 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/alexaforbusiness/model/DeviceData.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace AlexaForBusiness
{
namespace Model
{
DeviceData::DeviceData() :
m_deviceArnHasBeenSet(false),
m_deviceSerialNumberHasBeenSet(false),
m_deviceTypeHasBeenSet(false),
m_deviceNameHasBeenSet(false),
m_softwareVersionHasBeenSet(false),
m_macAddressHasBeenSet(false),
m_deviceStatus(DeviceStatus::NOT_SET),
m_deviceStatusHasBeenSet(false),
m_networkProfileArnHasBeenSet(false),
m_networkProfileNameHasBeenSet(false),
m_roomArnHasBeenSet(false),
m_roomNameHasBeenSet(false),
m_deviceStatusInfoHasBeenSet(false),
m_createdTimeHasBeenSet(false)
{
}
DeviceData::DeviceData(JsonView jsonValue) :
m_deviceArnHasBeenSet(false),
m_deviceSerialNumberHasBeenSet(false),
m_deviceTypeHasBeenSet(false),
m_deviceNameHasBeenSet(false),
m_softwareVersionHasBeenSet(false),
m_macAddressHasBeenSet(false),
m_deviceStatus(DeviceStatus::NOT_SET),
m_deviceStatusHasBeenSet(false),
m_networkProfileArnHasBeenSet(false),
m_networkProfileNameHasBeenSet(false),
m_roomArnHasBeenSet(false),
m_roomNameHasBeenSet(false),
m_deviceStatusInfoHasBeenSet(false),
m_createdTimeHasBeenSet(false)
{
*this = jsonValue;
}
DeviceData& DeviceData::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("DeviceArn"))
{
m_deviceArn = jsonValue.GetString("DeviceArn");
m_deviceArnHasBeenSet = true;
}
if(jsonValue.ValueExists("DeviceSerialNumber"))
{
m_deviceSerialNumber = jsonValue.GetString("DeviceSerialNumber");
m_deviceSerialNumberHasBeenSet = true;
}
if(jsonValue.ValueExists("DeviceType"))
{
m_deviceType = jsonValue.GetString("DeviceType");
m_deviceTypeHasBeenSet = true;
}
if(jsonValue.ValueExists("DeviceName"))
{
m_deviceName = jsonValue.GetString("DeviceName");
m_deviceNameHasBeenSet = true;
}
if(jsonValue.ValueExists("SoftwareVersion"))
{
m_softwareVersion = jsonValue.GetString("SoftwareVersion");
m_softwareVersionHasBeenSet = true;
}
if(jsonValue.ValueExists("MacAddress"))
{
m_macAddress = jsonValue.GetString("MacAddress");
m_macAddressHasBeenSet = true;
}
if(jsonValue.ValueExists("DeviceStatus"))
{
m_deviceStatus = DeviceStatusMapper::GetDeviceStatusForName(jsonValue.GetString("DeviceStatus"));
m_deviceStatusHasBeenSet = true;
}
if(jsonValue.ValueExists("NetworkProfileArn"))
{
m_networkProfileArn = jsonValue.GetString("NetworkProfileArn");
m_networkProfileArnHasBeenSet = true;
}
if(jsonValue.ValueExists("NetworkProfileName"))
{
m_networkProfileName = jsonValue.GetString("NetworkProfileName");
m_networkProfileNameHasBeenSet = true;
}
if(jsonValue.ValueExists("RoomArn"))
{
m_roomArn = jsonValue.GetString("RoomArn");
m_roomArnHasBeenSet = true;
}
if(jsonValue.ValueExists("RoomName"))
{
m_roomName = jsonValue.GetString("RoomName");
m_roomNameHasBeenSet = true;
}
if(jsonValue.ValueExists("DeviceStatusInfo"))
{
m_deviceStatusInfo = jsonValue.GetObject("DeviceStatusInfo");
m_deviceStatusInfoHasBeenSet = true;
}
if(jsonValue.ValueExists("CreatedTime"))
{
m_createdTime = jsonValue.GetDouble("CreatedTime");
m_createdTimeHasBeenSet = true;
}
return *this;
}
JsonValue DeviceData::Jsonize() const
{
JsonValue payload;
if(m_deviceArnHasBeenSet)
{
payload.WithString("DeviceArn", m_deviceArn);
}
if(m_deviceSerialNumberHasBeenSet)
{
payload.WithString("DeviceSerialNumber", m_deviceSerialNumber);
}
if(m_deviceTypeHasBeenSet)
{
payload.WithString("DeviceType", m_deviceType);
}
if(m_deviceNameHasBeenSet)
{
payload.WithString("DeviceName", m_deviceName);
}
if(m_softwareVersionHasBeenSet)
{
payload.WithString("SoftwareVersion", m_softwareVersion);
}
if(m_macAddressHasBeenSet)
{
payload.WithString("MacAddress", m_macAddress);
}
if(m_deviceStatusHasBeenSet)
{
payload.WithString("DeviceStatus", DeviceStatusMapper::GetNameForDeviceStatus(m_deviceStatus));
}
if(m_networkProfileArnHasBeenSet)
{
payload.WithString("NetworkProfileArn", m_networkProfileArn);
}
if(m_networkProfileNameHasBeenSet)
{
payload.WithString("NetworkProfileName", m_networkProfileName);
}
if(m_roomArnHasBeenSet)
{
payload.WithString("RoomArn", m_roomArn);
}
if(m_roomNameHasBeenSet)
{
payload.WithString("RoomName", m_roomName);
}
if(m_deviceStatusInfoHasBeenSet)
{
payload.WithObject("DeviceStatusInfo", m_deviceStatusInfo.Jsonize());
}
if(m_createdTimeHasBeenSet)
{
payload.WithDouble("CreatedTime", m_createdTime.SecondsWithMSPrecision());
}
return payload;
}
} // namespace Model
} // namespace AlexaForBusiness
} // namespace Aws