/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace CloudWatchEvidently { namespace Model { Event::Event() : m_dataHasBeenSet(false), m_timestampHasBeenSet(false), m_type(EventType::NOT_SET), m_typeHasBeenSet(false) { } Event::Event(JsonView jsonValue) : m_dataHasBeenSet(false), m_timestampHasBeenSet(false), m_type(EventType::NOT_SET), m_typeHasBeenSet(false) { *this = jsonValue; } Event& Event::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("data")) { m_data = jsonValue.GetString("data"); m_dataHasBeenSet = true; } if(jsonValue.ValueExists("timestamp")) { m_timestamp = jsonValue.GetDouble("timestamp"); m_timestampHasBeenSet = true; } if(jsonValue.ValueExists("type")) { m_type = EventTypeMapper::GetEventTypeForName(jsonValue.GetString("type")); m_typeHasBeenSet = true; } return *this; } JsonValue Event::Jsonize() const { JsonValue payload; if(m_dataHasBeenSet) { payload.WithString("data", m_data); } if(m_timestampHasBeenSet) { payload.WithDouble("timestamp", m_timestamp.SecondsWithMSPrecision()); } if(m_typeHasBeenSet) { payload.WithString("type", EventTypeMapper::GetNameForEventType(m_type)); } return payload; } } // namespace Model } // namespace CloudWatchEvidently } // namespace Aws