/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include #include #include using namespace Aws::PI::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; GetResourceMetricsResult::GetResourceMetricsResult() { } GetResourceMetricsResult::GetResourceMetricsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } GetResourceMetricsResult& GetResourceMetricsResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("AlignedStartTime")) { m_alignedStartTime = jsonValue.GetDouble("AlignedStartTime"); } if(jsonValue.ValueExists("AlignedEndTime")) { m_alignedEndTime = jsonValue.GetDouble("AlignedEndTime"); } if(jsonValue.ValueExists("Identifier")) { m_identifier = jsonValue.GetString("Identifier"); } if(jsonValue.ValueExists("MetricList")) { Aws::Utils::Array metricListJsonList = jsonValue.GetArray("MetricList"); for(unsigned metricListIndex = 0; metricListIndex < metricListJsonList.GetLength(); ++metricListIndex) { m_metricList.push_back(metricListJsonList[metricListIndex].AsObject()); } } if(jsonValue.ValueExists("NextToken")) { m_nextToken = jsonValue.GetString("NextToken"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }