/** * 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::CloudWatchEvidently::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; GetExperimentResultsResult::GetExperimentResultsResult() { } GetExperimentResultsResult::GetExperimentResultsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } GetExperimentResultsResult& GetExperimentResultsResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("details")) { m_details = jsonValue.GetString("details"); } if(jsonValue.ValueExists("reports")) { Aws::Utils::Array reportsJsonList = jsonValue.GetArray("reports"); for(unsigned reportsIndex = 0; reportsIndex < reportsJsonList.GetLength(); ++reportsIndex) { m_reports.push_back(reportsJsonList[reportsIndex].AsObject()); } } if(jsonValue.ValueExists("resultsData")) { Aws::Utils::Array resultsDataJsonList = jsonValue.GetArray("resultsData"); for(unsigned resultsDataIndex = 0; resultsDataIndex < resultsDataJsonList.GetLength(); ++resultsDataIndex) { m_resultsData.push_back(resultsDataJsonList[resultsDataIndex].AsObject()); } } if(jsonValue.ValueExists("timestamps")) { Aws::Utils::Array timestampsJsonList = jsonValue.GetArray("timestamps"); for(unsigned timestampsIndex = 0; timestampsIndex < timestampsJsonList.GetLength(); ++timestampsIndex) { m_timestamps.push_back(timestampsJsonList[timestampsIndex].AsDouble()); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }