/** * 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::ForecastService::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; DescribeWhatIfForecastExportResult::DescribeWhatIfForecastExportResult() : m_estimatedTimeRemainingInMinutes(0) { } DescribeWhatIfForecastExportResult::DescribeWhatIfForecastExportResult(const Aws::AmazonWebServiceResult& result) : m_estimatedTimeRemainingInMinutes(0) { *this = result; } DescribeWhatIfForecastExportResult& DescribeWhatIfForecastExportResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("WhatIfForecastExportArn")) { m_whatIfForecastExportArn = jsonValue.GetString("WhatIfForecastExportArn"); } if(jsonValue.ValueExists("WhatIfForecastExportName")) { m_whatIfForecastExportName = jsonValue.GetString("WhatIfForecastExportName"); } if(jsonValue.ValueExists("WhatIfForecastArns")) { Aws::Utils::Array whatIfForecastArnsJsonList = jsonValue.GetArray("WhatIfForecastArns"); for(unsigned whatIfForecastArnsIndex = 0; whatIfForecastArnsIndex < whatIfForecastArnsJsonList.GetLength(); ++whatIfForecastArnsIndex) { m_whatIfForecastArns.push_back(whatIfForecastArnsJsonList[whatIfForecastArnsIndex].AsString()); } } if(jsonValue.ValueExists("Destination")) { m_destination = jsonValue.GetObject("Destination"); } if(jsonValue.ValueExists("Message")) { m_message = jsonValue.GetString("Message"); } if(jsonValue.ValueExists("Status")) { m_status = jsonValue.GetString("Status"); } if(jsonValue.ValueExists("CreationTime")) { m_creationTime = jsonValue.GetDouble("CreationTime"); } if(jsonValue.ValueExists("EstimatedTimeRemainingInMinutes")) { m_estimatedTimeRemainingInMinutes = jsonValue.GetInt64("EstimatedTimeRemainingInMinutes"); } if(jsonValue.ValueExists("LastModificationTime")) { m_lastModificationTime = jsonValue.GetDouble("LastModificationTime"); } if(jsonValue.ValueExists("Format")) { m_format = jsonValue.GetString("Format"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }