1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/redshift/model/EnableSnapshotCopyRequest.h>
7 #include <aws/core/utils/StringUtils.h>
8 #include <aws/core/utils/memory/stl/AWSStringStream.h>
9 
10 using namespace Aws::Redshift::Model;
11 using namespace Aws::Utils;
12 
EnableSnapshotCopyRequest()13 EnableSnapshotCopyRequest::EnableSnapshotCopyRequest() :
14     m_clusterIdentifierHasBeenSet(false),
15     m_destinationRegionHasBeenSet(false),
16     m_retentionPeriod(0),
17     m_retentionPeriodHasBeenSet(false),
18     m_snapshotCopyGrantNameHasBeenSet(false),
19     m_manualSnapshotRetentionPeriod(0),
20     m_manualSnapshotRetentionPeriodHasBeenSet(false)
21 {
22 }
23 
SerializePayload() const24 Aws::String EnableSnapshotCopyRequest::SerializePayload() const
25 {
26   Aws::StringStream ss;
27   ss << "Action=EnableSnapshotCopy&";
28   if(m_clusterIdentifierHasBeenSet)
29   {
30     ss << "ClusterIdentifier=" << StringUtils::URLEncode(m_clusterIdentifier.c_str()) << "&";
31   }
32 
33   if(m_destinationRegionHasBeenSet)
34   {
35     ss << "DestinationRegion=" << StringUtils::URLEncode(m_destinationRegion.c_str()) << "&";
36   }
37 
38   if(m_retentionPeriodHasBeenSet)
39   {
40     ss << "RetentionPeriod=" << m_retentionPeriod << "&";
41   }
42 
43   if(m_snapshotCopyGrantNameHasBeenSet)
44   {
45     ss << "SnapshotCopyGrantName=" << StringUtils::URLEncode(m_snapshotCopyGrantName.c_str()) << "&";
46   }
47 
48   if(m_manualSnapshotRetentionPeriodHasBeenSet)
49   {
50     ss << "ManualSnapshotRetentionPeriod=" << m_manualSnapshotRetentionPeriod << "&";
51   }
52 
53   ss << "Version=2012-12-01";
54   return ss.str();
55 }
56 
57 
DumpBodyToUrl(Aws::Http::URI & uri) const58 void  EnableSnapshotCopyRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
59 {
60   uri.SetQueryString(SerializePayload());
61 }
62