/** * 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::MigrationHubRefactorSpaces::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; GetApplicationResult::GetApplicationResult() : m_proxyType(ProxyType::NOT_SET), m_state(ApplicationState::NOT_SET) { } GetApplicationResult::GetApplicationResult(const Aws::AmazonWebServiceResult& result) : m_proxyType(ProxyType::NOT_SET), m_state(ApplicationState::NOT_SET) { *this = result; } GetApplicationResult& GetApplicationResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("ApiGatewayProxy")) { m_apiGatewayProxy = jsonValue.GetObject("ApiGatewayProxy"); } if(jsonValue.ValueExists("ApplicationId")) { m_applicationId = jsonValue.GetString("ApplicationId"); } if(jsonValue.ValueExists("Arn")) { m_arn = jsonValue.GetString("Arn"); } if(jsonValue.ValueExists("CreatedByAccountId")) { m_createdByAccountId = jsonValue.GetString("CreatedByAccountId"); } if(jsonValue.ValueExists("CreatedTime")) { m_createdTime = jsonValue.GetDouble("CreatedTime"); } if(jsonValue.ValueExists("EnvironmentId")) { m_environmentId = jsonValue.GetString("EnvironmentId"); } if(jsonValue.ValueExists("Error")) { m_error = jsonValue.GetObject("Error"); } if(jsonValue.ValueExists("LastUpdatedTime")) { m_lastUpdatedTime = jsonValue.GetDouble("LastUpdatedTime"); } if(jsonValue.ValueExists("Name")) { m_name = jsonValue.GetString("Name"); } if(jsonValue.ValueExists("OwnerAccountId")) { m_ownerAccountId = jsonValue.GetString("OwnerAccountId"); } if(jsonValue.ValueExists("ProxyType")) { m_proxyType = ProxyTypeMapper::GetProxyTypeForName(jsonValue.GetString("ProxyType")); } if(jsonValue.ValueExists("State")) { m_state = ApplicationStateMapper::GetApplicationStateForName(jsonValue.GetString("State")); } if(jsonValue.ValueExists("Tags")) { Aws::Map tagsJsonMap = jsonValue.GetObject("Tags").GetAllObjects(); for(auto& tagsItem : tagsJsonMap) { m_tags[tagsItem.first] = tagsItem.second.AsString(); } } if(jsonValue.ValueExists("VpcId")) { m_vpcId = jsonValue.GetString("VpcId"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }