/**
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */

#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/personalize-runtime/model/PredictedAction.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws {
namespace PersonalizeRuntime {
namespace Model {

PredictedAction::PredictedAction(JsonView jsonValue) { *this = jsonValue; }

PredictedAction& PredictedAction::operator=(JsonView jsonValue) {
  if (jsonValue.ValueExists("actionId")) {
    m_actionId = jsonValue.GetString("actionId");
    m_actionIdHasBeenSet = true;
  }
  if (jsonValue.ValueExists("score")) {
    m_score = jsonValue.GetDouble("score");
    m_scoreHasBeenSet = true;
  }
  return *this;
}

JsonValue PredictedAction::Jsonize() const {
  JsonValue payload;

  if (m_actionIdHasBeenSet) {
    payload.WithString("actionId", m_actionId);
  }

  if (m_scoreHasBeenSet) {
    payload.WithDouble("score", m_score);
  }

  return payload;
}

}  // namespace Model
}  // namespace PersonalizeRuntime
}  // namespace Aws
