68 lines
1.6 KiB
C++
68 lines
1.6 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/ecs/model/DescribeTasksRequest.h>
|
|||
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|||
|
|
|
|||
|
|
#include <utility>
|
|||
|
|
|
|||
|
|
using namespace Aws::ECS::Model;
|
|||
|
|
using namespace Aws::Utils::Json;
|
|||
|
|
using namespace Aws::Utils;
|
|||
|
|
|
|||
|
|
DescribeTasksRequest::DescribeTasksRequest() :
|
|||
|
|
m_clusterHasBeenSet(false),
|
|||
|
|
m_tasksHasBeenSet(false),
|
|||
|
|
m_includeHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Aws::String DescribeTasksRequest::SerializePayload() const
|
|||
|
|
{
|
|||
|
|
JsonValue payload;
|
|||
|
|
|
|||
|
|
if(m_clusterHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("cluster", m_cluster);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_tasksHasBeenSet)
|
|||
|
|
{
|
|||
|
|
Array<JsonValue> tasksJsonList(m_tasks.size());
|
|||
|
|
for(unsigned tasksIndex = 0; tasksIndex < tasksJsonList.GetLength(); ++tasksIndex)
|
|||
|
|
{
|
|||
|
|
tasksJsonList[tasksIndex].AsString(m_tasks[tasksIndex]);
|
|||
|
|
}
|
|||
|
|
payload.WithArray("tasks", std::move(tasksJsonList));
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_includeHasBeenSet)
|
|||
|
|
{
|
|||
|
|
Array<JsonValue> includeJsonList(m_include.size());
|
|||
|
|
for(unsigned includeIndex = 0; includeIndex < includeJsonList.GetLength(); ++includeIndex)
|
|||
|
|
{
|
|||
|
|
includeJsonList[includeIndex].AsString(TaskFieldMapper::GetNameForTaskField(m_include[includeIndex]));
|
|||
|
|
}
|
|||
|
|
payload.WithArray("include", std::move(includeJsonList));
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return payload.View().WriteReadable();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Aws::Http::HeaderValueCollection DescribeTasksRequest::GetRequestSpecificHeaders() const
|
|||
|
|
{
|
|||
|
|
Aws::Http::HeaderValueCollection headers;
|
|||
|
|
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AmazonEC2ContainerServiceV20141113.DescribeTasks"));
|
|||
|
|
return headers;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|