104 lines
2.1 KiB
C++
104 lines
2.1 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/sagemaker/model/SecondaryStatusTransition.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace SageMaker
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
SecondaryStatusTransition::SecondaryStatusTransition() :
|
|
m_status(SecondaryStatus::NOT_SET),
|
|
m_statusHasBeenSet(false),
|
|
m_startTimeHasBeenSet(false),
|
|
m_endTimeHasBeenSet(false),
|
|
m_statusMessageHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
SecondaryStatusTransition::SecondaryStatusTransition(JsonView jsonValue) :
|
|
m_status(SecondaryStatus::NOT_SET),
|
|
m_statusHasBeenSet(false),
|
|
m_startTimeHasBeenSet(false),
|
|
m_endTimeHasBeenSet(false),
|
|
m_statusMessageHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
SecondaryStatusTransition& SecondaryStatusTransition::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("Status"))
|
|
{
|
|
m_status = SecondaryStatusMapper::GetSecondaryStatusForName(jsonValue.GetString("Status"));
|
|
|
|
m_statusHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("StartTime"))
|
|
{
|
|
m_startTime = jsonValue.GetDouble("StartTime");
|
|
|
|
m_startTimeHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("EndTime"))
|
|
{
|
|
m_endTime = jsonValue.GetDouble("EndTime");
|
|
|
|
m_endTimeHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("StatusMessage"))
|
|
{
|
|
m_statusMessage = jsonValue.GetString("StatusMessage");
|
|
|
|
m_statusMessageHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue SecondaryStatusTransition::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_statusHasBeenSet)
|
|
{
|
|
payload.WithString("Status", SecondaryStatusMapper::GetNameForSecondaryStatus(m_status));
|
|
}
|
|
|
|
if(m_startTimeHasBeenSet)
|
|
{
|
|
payload.WithDouble("StartTime", m_startTime.SecondsWithMSPrecision());
|
|
}
|
|
|
|
if(m_endTimeHasBeenSet)
|
|
{
|
|
payload.WithDouble("EndTime", m_endTime.SecondsWithMSPrecision());
|
|
}
|
|
|
|
if(m_statusMessageHasBeenSet)
|
|
{
|
|
payload.WithString("StatusMessage", m_statusMessage);
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace SageMaker
|
|
} // namespace Aws
|