This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
pxz-hos-client-cpp-module/support/aws-sdk-cpp-master/aws-cpp-sdk-elasticmapreduce/source/model/StepConfig.cpp

91 lines
1.8 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/elasticmapreduce/model/StepConfig.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace EMR
{
namespace Model
{
StepConfig::StepConfig() :
m_nameHasBeenSet(false),
m_actionOnFailure(ActionOnFailure::NOT_SET),
m_actionOnFailureHasBeenSet(false),
m_hadoopJarStepHasBeenSet(false)
{
}
StepConfig::StepConfig(JsonView jsonValue) :
m_nameHasBeenSet(false),
m_actionOnFailure(ActionOnFailure::NOT_SET),
m_actionOnFailureHasBeenSet(false),
m_hadoopJarStepHasBeenSet(false)
{
*this = jsonValue;
}
StepConfig& StepConfig::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Name"))
{
m_name = jsonValue.GetString("Name");
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("ActionOnFailure"))
{
m_actionOnFailure = ActionOnFailureMapper::GetActionOnFailureForName(jsonValue.GetString("ActionOnFailure"));
m_actionOnFailureHasBeenSet = true;
}
if(jsonValue.ValueExists("HadoopJarStep"))
{
m_hadoopJarStep = jsonValue.GetObject("HadoopJarStep");
m_hadoopJarStepHasBeenSet = true;
}
return *this;
}
JsonValue StepConfig::Jsonize() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("Name", m_name);
}
if(m_actionOnFailureHasBeenSet)
{
payload.WithString("ActionOnFailure", ActionOnFailureMapper::GetNameForActionOnFailure(m_actionOnFailure));
}
if(m_hadoopJarStepHasBeenSet)
{
payload.WithObject("HadoopJarStep", m_hadoopJarStep.Jsonize());
}
return payload;
}
} // namespace Model
} // namespace EMR
} // namespace Aws