206 lines
4.9 KiB
C++
206 lines
4.9 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/codepipeline/model/ActionDeclaration.h>
|
|||
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|||
|
|
|
|||
|
|
#include <utility>
|
|||
|
|
|
|||
|
|
using namespace Aws::Utils::Json;
|
|||
|
|
using namespace Aws::Utils;
|
|||
|
|
|
|||
|
|
namespace Aws
|
|||
|
|
{
|
|||
|
|
namespace CodePipeline
|
|||
|
|
{
|
|||
|
|
namespace Model
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
ActionDeclaration::ActionDeclaration() :
|
|||
|
|
m_nameHasBeenSet(false),
|
|||
|
|
m_actionTypeIdHasBeenSet(false),
|
|||
|
|
m_runOrder(0),
|
|||
|
|
m_runOrderHasBeenSet(false),
|
|||
|
|
m_configurationHasBeenSet(false),
|
|||
|
|
m_outputArtifactsHasBeenSet(false),
|
|||
|
|
m_inputArtifactsHasBeenSet(false),
|
|||
|
|
m_roleArnHasBeenSet(false),
|
|||
|
|
m_regionHasBeenSet(false),
|
|||
|
|
m_namespaceHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
ActionDeclaration::ActionDeclaration(JsonView jsonValue) :
|
|||
|
|
m_nameHasBeenSet(false),
|
|||
|
|
m_actionTypeIdHasBeenSet(false),
|
|||
|
|
m_runOrder(0),
|
|||
|
|
m_runOrderHasBeenSet(false),
|
|||
|
|
m_configurationHasBeenSet(false),
|
|||
|
|
m_outputArtifactsHasBeenSet(false),
|
|||
|
|
m_inputArtifactsHasBeenSet(false),
|
|||
|
|
m_roleArnHasBeenSet(false),
|
|||
|
|
m_regionHasBeenSet(false),
|
|||
|
|
m_namespaceHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
*this = jsonValue;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
ActionDeclaration& ActionDeclaration::operator =(JsonView jsonValue)
|
|||
|
|
{
|
|||
|
|
if(jsonValue.ValueExists("name"))
|
|||
|
|
{
|
|||
|
|
m_name = jsonValue.GetString("name");
|
|||
|
|
|
|||
|
|
m_nameHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("actionTypeId"))
|
|||
|
|
{
|
|||
|
|
m_actionTypeId = jsonValue.GetObject("actionTypeId");
|
|||
|
|
|
|||
|
|
m_actionTypeIdHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("runOrder"))
|
|||
|
|
{
|
|||
|
|
m_runOrder = jsonValue.GetInteger("runOrder");
|
|||
|
|
|
|||
|
|
m_runOrderHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("configuration"))
|
|||
|
|
{
|
|||
|
|
Aws::Map<Aws::String, JsonView> configurationJsonMap = jsonValue.GetObject("configuration").GetAllObjects();
|
|||
|
|
for(auto& configurationItem : configurationJsonMap)
|
|||
|
|
{
|
|||
|
|
m_configuration[configurationItem.first] = configurationItem.second.AsString();
|
|||
|
|
}
|
|||
|
|
m_configurationHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("outputArtifacts"))
|
|||
|
|
{
|
|||
|
|
Array<JsonView> outputArtifactsJsonList = jsonValue.GetArray("outputArtifacts");
|
|||
|
|
for(unsigned outputArtifactsIndex = 0; outputArtifactsIndex < outputArtifactsJsonList.GetLength(); ++outputArtifactsIndex)
|
|||
|
|
{
|
|||
|
|
m_outputArtifacts.push_back(outputArtifactsJsonList[outputArtifactsIndex].AsObject());
|
|||
|
|
}
|
|||
|
|
m_outputArtifactsHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("inputArtifacts"))
|
|||
|
|
{
|
|||
|
|
Array<JsonView> inputArtifactsJsonList = jsonValue.GetArray("inputArtifacts");
|
|||
|
|
for(unsigned inputArtifactsIndex = 0; inputArtifactsIndex < inputArtifactsJsonList.GetLength(); ++inputArtifactsIndex)
|
|||
|
|
{
|
|||
|
|
m_inputArtifacts.push_back(inputArtifactsJsonList[inputArtifactsIndex].AsObject());
|
|||
|
|
}
|
|||
|
|
m_inputArtifactsHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("roleArn"))
|
|||
|
|
{
|
|||
|
|
m_roleArn = jsonValue.GetString("roleArn");
|
|||
|
|
|
|||
|
|
m_roleArnHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("region"))
|
|||
|
|
{
|
|||
|
|
m_region = jsonValue.GetString("region");
|
|||
|
|
|
|||
|
|
m_regionHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("namespace"))
|
|||
|
|
{
|
|||
|
|
m_namespace = jsonValue.GetString("namespace");
|
|||
|
|
|
|||
|
|
m_namespaceHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return *this;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
JsonValue ActionDeclaration::Jsonize() const
|
|||
|
|
{
|
|||
|
|
JsonValue payload;
|
|||
|
|
|
|||
|
|
if(m_nameHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("name", m_name);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_actionTypeIdHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithObject("actionTypeId", m_actionTypeId.Jsonize());
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_runOrderHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithInteger("runOrder", m_runOrder);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_configurationHasBeenSet)
|
|||
|
|
{
|
|||
|
|
JsonValue configurationJsonMap;
|
|||
|
|
for(auto& configurationItem : m_configuration)
|
|||
|
|
{
|
|||
|
|
configurationJsonMap.WithString(configurationItem.first, configurationItem.second);
|
|||
|
|
}
|
|||
|
|
payload.WithObject("configuration", std::move(configurationJsonMap));
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_outputArtifactsHasBeenSet)
|
|||
|
|
{
|
|||
|
|
Array<JsonValue> outputArtifactsJsonList(m_outputArtifacts.size());
|
|||
|
|
for(unsigned outputArtifactsIndex = 0; outputArtifactsIndex < outputArtifactsJsonList.GetLength(); ++outputArtifactsIndex)
|
|||
|
|
{
|
|||
|
|
outputArtifactsJsonList[outputArtifactsIndex].AsObject(m_outputArtifacts[outputArtifactsIndex].Jsonize());
|
|||
|
|
}
|
|||
|
|
payload.WithArray("outputArtifacts", std::move(outputArtifactsJsonList));
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_inputArtifactsHasBeenSet)
|
|||
|
|
{
|
|||
|
|
Array<JsonValue> inputArtifactsJsonList(m_inputArtifacts.size());
|
|||
|
|
for(unsigned inputArtifactsIndex = 0; inputArtifactsIndex < inputArtifactsJsonList.GetLength(); ++inputArtifactsIndex)
|
|||
|
|
{
|
|||
|
|
inputArtifactsJsonList[inputArtifactsIndex].AsObject(m_inputArtifacts[inputArtifactsIndex].Jsonize());
|
|||
|
|
}
|
|||
|
|
payload.WithArray("inputArtifacts", std::move(inputArtifactsJsonList));
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_roleArnHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("roleArn", m_roleArn);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_regionHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("region", m_region);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_namespaceHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("namespace", m_namespace);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return payload;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} // namespace Model
|
|||
|
|
} // namespace CodePipeline
|
|||
|
|
} // namespace Aws
|