/** * 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::Greengrass::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; GetDeploymentStatusResult::GetDeploymentStatusResult() : m_deploymentType(DeploymentType::NOT_SET) { } GetDeploymentStatusResult::GetDeploymentStatusResult(const Aws::AmazonWebServiceResult& result) : m_deploymentType(DeploymentType::NOT_SET) { *this = result; } GetDeploymentStatusResult& GetDeploymentStatusResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("DeploymentStatus")) { m_deploymentStatus = jsonValue.GetString("DeploymentStatus"); } if(jsonValue.ValueExists("DeploymentType")) { m_deploymentType = DeploymentTypeMapper::GetDeploymentTypeForName(jsonValue.GetString("DeploymentType")); } if(jsonValue.ValueExists("ErrorDetails")) { Aws::Utils::Array errorDetailsJsonList = jsonValue.GetArray("ErrorDetails"); for(unsigned errorDetailsIndex = 0; errorDetailsIndex < errorDetailsJsonList.GetLength(); ++errorDetailsIndex) { m_errorDetails.push_back(errorDetailsJsonList[errorDetailsIndex].AsObject()); } } if(jsonValue.ValueExists("ErrorMessage")) { m_errorMessage = jsonValue.GetString("ErrorMessage"); } if(jsonValue.ValueExists("UpdatedAt")) { m_updatedAt = jsonValue.GetString("UpdatedAt"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }