75 lines
1.3 KiB
C++
75 lines
1.3 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/clouddirectory/model/AttributeNameAndValue.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace CloudDirectory
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
AttributeNameAndValue::AttributeNameAndValue() :
|
|
m_attributeNameHasBeenSet(false),
|
|
m_valueHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
AttributeNameAndValue::AttributeNameAndValue(JsonView jsonValue) :
|
|
m_attributeNameHasBeenSet(false),
|
|
m_valueHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
AttributeNameAndValue& AttributeNameAndValue::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("AttributeName"))
|
|
{
|
|
m_attributeName = jsonValue.GetString("AttributeName");
|
|
|
|
m_attributeNameHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("Value"))
|
|
{
|
|
m_value = jsonValue.GetObject("Value");
|
|
|
|
m_valueHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue AttributeNameAndValue::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_attributeNameHasBeenSet)
|
|
{
|
|
payload.WithString("AttributeName", m_attributeName);
|
|
|
|
}
|
|
|
|
if(m_valueHasBeenSet)
|
|
{
|
|
payload.WithObject("Value", m_value.Jsonize());
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace CloudDirectory
|
|
} // namespace Aws
|