77 lines
1.8 KiB
C++
77 lines
1.8 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/ce/model/GetReservationUtilizationRequest.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::CostExplorer::Model;
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
GetReservationUtilizationRequest::GetReservationUtilizationRequest() :
|
|
m_timePeriodHasBeenSet(false),
|
|
m_groupByHasBeenSet(false),
|
|
m_granularity(Granularity::NOT_SET),
|
|
m_granularityHasBeenSet(false),
|
|
m_filterHasBeenSet(false),
|
|
m_nextPageTokenHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
Aws::String GetReservationUtilizationRequest::SerializePayload() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_timePeriodHasBeenSet)
|
|
{
|
|
payload.WithObject("TimePeriod", m_timePeriod.Jsonize());
|
|
|
|
}
|
|
|
|
if(m_groupByHasBeenSet)
|
|
{
|
|
Array<JsonValue> groupByJsonList(m_groupBy.size());
|
|
for(unsigned groupByIndex = 0; groupByIndex < groupByJsonList.GetLength(); ++groupByIndex)
|
|
{
|
|
groupByJsonList[groupByIndex].AsObject(m_groupBy[groupByIndex].Jsonize());
|
|
}
|
|
payload.WithArray("GroupBy", std::move(groupByJsonList));
|
|
|
|
}
|
|
|
|
if(m_granularityHasBeenSet)
|
|
{
|
|
payload.WithString("Granularity", GranularityMapper::GetNameForGranularity(m_granularity));
|
|
}
|
|
|
|
if(m_filterHasBeenSet)
|
|
{
|
|
payload.WithObject("Filter", m_filter.Jsonize());
|
|
|
|
}
|
|
|
|
if(m_nextPageTokenHasBeenSet)
|
|
{
|
|
payload.WithString("NextPageToken", m_nextPageToken);
|
|
|
|
}
|
|
|
|
return payload.View().WriteReadable();
|
|
}
|
|
|
|
Aws::Http::HeaderValueCollection GetReservationUtilizationRequest::GetRequestSpecificHeaders() const
|
|
{
|
|
Aws::Http::HeaderValueCollection headers;
|
|
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSInsightsIndexService.GetReservationUtilization"));
|
|
return headers;
|
|
|
|
}
|
|
|
|
|
|
|
|
|