/** * 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 CloudTrail { namespace Model { Destination::Destination() : m_type(DestinationType::NOT_SET), m_typeHasBeenSet(false), m_locationHasBeenSet(false) { } Destination::Destination(JsonView jsonValue) : m_type(DestinationType::NOT_SET), m_typeHasBeenSet(false), m_locationHasBeenSet(false) { *this = jsonValue; } Destination& Destination::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Type")) { m_type = DestinationTypeMapper::GetDestinationTypeForName(jsonValue.GetString("Type")); m_typeHasBeenSet = true; } if(jsonValue.ValueExists("Location")) { m_location = jsonValue.GetString("Location"); m_locationHasBeenSet = true; } return *this; } JsonValue Destination::Jsonize() const { JsonValue payload; if(m_typeHasBeenSet) { payload.WithString("Type", DestinationTypeMapper::GetNameForDestinationType(m_type)); } if(m_locationHasBeenSet) { payload.WithString("Location", m_location); } return payload; } } // namespace Model } // namespace CloudTrail } // namespace Aws