/** * 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::drs::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; UpdateLaunchConfigurationResult::UpdateLaunchConfigurationResult() : m_copyPrivateIp(false), m_copyTags(false), m_launchDisposition(LaunchDisposition::NOT_SET), m_targetInstanceTypeRightSizingMethod(TargetInstanceTypeRightSizingMethod::NOT_SET) { } UpdateLaunchConfigurationResult::UpdateLaunchConfigurationResult(const Aws::AmazonWebServiceResult& result) : m_copyPrivateIp(false), m_copyTags(false), m_launchDisposition(LaunchDisposition::NOT_SET), m_targetInstanceTypeRightSizingMethod(TargetInstanceTypeRightSizingMethod::NOT_SET) { *this = result; } UpdateLaunchConfigurationResult& UpdateLaunchConfigurationResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("copyPrivateIp")) { m_copyPrivateIp = jsonValue.GetBool("copyPrivateIp"); } if(jsonValue.ValueExists("copyTags")) { m_copyTags = jsonValue.GetBool("copyTags"); } if(jsonValue.ValueExists("ec2LaunchTemplateID")) { m_ec2LaunchTemplateID = jsonValue.GetString("ec2LaunchTemplateID"); } if(jsonValue.ValueExists("launchDisposition")) { m_launchDisposition = LaunchDispositionMapper::GetLaunchDispositionForName(jsonValue.GetString("launchDisposition")); } if(jsonValue.ValueExists("licensing")) { m_licensing = jsonValue.GetObject("licensing"); } if(jsonValue.ValueExists("name")) { m_name = jsonValue.GetString("name"); } if(jsonValue.ValueExists("sourceServerID")) { m_sourceServerID = jsonValue.GetString("sourceServerID"); } if(jsonValue.ValueExists("targetInstanceTypeRightSizingMethod")) { m_targetInstanceTypeRightSizingMethod = TargetInstanceTypeRightSizingMethodMapper::GetTargetInstanceTypeRightSizingMethodForName(jsonValue.GetString("targetInstanceTypeRightSizingMethod")); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }