113 lines
2.1 KiB
C++
113 lines
2.1 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/ecs/model/Attachment.h>
|
|||
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|||
|
|
|
|||
|
|
#include <utility>
|
|||
|
|
|
|||
|
|
using namespace Aws::Utils::Json;
|
|||
|
|
using namespace Aws::Utils;
|
|||
|
|
|
|||
|
|
namespace Aws
|
|||
|
|
{
|
|||
|
|
namespace ECS
|
|||
|
|
{
|
|||
|
|
namespace Model
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
Attachment::Attachment() :
|
|||
|
|
m_idHasBeenSet(false),
|
|||
|
|
m_typeHasBeenSet(false),
|
|||
|
|
m_statusHasBeenSet(false),
|
|||
|
|
m_detailsHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Attachment::Attachment(JsonView jsonValue) :
|
|||
|
|
m_idHasBeenSet(false),
|
|||
|
|
m_typeHasBeenSet(false),
|
|||
|
|
m_statusHasBeenSet(false),
|
|||
|
|
m_detailsHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
*this = jsonValue;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Attachment& Attachment::operator =(JsonView jsonValue)
|
|||
|
|
{
|
|||
|
|
if(jsonValue.ValueExists("id"))
|
|||
|
|
{
|
|||
|
|
m_id = jsonValue.GetString("id");
|
|||
|
|
|
|||
|
|
m_idHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("type"))
|
|||
|
|
{
|
|||
|
|
m_type = jsonValue.GetString("type");
|
|||
|
|
|
|||
|
|
m_typeHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("status"))
|
|||
|
|
{
|
|||
|
|
m_status = jsonValue.GetString("status");
|
|||
|
|
|
|||
|
|
m_statusHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("details"))
|
|||
|
|
{
|
|||
|
|
Array<JsonView> detailsJsonList = jsonValue.GetArray("details");
|
|||
|
|
for(unsigned detailsIndex = 0; detailsIndex < detailsJsonList.GetLength(); ++detailsIndex)
|
|||
|
|
{
|
|||
|
|
m_details.push_back(detailsJsonList[detailsIndex].AsObject());
|
|||
|
|
}
|
|||
|
|
m_detailsHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return *this;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
JsonValue Attachment::Jsonize() const
|
|||
|
|
{
|
|||
|
|
JsonValue payload;
|
|||
|
|
|
|||
|
|
if(m_idHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("id", m_id);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_typeHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("type", m_type);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_statusHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("status", m_status);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_detailsHasBeenSet)
|
|||
|
|
{
|
|||
|
|
Array<JsonValue> detailsJsonList(m_details.size());
|
|||
|
|
for(unsigned detailsIndex = 0; detailsIndex < detailsJsonList.GetLength(); ++detailsIndex)
|
|||
|
|
{
|
|||
|
|
detailsJsonList[detailsIndex].AsObject(m_details[detailsIndex].Jsonize());
|
|||
|
|
}
|
|||
|
|
payload.WithArray("details", std::move(detailsJsonList));
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return payload;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} // namespace Model
|
|||
|
|
} // namespace ECS
|
|||
|
|
} // namespace Aws
|