/** * 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::CostExplorer::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; GetRightsizingRecommendationResult::GetRightsizingRecommendationResult() { } GetRightsizingRecommendationResult::GetRightsizingRecommendationResult(const Aws::AmazonWebServiceResult& result) { *this = result; } GetRightsizingRecommendationResult& GetRightsizingRecommendationResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("Metadata")) { m_metadata = jsonValue.GetObject("Metadata"); } if(jsonValue.ValueExists("Summary")) { m_summary = jsonValue.GetObject("Summary"); } if(jsonValue.ValueExists("RightsizingRecommendations")) { Aws::Utils::Array rightsizingRecommendationsJsonList = jsonValue.GetArray("RightsizingRecommendations"); for(unsigned rightsizingRecommendationsIndex = 0; rightsizingRecommendationsIndex < rightsizingRecommendationsJsonList.GetLength(); ++rightsizingRecommendationsIndex) { m_rightsizingRecommendations.push_back(rightsizingRecommendationsJsonList[rightsizingRecommendationsIndex].AsObject()); } } if(jsonValue.ValueExists("NextPageToken")) { m_nextPageToken = jsonValue.GetString("NextPageToken"); } if(jsonValue.ValueExists("Configuration")) { m_configuration = jsonValue.GetObject("Configuration"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }