/** * 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::MigrationHubOrchestrator::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; GetTemplateStepGroupResult::GetTemplateStepGroupResult() : m_status(StepGroupStatus::NOT_SET) { } GetTemplateStepGroupResult::GetTemplateStepGroupResult(const Aws::AmazonWebServiceResult& result) : m_status(StepGroupStatus::NOT_SET) { *this = result; } GetTemplateStepGroupResult& GetTemplateStepGroupResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("templateId")) { m_templateId = jsonValue.GetString("templateId"); } if(jsonValue.ValueExists("id")) { m_id = jsonValue.GetString("id"); } if(jsonValue.ValueExists("name")) { m_name = jsonValue.GetString("name"); } if(jsonValue.ValueExists("description")) { m_description = jsonValue.GetString("description"); } if(jsonValue.ValueExists("status")) { m_status = StepGroupStatusMapper::GetStepGroupStatusForName(jsonValue.GetString("status")); } if(jsonValue.ValueExists("creationTime")) { m_creationTime = jsonValue.GetDouble("creationTime"); } if(jsonValue.ValueExists("lastModifiedTime")) { m_lastModifiedTime = jsonValue.GetDouble("lastModifiedTime"); } if(jsonValue.ValueExists("tools")) { Aws::Utils::Array toolsJsonList = jsonValue.GetArray("tools"); for(unsigned toolsIndex = 0; toolsIndex < toolsJsonList.GetLength(); ++toolsIndex) { m_tools.push_back(toolsJsonList[toolsIndex].AsObject()); } } if(jsonValue.ValueExists("previous")) { Aws::Utils::Array previousJsonList = jsonValue.GetArray("previous"); for(unsigned previousIndex = 0; previousIndex < previousJsonList.GetLength(); ++previousIndex) { m_previous.push_back(previousJsonList[previousIndex].AsString()); } } if(jsonValue.ValueExists("next")) { Aws::Utils::Array nextJsonList = jsonValue.GetArray("next"); for(unsigned nextIndex = 0; nextIndex < nextJsonList.GetLength(); ++nextIndex) { m_next.push_back(nextJsonList[nextIndex].AsString()); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }