/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include 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_sortByHasBeenSet(false), m_nextPageTokenHasBeenSet(false), m_maxResults(0), m_maxResultsHasBeenSet(false) { } Aws::String GetReservationUtilizationRequest::SerializePayload() const { JsonValue payload; if(m_timePeriodHasBeenSet) { payload.WithObject("TimePeriod", m_timePeriod.Jsonize()); } if(m_groupByHasBeenSet) { Aws::Utils::Array 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_sortByHasBeenSet) { payload.WithObject("SortBy", m_sortBy.Jsonize()); } if(m_nextPageTokenHasBeenSet) { payload.WithString("NextPageToken", m_nextPageToken); } if(m_maxResultsHasBeenSet) { payload.WithInteger("MaxResults", m_maxResults); } 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; }