1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/neptune/model/CreateDBSubnetGroupRequest.h>
7 #include <aws/core/utils/StringUtils.h>
8 #include <aws/core/utils/memory/stl/AWSStringStream.h>
9 
10 using namespace Aws::Neptune::Model;
11 using namespace Aws::Utils;
12 
CreateDBSubnetGroupRequest()13 CreateDBSubnetGroupRequest::CreateDBSubnetGroupRequest() :
14     m_dBSubnetGroupNameHasBeenSet(false),
15     m_dBSubnetGroupDescriptionHasBeenSet(false),
16     m_subnetIdsHasBeenSet(false),
17     m_tagsHasBeenSet(false)
18 {
19 }
20 
SerializePayload() const21 Aws::String CreateDBSubnetGroupRequest::SerializePayload() const
22 {
23   Aws::StringStream ss;
24   ss << "Action=CreateDBSubnetGroup&";
25   if(m_dBSubnetGroupNameHasBeenSet)
26   {
27     ss << "DBSubnetGroupName=" << StringUtils::URLEncode(m_dBSubnetGroupName.c_str()) << "&";
28   }
29 
30   if(m_dBSubnetGroupDescriptionHasBeenSet)
31   {
32     ss << "DBSubnetGroupDescription=" << StringUtils::URLEncode(m_dBSubnetGroupDescription.c_str()) << "&";
33   }
34 
35   if(m_subnetIdsHasBeenSet)
36   {
37     unsigned subnetIdsCount = 1;
38     for(auto& item : m_subnetIds)
39     {
40       ss << "SubnetIds.member." << subnetIdsCount << "="
41           << StringUtils::URLEncode(item.c_str()) << "&";
42       subnetIdsCount++;
43     }
44   }
45 
46   if(m_tagsHasBeenSet)
47   {
48     unsigned tagsCount = 1;
49     for(auto& item : m_tags)
50     {
51       item.OutputToStream(ss, "Tags.member.", tagsCount, "");
52       tagsCount++;
53     }
54   }
55 
56   ss << "Version=2014-10-31";
57   return ss.str();
58 }
59 
60 
DumpBodyToUrl(Aws::Http::URI & uri) const61 void  CreateDBSubnetGroupRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
62 {
63   uri.SetQueryString(SerializePayload());
64 }
65