/** * 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; GetAnomaliesResult::GetAnomaliesResult() { } GetAnomaliesResult::GetAnomaliesResult(const Aws::AmazonWebServiceResult& result) { *this = result; } GetAnomaliesResult& GetAnomaliesResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("Anomalies")) { Aws::Utils::Array anomaliesJsonList = jsonValue.GetArray("Anomalies"); for(unsigned anomaliesIndex = 0; anomaliesIndex < anomaliesJsonList.GetLength(); ++anomaliesIndex) { m_anomalies.push_back(anomaliesJsonList[anomaliesIndex].AsObject()); } } if(jsonValue.ValueExists("NextPageToken")) { m_nextPageToken = jsonValue.GetString("NextPageToken"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }