179 lines
3.7 KiB
C++
179 lines
3.7 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/iot/model/AuditMitigationActionExecutionMetadata.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace IoT
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
AuditMitigationActionExecutionMetadata::AuditMitigationActionExecutionMetadata() :
|
|
m_taskIdHasBeenSet(false),
|
|
m_findingIdHasBeenSet(false),
|
|
m_actionNameHasBeenSet(false),
|
|
m_actionIdHasBeenSet(false),
|
|
m_status(AuditMitigationActionsExecutionStatus::NOT_SET),
|
|
m_statusHasBeenSet(false),
|
|
m_startTimeHasBeenSet(false),
|
|
m_endTimeHasBeenSet(false),
|
|
m_errorCodeHasBeenSet(false),
|
|
m_messageHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
AuditMitigationActionExecutionMetadata::AuditMitigationActionExecutionMetadata(JsonView jsonValue) :
|
|
m_taskIdHasBeenSet(false),
|
|
m_findingIdHasBeenSet(false),
|
|
m_actionNameHasBeenSet(false),
|
|
m_actionIdHasBeenSet(false),
|
|
m_status(AuditMitigationActionsExecutionStatus::NOT_SET),
|
|
m_statusHasBeenSet(false),
|
|
m_startTimeHasBeenSet(false),
|
|
m_endTimeHasBeenSet(false),
|
|
m_errorCodeHasBeenSet(false),
|
|
m_messageHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
AuditMitigationActionExecutionMetadata& AuditMitigationActionExecutionMetadata::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("taskId"))
|
|
{
|
|
m_taskId = jsonValue.GetString("taskId");
|
|
|
|
m_taskIdHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("findingId"))
|
|
{
|
|
m_findingId = jsonValue.GetString("findingId");
|
|
|
|
m_findingIdHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("actionName"))
|
|
{
|
|
m_actionName = jsonValue.GetString("actionName");
|
|
|
|
m_actionNameHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("actionId"))
|
|
{
|
|
m_actionId = jsonValue.GetString("actionId");
|
|
|
|
m_actionIdHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("status"))
|
|
{
|
|
m_status = AuditMitigationActionsExecutionStatusMapper::GetAuditMitigationActionsExecutionStatusForName(jsonValue.GetString("status"));
|
|
|
|
m_statusHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("startTime"))
|
|
{
|
|
m_startTime = jsonValue.GetDouble("startTime");
|
|
|
|
m_startTimeHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("endTime"))
|
|
{
|
|
m_endTime = jsonValue.GetDouble("endTime");
|
|
|
|
m_endTimeHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("errorCode"))
|
|
{
|
|
m_errorCode = jsonValue.GetString("errorCode");
|
|
|
|
m_errorCodeHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("message"))
|
|
{
|
|
m_message = jsonValue.GetString("message");
|
|
|
|
m_messageHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue AuditMitigationActionExecutionMetadata::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_taskIdHasBeenSet)
|
|
{
|
|
payload.WithString("taskId", m_taskId);
|
|
|
|
}
|
|
|
|
if(m_findingIdHasBeenSet)
|
|
{
|
|
payload.WithString("findingId", m_findingId);
|
|
|
|
}
|
|
|
|
if(m_actionNameHasBeenSet)
|
|
{
|
|
payload.WithString("actionName", m_actionName);
|
|
|
|
}
|
|
|
|
if(m_actionIdHasBeenSet)
|
|
{
|
|
payload.WithString("actionId", m_actionId);
|
|
|
|
}
|
|
|
|
if(m_statusHasBeenSet)
|
|
{
|
|
payload.WithString("status", AuditMitigationActionsExecutionStatusMapper::GetNameForAuditMitigationActionsExecutionStatus(m_status));
|
|
}
|
|
|
|
if(m_startTimeHasBeenSet)
|
|
{
|
|
payload.WithDouble("startTime", m_startTime.SecondsWithMSPrecision());
|
|
}
|
|
|
|
if(m_endTimeHasBeenSet)
|
|
{
|
|
payload.WithDouble("endTime", m_endTime.SecondsWithMSPrecision());
|
|
}
|
|
|
|
if(m_errorCodeHasBeenSet)
|
|
{
|
|
payload.WithString("errorCode", m_errorCode);
|
|
|
|
}
|
|
|
|
if(m_messageHasBeenSet)
|
|
{
|
|
payload.WithString("message", m_message);
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace IoT
|
|
} // namespace Aws
|