/** * 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 Lightsail { namespace Model { MonitoredResourceInfo::MonitoredResourceInfo() : m_arnHasBeenSet(false), m_nameHasBeenSet(false), m_resourceType(ResourceType::NOT_SET), m_resourceTypeHasBeenSet(false) { } MonitoredResourceInfo::MonitoredResourceInfo(JsonView jsonValue) : m_arnHasBeenSet(false), m_nameHasBeenSet(false), m_resourceType(ResourceType::NOT_SET), m_resourceTypeHasBeenSet(false) { *this = jsonValue; } MonitoredResourceInfo& MonitoredResourceInfo::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("arn")) { m_arn = jsonValue.GetString("arn"); m_arnHasBeenSet = true; } if(jsonValue.ValueExists("name")) { m_name = jsonValue.GetString("name"); m_nameHasBeenSet = true; } if(jsonValue.ValueExists("resourceType")) { m_resourceType = ResourceTypeMapper::GetResourceTypeForName(jsonValue.GetString("resourceType")); m_resourceTypeHasBeenSet = true; } return *this; } JsonValue MonitoredResourceInfo::Jsonize() const { JsonValue payload; if(m_arnHasBeenSet) { payload.WithString("arn", m_arn); } if(m_nameHasBeenSet) { payload.WithString("name", m_name); } if(m_resourceTypeHasBeenSet) { payload.WithString("resourceType", ResourceTypeMapper::GetNameForResourceType(m_resourceType)); } return payload; } } // namespace Model } // namespace Lightsail } // namespace Aws