1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #include <aws/cloudformation/model/EstimateTemplateCostRequest.h> 7 #include <aws/core/utils/StringUtils.h> 8 #include <aws/core/utils/memory/stl/AWSStringStream.h> 9 10 using namespace Aws::CloudFormation::Model; 11 using namespace Aws::Utils; 12 EstimateTemplateCostRequest()13EstimateTemplateCostRequest::EstimateTemplateCostRequest() : 14 m_templateBodyHasBeenSet(false), 15 m_templateURLHasBeenSet(false), 16 m_parametersHasBeenSet(false) 17 { 18 } 19 SerializePayload() const20Aws::String EstimateTemplateCostRequest::SerializePayload() const 21 { 22 Aws::StringStream ss; 23 ss << "Action=EstimateTemplateCost&"; 24 if(m_templateBodyHasBeenSet) 25 { 26 ss << "TemplateBody=" << StringUtils::URLEncode(m_templateBody.c_str()) << "&"; 27 } 28 29 if(m_templateURLHasBeenSet) 30 { 31 ss << "TemplateURL=" << StringUtils::URLEncode(m_templateURL.c_str()) << "&"; 32 } 33 34 if(m_parametersHasBeenSet) 35 { 36 unsigned parametersCount = 1; 37 for(auto& item : m_parameters) 38 { 39 item.OutputToStream(ss, "Parameters.member.", parametersCount, ""); 40 parametersCount++; 41 } 42 } 43 44 ss << "Version=2010-05-15"; 45 return ss.str(); 46 } 47 48 DumpBodyToUrl(Aws::Http::URI & uri) const49void EstimateTemplateCostRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const 50 { 51 uri.SetQueryString(SerializePayload()); 52 } 53