/** * 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 CostExplorer { namespace Model { DimensionValuesWithAttributes::DimensionValuesWithAttributes() : m_valueHasBeenSet(false), m_attributesHasBeenSet(false) { } DimensionValuesWithAttributes::DimensionValuesWithAttributes(JsonView jsonValue) : m_valueHasBeenSet(false), m_attributesHasBeenSet(false) { *this = jsonValue; } DimensionValuesWithAttributes& DimensionValuesWithAttributes::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Value")) { m_value = jsonValue.GetString("Value"); m_valueHasBeenSet = true; } if(jsonValue.ValueExists("Attributes")) { Aws::Map attributesJsonMap = jsonValue.GetObject("Attributes").GetAllObjects(); for(auto& attributesItem : attributesJsonMap) { m_attributes[attributesItem.first] = attributesItem.second.AsString(); } m_attributesHasBeenSet = true; } return *this; } JsonValue DimensionValuesWithAttributes::Jsonize() const { JsonValue payload; if(m_valueHasBeenSet) { payload.WithString("Value", m_value); } if(m_attributesHasBeenSet) { JsonValue attributesJsonMap; for(auto& attributesItem : m_attributes) { attributesJsonMap.WithString(attributesItem.first, attributesItem.second); } payload.WithObject("Attributes", std::move(attributesJsonMap)); } return payload; } } // namespace Model } // namespace CostExplorer } // namespace Aws