1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #include <aws/iotsitewise/model/DescribeGatewayResult.h> 7 #include <aws/core/utils/json/JsonSerializer.h> 8 #include <aws/core/AmazonWebServiceResult.h> 9 #include <aws/core/utils/StringUtils.h> 10 #include <aws/core/utils/UnreferencedParam.h> 11 12 #include <utility> 13 14 using namespace Aws::IoTSiteWise::Model; 15 using namespace Aws::Utils::Json; 16 using namespace Aws::Utils; 17 using namespace Aws; 18 DescribeGatewayResult()19DescribeGatewayResult::DescribeGatewayResult() 20 { 21 } 22 DescribeGatewayResult(const Aws::AmazonWebServiceResult<JsonValue> & result)23DescribeGatewayResult::DescribeGatewayResult(const Aws::AmazonWebServiceResult<JsonValue>& result) 24 { 25 *this = result; 26 } 27 operator =(const Aws::AmazonWebServiceResult<JsonValue> & result)28DescribeGatewayResult& DescribeGatewayResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result) 29 { 30 JsonView jsonValue = result.GetPayload().View(); 31 if(jsonValue.ValueExists("gatewayId")) 32 { 33 m_gatewayId = jsonValue.GetString("gatewayId"); 34 35 } 36 37 if(jsonValue.ValueExists("gatewayName")) 38 { 39 m_gatewayName = jsonValue.GetString("gatewayName"); 40 41 } 42 43 if(jsonValue.ValueExists("gatewayArn")) 44 { 45 m_gatewayArn = jsonValue.GetString("gatewayArn"); 46 47 } 48 49 if(jsonValue.ValueExists("gatewayPlatform")) 50 { 51 m_gatewayPlatform = jsonValue.GetObject("gatewayPlatform"); 52 53 } 54 55 if(jsonValue.ValueExists("gatewayCapabilitySummaries")) 56 { 57 Array<JsonView> gatewayCapabilitySummariesJsonList = jsonValue.GetArray("gatewayCapabilitySummaries"); 58 for(unsigned gatewayCapabilitySummariesIndex = 0; gatewayCapabilitySummariesIndex < gatewayCapabilitySummariesJsonList.GetLength(); ++gatewayCapabilitySummariesIndex) 59 { 60 m_gatewayCapabilitySummaries.push_back(gatewayCapabilitySummariesJsonList[gatewayCapabilitySummariesIndex].AsObject()); 61 } 62 } 63 64 if(jsonValue.ValueExists("creationDate")) 65 { 66 m_creationDate = jsonValue.GetDouble("creationDate"); 67 68 } 69 70 if(jsonValue.ValueExists("lastUpdateDate")) 71 { 72 m_lastUpdateDate = jsonValue.GetDouble("lastUpdateDate"); 73 74 } 75 76 77 78 return *this; 79 } 80