/**
 * 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-events/model/Item.h>

#include <utility>

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

namespace Aws {
namespace PersonalizeEvents {
namespace Model {

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

Item& Item::operator=(JsonView jsonValue) {
  if (jsonValue.ValueExists("itemId")) {
    m_itemId = jsonValue.GetString("itemId");
    m_itemIdHasBeenSet = true;
  }
  if (jsonValue.ValueExists("properties")) {
    m_properties = jsonValue.GetString("properties");
    m_propertiesHasBeenSet = true;
  }
  return *this;
}

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

  if (m_itemIdHasBeenSet) {
    payload.WithString("itemId", m_itemId);
  }

  if (m_propertiesHasBeenSet) {
    payload.WithString("properties", m_properties);
  }

  return payload;
}

}  // namespace Model
}  // namespace PersonalizeEvents
}  // namespace Aws
