/** * 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::GreengrassV2::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; DescribeComponentResult::DescribeComponentResult() { } DescribeComponentResult::DescribeComponentResult(const Aws::AmazonWebServiceResult& result) { *this = result; } DescribeComponentResult& DescribeComponentResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("arn")) { m_arn = jsonValue.GetString("arn"); } if(jsonValue.ValueExists("componentName")) { m_componentName = jsonValue.GetString("componentName"); } if(jsonValue.ValueExists("componentVersion")) { m_componentVersion = jsonValue.GetString("componentVersion"); } if(jsonValue.ValueExists("creationTimestamp")) { m_creationTimestamp = jsonValue.GetDouble("creationTimestamp"); } if(jsonValue.ValueExists("publisher")) { m_publisher = jsonValue.GetString("publisher"); } if(jsonValue.ValueExists("description")) { m_description = jsonValue.GetString("description"); } if(jsonValue.ValueExists("status")) { m_status = jsonValue.GetObject("status"); } if(jsonValue.ValueExists("platforms")) { Aws::Utils::Array platformsJsonList = jsonValue.GetArray("platforms"); for(unsigned platformsIndex = 0; platformsIndex < platformsJsonList.GetLength(); ++platformsIndex) { m_platforms.push_back(platformsJsonList[platformsIndex].AsObject()); } } if(jsonValue.ValueExists("tags")) { Aws::Map tagsJsonMap = jsonValue.GetObject("tags").GetAllObjects(); for(auto& tagsItem : tagsJsonMap) { m_tags[tagsItem.first] = tagsItem.second.AsString(); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }