1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #include <aws/honeycode/model/DestinationOptions.h> 7 #include <aws/core/utils/json/JsonSerializer.h> 8 9 #include <utility> 10 11 using namespace Aws::Utils::Json; 12 using namespace Aws::Utils; 13 14 namespace Aws 15 { 16 namespace Honeycode 17 { 18 namespace Model 19 { 20 DestinationOptions()21DestinationOptions::DestinationOptions() : 22 m_columnMapHasBeenSet(false) 23 { 24 } 25 DestinationOptions(JsonView jsonValue)26DestinationOptions::DestinationOptions(JsonView jsonValue) : 27 m_columnMapHasBeenSet(false) 28 { 29 *this = jsonValue; 30 } 31 operator =(JsonView jsonValue)32DestinationOptions& DestinationOptions::operator =(JsonView jsonValue) 33 { 34 if(jsonValue.ValueExists("columnMap")) 35 { 36 Aws::Map<Aws::String, JsonView> columnMapJsonMap = jsonValue.GetObject("columnMap").GetAllObjects(); 37 for(auto& columnMapItem : columnMapJsonMap) 38 { 39 m_columnMap[columnMapItem.first] = columnMapItem.second.AsObject(); 40 } 41 m_columnMapHasBeenSet = true; 42 } 43 44 return *this; 45 } 46 Jsonize() const47JsonValue DestinationOptions::Jsonize() const 48 { 49 JsonValue payload; 50 51 if(m_columnMapHasBeenSet) 52 { 53 JsonValue columnMapJsonMap; 54 for(auto& columnMapItem : m_columnMap) 55 { 56 columnMapJsonMap.WithObject(columnMapItem.first, columnMapItem.second.Jsonize()); 57 } 58 payload.WithObject("columnMap", std::move(columnMapJsonMap)); 59 60 } 61 62 return payload; 63 } 64 65 } // namespace Model 66 } // namespace Honeycode 67 } // namespace Aws 68