/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::RecycleBin::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateRuleRequest::CreateRuleRequest() : m_retentionPeriodHasBeenSet(false), m_descriptionHasBeenSet(false), m_tagsHasBeenSet(false), m_resourceType(ResourceType::NOT_SET), m_resourceTypeHasBeenSet(false), m_resourceTagsHasBeenSet(false), m_lockConfigurationHasBeenSet(false) { } Aws::String CreateRuleRequest::SerializePayload() const { JsonValue payload; if(m_retentionPeriodHasBeenSet) { payload.WithObject("RetentionPeriod", m_retentionPeriod.Jsonize()); } if(m_descriptionHasBeenSet) { payload.WithString("Description", m_description); } if(m_tagsHasBeenSet) { Aws::Utils::Array tagsJsonList(m_tags.size()); for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex) { tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize()); } payload.WithArray("Tags", std::move(tagsJsonList)); } if(m_resourceTypeHasBeenSet) { payload.WithString("ResourceType", ResourceTypeMapper::GetNameForResourceType(m_resourceType)); } if(m_resourceTagsHasBeenSet) { Aws::Utils::Array resourceTagsJsonList(m_resourceTags.size()); for(unsigned resourceTagsIndex = 0; resourceTagsIndex < resourceTagsJsonList.GetLength(); ++resourceTagsIndex) { resourceTagsJsonList[resourceTagsIndex].AsObject(m_resourceTags[resourceTagsIndex].Jsonize()); } payload.WithArray("ResourceTags", std::move(resourceTagsJsonList)); } if(m_lockConfigurationHasBeenSet) { payload.WithObject("LockConfiguration", m_lockConfiguration.Jsonize()); } return payload.View().WriteReadable(); }