182 lines
3.3 KiB
C++
182 lines
3.3 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/ssm/model/Parameter.h>
|
|||
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|||
|
|
|
|||
|
|
#include <utility>
|
|||
|
|
|
|||
|
|
using namespace Aws::Utils::Json;
|
|||
|
|
using namespace Aws::Utils;
|
|||
|
|
|
|||
|
|
namespace Aws
|
|||
|
|
{
|
|||
|
|
namespace SSM
|
|||
|
|
{
|
|||
|
|
namespace Model
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
Parameter::Parameter() :
|
|||
|
|
m_nameHasBeenSet(false),
|
|||
|
|
m_type(ParameterType::NOT_SET),
|
|||
|
|
m_typeHasBeenSet(false),
|
|||
|
|
m_valueHasBeenSet(false),
|
|||
|
|
m_version(0),
|
|||
|
|
m_versionHasBeenSet(false),
|
|||
|
|
m_selectorHasBeenSet(false),
|
|||
|
|
m_sourceResultHasBeenSet(false),
|
|||
|
|
m_lastModifiedDateHasBeenSet(false),
|
|||
|
|
m_aRNHasBeenSet(false),
|
|||
|
|
m_dataTypeHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Parameter::Parameter(JsonView jsonValue) :
|
|||
|
|
m_nameHasBeenSet(false),
|
|||
|
|
m_type(ParameterType::NOT_SET),
|
|||
|
|
m_typeHasBeenSet(false),
|
|||
|
|
m_valueHasBeenSet(false),
|
|||
|
|
m_version(0),
|
|||
|
|
m_versionHasBeenSet(false),
|
|||
|
|
m_selectorHasBeenSet(false),
|
|||
|
|
m_sourceResultHasBeenSet(false),
|
|||
|
|
m_lastModifiedDateHasBeenSet(false),
|
|||
|
|
m_aRNHasBeenSet(false),
|
|||
|
|
m_dataTypeHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
*this = jsonValue;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Parameter& Parameter::operator =(JsonView jsonValue)
|
|||
|
|
{
|
|||
|
|
if(jsonValue.ValueExists("Name"))
|
|||
|
|
{
|
|||
|
|
m_name = jsonValue.GetString("Name");
|
|||
|
|
|
|||
|
|
m_nameHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("Type"))
|
|||
|
|
{
|
|||
|
|
m_type = ParameterTypeMapper::GetParameterTypeForName(jsonValue.GetString("Type"));
|
|||
|
|
|
|||
|
|
m_typeHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("Value"))
|
|||
|
|
{
|
|||
|
|
m_value = jsonValue.GetString("Value");
|
|||
|
|
|
|||
|
|
m_valueHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("Version"))
|
|||
|
|
{
|
|||
|
|
m_version = jsonValue.GetInt64("Version");
|
|||
|
|
|
|||
|
|
m_versionHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("Selector"))
|
|||
|
|
{
|
|||
|
|
m_selector = jsonValue.GetString("Selector");
|
|||
|
|
|
|||
|
|
m_selectorHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("SourceResult"))
|
|||
|
|
{
|
|||
|
|
m_sourceResult = jsonValue.GetString("SourceResult");
|
|||
|
|
|
|||
|
|
m_sourceResultHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("LastModifiedDate"))
|
|||
|
|
{
|
|||
|
|
m_lastModifiedDate = jsonValue.GetDouble("LastModifiedDate");
|
|||
|
|
|
|||
|
|
m_lastModifiedDateHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("ARN"))
|
|||
|
|
{
|
|||
|
|
m_aRN = jsonValue.GetString("ARN");
|
|||
|
|
|
|||
|
|
m_aRNHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("DataType"))
|
|||
|
|
{
|
|||
|
|
m_dataType = jsonValue.GetString("DataType");
|
|||
|
|
|
|||
|
|
m_dataTypeHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return *this;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
JsonValue Parameter::Jsonize() const
|
|||
|
|
{
|
|||
|
|
JsonValue payload;
|
|||
|
|
|
|||
|
|
if(m_nameHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("Name", m_name);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_typeHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("Type", ParameterTypeMapper::GetNameForParameterType(m_type));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_valueHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("Value", m_value);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_versionHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithInt64("Version", m_version);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_selectorHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("Selector", m_selector);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_sourceResultHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("SourceResult", m_sourceResult);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_lastModifiedDateHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithDouble("LastModifiedDate", m_lastModifiedDate.SecondsWithMSPrecision());
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_aRNHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("ARN", m_aRN);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_dataTypeHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("DataType", m_dataType);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return payload;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} // namespace Model
|
|||
|
|
} // namespace SSM
|
|||
|
|
} // namespace Aws
|