/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include #include #include using namespace Aws::IoTTwinMaker::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; GetPropertyValueResult::GetPropertyValueResult() { } GetPropertyValueResult::GetPropertyValueResult(const Aws::AmazonWebServiceResult& result) { *this = result; } GetPropertyValueResult& GetPropertyValueResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("propertyValues")) { Aws::Map propertyValuesJsonMap = jsonValue.GetObject("propertyValues").GetAllObjects(); for(auto& propertyValuesItem : propertyValuesJsonMap) { m_propertyValues[propertyValuesItem.first] = propertyValuesItem.second.AsObject(); } } if(jsonValue.ValueExists("nextToken")) { m_nextToken = jsonValue.GetString("nextToken"); } if(jsonValue.ValueExists("tabularPropertyValues")) { Aws::Utils::Array tabularPropertyValuesJsonList = jsonValue.GetArray("tabularPropertyValues"); for(unsigned tabularPropertyValuesIndex = 0; tabularPropertyValuesIndex < tabularPropertyValuesJsonList.GetLength(); ++tabularPropertyValuesIndex) { Aws::Utils::Array tabularPropertyValueJsonList = tabularPropertyValuesJsonList[tabularPropertyValuesIndex].AsArray(); Aws::Vector> tabularPropertyValueList; tabularPropertyValueList.reserve((size_t)tabularPropertyValueJsonList.GetLength()); for(unsigned tabularPropertyValueIndex = 0; tabularPropertyValueIndex < tabularPropertyValueJsonList.GetLength(); ++tabularPropertyValueIndex) { Aws::Map propertyTableValueJsonMap = tabularPropertyValueJsonList[tabularPropertyValueIndex].GetAllObjects(); Aws::Map propertyTableValueMap; for(auto& propertyTableValueItem : propertyTableValueJsonMap) { propertyTableValueMap[propertyTableValueItem.first] = propertyTableValueItem.second.AsObject(); } tabularPropertyValueList.push_back(std::move(propertyTableValueMap)); } m_tabularPropertyValues.push_back(std::move(tabularPropertyValueList)); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }