113 lines
2.4 KiB
C++
113 lines
2.4 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/dlm/model/ResourceNotFoundException.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace DLM
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
ResourceNotFoundException::ResourceNotFoundException() :
|
|
m_messageHasBeenSet(false),
|
|
m_codeHasBeenSet(false),
|
|
m_resourceTypeHasBeenSet(false),
|
|
m_resourceIdsHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
ResourceNotFoundException::ResourceNotFoundException(JsonView jsonValue) :
|
|
m_messageHasBeenSet(false),
|
|
m_codeHasBeenSet(false),
|
|
m_resourceTypeHasBeenSet(false),
|
|
m_resourceIdsHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
ResourceNotFoundException& ResourceNotFoundException::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("Message"))
|
|
{
|
|
m_message = jsonValue.GetString("Message");
|
|
|
|
m_messageHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("Code"))
|
|
{
|
|
m_code = jsonValue.GetString("Code");
|
|
|
|
m_codeHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("ResourceType"))
|
|
{
|
|
m_resourceType = jsonValue.GetString("ResourceType");
|
|
|
|
m_resourceTypeHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("ResourceIds"))
|
|
{
|
|
Array<JsonView> resourceIdsJsonList = jsonValue.GetArray("ResourceIds");
|
|
for(unsigned resourceIdsIndex = 0; resourceIdsIndex < resourceIdsJsonList.GetLength(); ++resourceIdsIndex)
|
|
{
|
|
m_resourceIds.push_back(resourceIdsJsonList[resourceIdsIndex].AsString());
|
|
}
|
|
m_resourceIdsHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue ResourceNotFoundException::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_messageHasBeenSet)
|
|
{
|
|
payload.WithString("Message", m_message);
|
|
|
|
}
|
|
|
|
if(m_codeHasBeenSet)
|
|
{
|
|
payload.WithString("Code", m_code);
|
|
|
|
}
|
|
|
|
if(m_resourceTypeHasBeenSet)
|
|
{
|
|
payload.WithString("ResourceType", m_resourceType);
|
|
|
|
}
|
|
|
|
if(m_resourceIdsHasBeenSet)
|
|
{
|
|
Array<JsonValue> resourceIdsJsonList(m_resourceIds.size());
|
|
for(unsigned resourceIdsIndex = 0; resourceIdsIndex < resourceIdsJsonList.GetLength(); ++resourceIdsIndex)
|
|
{
|
|
resourceIdsJsonList[resourceIdsIndex].AsString(m_resourceIds[resourceIdsIndex]);
|
|
}
|
|
payload.WithArray("ResourceIds", std::move(resourceIdsJsonList));
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace DLM
|
|
} // namespace Aws
|