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/ModifyEventSubscriptionRequest.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 
ModifyEventSubscriptionRequest()13 ModifyEventSubscriptionRequest::ModifyEventSubscriptionRequest() :
14     m_subscriptionNameHasBeenSet(false),
15     m_snsTopicArnHasBeenSet(false),
16     m_sourceTypeHasBeenSet(false),
17     m_eventCategoriesHasBeenSet(false),
18     m_enabled(false),
19     m_enabledHasBeenSet(false)
20 {
21 }
22 
SerializePayload() const23 Aws::String ModifyEventSubscriptionRequest::SerializePayload() const
24 {
25   Aws::StringStream ss;
26   ss << "Action=ModifyEventSubscription&";
27   if(m_subscriptionNameHasBeenSet)
28   {
29     ss << "SubscriptionName=" << StringUtils::URLEncode(m_subscriptionName.c_str()) << "&";
30   }
31 
32   if(m_snsTopicArnHasBeenSet)
33   {
34     ss << "SnsTopicArn=" << StringUtils::URLEncode(m_snsTopicArn.c_str()) << "&";
35   }
36 
37   if(m_sourceTypeHasBeenSet)
38   {
39     ss << "SourceType=" << StringUtils::URLEncode(m_sourceType.c_str()) << "&";
40   }
41 
42   if(m_eventCategoriesHasBeenSet)
43   {
44     unsigned eventCategoriesCount = 1;
45     for(auto& item : m_eventCategories)
46     {
47       ss << "EventCategories.member." << eventCategoriesCount << "="
48           << StringUtils::URLEncode(item.c_str()) << "&";
49       eventCategoriesCount++;
50     }
51   }
52 
53   if(m_enabledHasBeenSet)
54   {
55     ss << "Enabled=" << std::boolalpha << m_enabled << "&";
56   }
57 
58   ss << "Version=2014-10-31";
59   return ss.str();
60 }
61 
62 
DumpBodyToUrl(Aws::Http::URI & uri) const63 void  ModifyEventSubscriptionRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
64 {
65   uri.SetQueryString(SerializePayload());
66 }
67