1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/location/model/CreateRouteCalculatorRequest.h>
7 #include <aws/core/utils/json/JsonSerializer.h>
8 
9 #include <utility>
10 
11 using namespace Aws::LocationService::Model;
12 using namespace Aws::Utils::Json;
13 using namespace Aws::Utils;
14 
CreateRouteCalculatorRequest()15 CreateRouteCalculatorRequest::CreateRouteCalculatorRequest() :
16     m_calculatorNameHasBeenSet(false),
17     m_dataSourceHasBeenSet(false),
18     m_descriptionHasBeenSet(false),
19     m_pricingPlan(PricingPlan::NOT_SET),
20     m_pricingPlanHasBeenSet(false),
21     m_tagsHasBeenSet(false)
22 {
23 }
24 
SerializePayload() const25 Aws::String CreateRouteCalculatorRequest::SerializePayload() const
26 {
27   JsonValue payload;
28 
29   if(m_calculatorNameHasBeenSet)
30   {
31    payload.WithString("CalculatorName", m_calculatorName);
32 
33   }
34 
35   if(m_dataSourceHasBeenSet)
36   {
37    payload.WithString("DataSource", m_dataSource);
38 
39   }
40 
41   if(m_descriptionHasBeenSet)
42   {
43    payload.WithString("Description", m_description);
44 
45   }
46 
47   if(m_pricingPlanHasBeenSet)
48   {
49    payload.WithString("PricingPlan", PricingPlanMapper::GetNameForPricingPlan(m_pricingPlan));
50   }
51 
52   if(m_tagsHasBeenSet)
53   {
54    JsonValue tagsJsonMap;
55    for(auto& tagsItem : m_tags)
56    {
57      tagsJsonMap.WithString(tagsItem.first, tagsItem.second);
58    }
59    payload.WithObject("Tags", std::move(tagsJsonMap));
60 
61   }
62 
63   return payload.View().WriteReadable();
64 }
65 
66 
67 
68 
69