/** * 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::SnowDeviceManagement::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; DescribeExecutionResult::DescribeExecutionResult() : m_state(ExecutionState::NOT_SET) { } DescribeExecutionResult::DescribeExecutionResult(const Aws::AmazonWebServiceResult& result) : m_state(ExecutionState::NOT_SET) { *this = result; } DescribeExecutionResult& DescribeExecutionResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("executionId")) { m_executionId = jsonValue.GetString("executionId"); } if(jsonValue.ValueExists("lastUpdatedAt")) { m_lastUpdatedAt = jsonValue.GetDouble("lastUpdatedAt"); } if(jsonValue.ValueExists("managedDeviceId")) { m_managedDeviceId = jsonValue.GetString("managedDeviceId"); } if(jsonValue.ValueExists("startedAt")) { m_startedAt = jsonValue.GetDouble("startedAt"); } if(jsonValue.ValueExists("state")) { m_state = ExecutionStateMapper::GetExecutionStateForName(jsonValue.GetString("state")); } if(jsonValue.ValueExists("taskId")) { m_taskId = jsonValue.GetString("taskId"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }