/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace Kinesis { namespace Model { EnhancedMetrics::EnhancedMetrics() : m_shardLevelMetricsHasBeenSet(false) { } EnhancedMetrics::EnhancedMetrics(JsonView jsonValue) : m_shardLevelMetricsHasBeenSet(false) { *this = jsonValue; } EnhancedMetrics& EnhancedMetrics::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("ShardLevelMetrics")) { Aws::Utils::Array shardLevelMetricsJsonList = jsonValue.GetArray("ShardLevelMetrics"); for(unsigned shardLevelMetricsIndex = 0; shardLevelMetricsIndex < shardLevelMetricsJsonList.GetLength(); ++shardLevelMetricsIndex) { m_shardLevelMetrics.push_back(MetricsNameMapper::GetMetricsNameForName(shardLevelMetricsJsonList[shardLevelMetricsIndex].AsString())); } m_shardLevelMetricsHasBeenSet = true; } return *this; } JsonValue EnhancedMetrics::Jsonize() const { JsonValue payload; if(m_shardLevelMetricsHasBeenSet) { Aws::Utils::Array shardLevelMetricsJsonList(m_shardLevelMetrics.size()); for(unsigned shardLevelMetricsIndex = 0; shardLevelMetricsIndex < shardLevelMetricsJsonList.GetLength(); ++shardLevelMetricsIndex) { shardLevelMetricsJsonList[shardLevelMetricsIndex].AsString(MetricsNameMapper::GetNameForMetricsName(m_shardLevelMetrics[shardLevelMetricsIndex])); } payload.WithArray("ShardLevelMetrics", std::move(shardLevelMetricsJsonList)); } return payload; } } // namespace Model } // namespace Kinesis } // namespace Aws