70 lines
1.8 KiB
C++
70 lines
1.8 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/greengrass/model/GetDeploymentStatusResult.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
#include <aws/core/AmazonWebServiceResult.h>
|
|
#include <aws/core/utils/StringUtils.h>
|
|
#include <aws/core/utils/UnreferencedParam.h>
|
|
|
|
#include <utility>
|
|
|
|
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<JsonValue>& result) :
|
|
m_deploymentType(DeploymentType::NOT_SET)
|
|
{
|
|
*this = result;
|
|
}
|
|
|
|
GetDeploymentStatusResult& GetDeploymentStatusResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& 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"))
|
|
{
|
|
Array<JsonView> 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");
|
|
|
|
}
|
|
|
|
|
|
|
|
return *this;
|
|
}
|