/** * 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::MainframeModernization::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; GetDeploymentResult::GetDeploymentResult() : m_applicationVersion(0), m_status(DeploymentLifecycle::NOT_SET) { } GetDeploymentResult::GetDeploymentResult(const Aws::AmazonWebServiceResult& result) : m_applicationVersion(0), m_status(DeploymentLifecycle::NOT_SET) { *this = result; } GetDeploymentResult& GetDeploymentResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("applicationId")) { m_applicationId = jsonValue.GetString("applicationId"); } if(jsonValue.ValueExists("applicationVersion")) { m_applicationVersion = jsonValue.GetInteger("applicationVersion"); } if(jsonValue.ValueExists("creationTime")) { m_creationTime = jsonValue.GetDouble("creationTime"); } if(jsonValue.ValueExists("deploymentId")) { m_deploymentId = jsonValue.GetString("deploymentId"); } if(jsonValue.ValueExists("environmentId")) { m_environmentId = jsonValue.GetString("environmentId"); } if(jsonValue.ValueExists("status")) { m_status = DeploymentLifecycleMapper::GetDeploymentLifecycleForName(jsonValue.GetString("status")); } if(jsonValue.ValueExists("statusReason")) { m_statusReason = jsonValue.GetString("statusReason"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }