/** * 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::Kinesis::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; DisableEnhancedMonitoringResult::DisableEnhancedMonitoringResult() { } DisableEnhancedMonitoringResult::DisableEnhancedMonitoringResult(const Aws::AmazonWebServiceResult& result) { *this = result; } DisableEnhancedMonitoringResult& DisableEnhancedMonitoringResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("StreamName")) { m_streamName = jsonValue.GetString("StreamName"); } if(jsonValue.ValueExists("CurrentShardLevelMetrics")) { Aws::Utils::Array currentShardLevelMetricsJsonList = jsonValue.GetArray("CurrentShardLevelMetrics"); for(unsigned currentShardLevelMetricsIndex = 0; currentShardLevelMetricsIndex < currentShardLevelMetricsJsonList.GetLength(); ++currentShardLevelMetricsIndex) { m_currentShardLevelMetrics.push_back(MetricsNameMapper::GetMetricsNameForName(currentShardLevelMetricsJsonList[currentShardLevelMetricsIndex].AsString())); } } if(jsonValue.ValueExists("DesiredShardLevelMetrics")) { Aws::Utils::Array desiredShardLevelMetricsJsonList = jsonValue.GetArray("DesiredShardLevelMetrics"); for(unsigned desiredShardLevelMetricsIndex = 0; desiredShardLevelMetricsIndex < desiredShardLevelMetricsJsonList.GetLength(); ++desiredShardLevelMetricsIndex) { m_desiredShardLevelMetrics.push_back(MetricsNameMapper::GetMetricsNameForName(desiredShardLevelMetricsJsonList[desiredShardLevelMetricsIndex].AsString())); } } if(jsonValue.ValueExists("StreamARN")) { m_streamARN = jsonValue.GetString("StreamARN"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }