1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #include <aws/glue/model/ConnectionsList.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 Glue 17 { 18 namespace Model 19 { 20 ConnectionsList()21ConnectionsList::ConnectionsList() : 22 m_connectionsHasBeenSet(false) 23 { 24 } 25 ConnectionsList(JsonView jsonValue)26ConnectionsList::ConnectionsList(JsonView jsonValue) : 27 m_connectionsHasBeenSet(false) 28 { 29 *this = jsonValue; 30 } 31 operator =(JsonView jsonValue)32ConnectionsList& ConnectionsList::operator =(JsonView jsonValue) 33 { 34 if(jsonValue.ValueExists("Connections")) 35 { 36 Array<JsonView> connectionsJsonList = jsonValue.GetArray("Connections"); 37 for(unsigned connectionsIndex = 0; connectionsIndex < connectionsJsonList.GetLength(); ++connectionsIndex) 38 { 39 m_connections.push_back(connectionsJsonList[connectionsIndex].AsString()); 40 } 41 m_connectionsHasBeenSet = true; 42 } 43 44 return *this; 45 } 46 Jsonize() const47JsonValue ConnectionsList::Jsonize() const 48 { 49 JsonValue payload; 50 51 if(m_connectionsHasBeenSet) 52 { 53 Array<JsonValue> connectionsJsonList(m_connections.size()); 54 for(unsigned connectionsIndex = 0; connectionsIndex < connectionsJsonList.GetLength(); ++connectionsIndex) 55 { 56 connectionsJsonList[connectionsIndex].AsString(m_connections[connectionsIndex]); 57 } 58 payload.WithArray("Connections", std::move(connectionsJsonList)); 59 60 } 61 62 return payload; 63 } 64 65 } // namespace Model 66 } // namespace Glue 67 } // namespace Aws 68