text: ﻿/**
   * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * SPDX-License-Identifier: Apache-2.0.
   */
  
  #include <aws/rbin/model/CreateRuleRequest.h>
  #include <aws/core/utils/json/JsonSerializer.h>
  
  #include <utility>
  
  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)
  {
  }
  
  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)
    {
     Array<JsonValue> 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)
    {
     Array<JsonValue> 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));
  
    }
  
    return payload.View().WriteReadable();
  }
  
  
  
  
  