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

78 lines
1.3 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/comprehendmedical/model/Trait.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace ComprehendMedical
{
namespace Model
{
Trait::Trait() :
m_name(AttributeName::NOT_SET),
m_nameHasBeenSet(false),
m_score(0.0),
m_scoreHasBeenSet(false)
{
}
Trait::Trait(JsonView jsonValue) :
m_name(AttributeName::NOT_SET),
m_nameHasBeenSet(false),
m_score(0.0),
m_scoreHasBeenSet(false)
{
*this = jsonValue;
}
Trait& Trait::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Name"))
{
m_name = AttributeNameMapper::GetAttributeNameForName(jsonValue.GetString("Name"));
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("Score"))
{
m_score = jsonValue.GetDouble("Score");
m_scoreHasBeenSet = true;
}
return *this;
}
JsonValue Trait::Jsonize() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("Name", AttributeNameMapper::GetNameForAttributeName(m_name));
}
if(m_scoreHasBeenSet)
{
payload.WithDouble("Score", m_score);
}
return payload;
}
} // namespace Model
} // namespace ComprehendMedical
} // namespace Aws