/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Connect::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; GetMetricDataV2Request::GetMetricDataV2Request() : m_resourceArnHasBeenSet(false), m_startTimeHasBeenSet(false), m_endTimeHasBeenSet(false), m_filtersHasBeenSet(false), m_groupingsHasBeenSet(false), m_metricsHasBeenSet(false), m_nextTokenHasBeenSet(false), m_maxResults(0), m_maxResultsHasBeenSet(false) { } Aws::String GetMetricDataV2Request::SerializePayload() const { JsonValue payload; if(m_resourceArnHasBeenSet) { payload.WithString("ResourceArn", m_resourceArn); } if(m_startTimeHasBeenSet) { payload.WithDouble("StartTime", m_startTime.SecondsWithMSPrecision()); } if(m_endTimeHasBeenSet) { payload.WithDouble("EndTime", m_endTime.SecondsWithMSPrecision()); } if(m_filtersHasBeenSet) { Aws::Utils::Array filtersJsonList(m_filters.size()); for(unsigned filtersIndex = 0; filtersIndex < filtersJsonList.GetLength(); ++filtersIndex) { filtersJsonList[filtersIndex].AsObject(m_filters[filtersIndex].Jsonize()); } payload.WithArray("Filters", std::move(filtersJsonList)); } if(m_groupingsHasBeenSet) { Aws::Utils::Array groupingsJsonList(m_groupings.size()); for(unsigned groupingsIndex = 0; groupingsIndex < groupingsJsonList.GetLength(); ++groupingsIndex) { groupingsJsonList[groupingsIndex].AsString(m_groupings[groupingsIndex]); } payload.WithArray("Groupings", std::move(groupingsJsonList)); } if(m_metricsHasBeenSet) { Aws::Utils::Array metricsJsonList(m_metrics.size()); for(unsigned metricsIndex = 0; metricsIndex < metricsJsonList.GetLength(); ++metricsIndex) { metricsJsonList[metricsIndex].AsObject(m_metrics[metricsIndex].Jsonize()); } payload.WithArray("Metrics", std::move(metricsJsonList)); } if(m_nextTokenHasBeenSet) { payload.WithString("NextToken", m_nextToken); } if(m_maxResultsHasBeenSet) { payload.WithInteger("MaxResults", m_maxResults); } return payload.View().WriteReadable(); }