1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/ce/model/SavingsPlansPurchaseRecommendationSummary.h>
7 #include <aws/core/utils/json/JsonSerializer.h>
8 
9 #include <utility>
10 
11 using namespace Aws::Utils::Json;
12 using namespace Aws::Utils;
13 
14 namespace Aws
15 {
16 namespace CostExplorer
17 {
18 namespace Model
19 {
20 
SavingsPlansPurchaseRecommendationSummary()21 SavingsPlansPurchaseRecommendationSummary::SavingsPlansPurchaseRecommendationSummary() :
22     m_estimatedROIHasBeenSet(false),
23     m_currencyCodeHasBeenSet(false),
24     m_estimatedTotalCostHasBeenSet(false),
25     m_currentOnDemandSpendHasBeenSet(false),
26     m_estimatedSavingsAmountHasBeenSet(false),
27     m_totalRecommendationCountHasBeenSet(false),
28     m_dailyCommitmentToPurchaseHasBeenSet(false),
29     m_hourlyCommitmentToPurchaseHasBeenSet(false),
30     m_estimatedSavingsPercentageHasBeenSet(false),
31     m_estimatedMonthlySavingsAmountHasBeenSet(false),
32     m_estimatedOnDemandCostWithCurrentCommitmentHasBeenSet(false)
33 {
34 }
35 
SavingsPlansPurchaseRecommendationSummary(JsonView jsonValue)36 SavingsPlansPurchaseRecommendationSummary::SavingsPlansPurchaseRecommendationSummary(JsonView jsonValue) :
37     m_estimatedROIHasBeenSet(false),
38     m_currencyCodeHasBeenSet(false),
39     m_estimatedTotalCostHasBeenSet(false),
40     m_currentOnDemandSpendHasBeenSet(false),
41     m_estimatedSavingsAmountHasBeenSet(false),
42     m_totalRecommendationCountHasBeenSet(false),
43     m_dailyCommitmentToPurchaseHasBeenSet(false),
44     m_hourlyCommitmentToPurchaseHasBeenSet(false),
45     m_estimatedSavingsPercentageHasBeenSet(false),
46     m_estimatedMonthlySavingsAmountHasBeenSet(false),
47     m_estimatedOnDemandCostWithCurrentCommitmentHasBeenSet(false)
48 {
49   *this = jsonValue;
50 }
51 
operator =(JsonView jsonValue)52 SavingsPlansPurchaseRecommendationSummary& SavingsPlansPurchaseRecommendationSummary::operator =(JsonView jsonValue)
53 {
54   if(jsonValue.ValueExists("EstimatedROI"))
55   {
56     m_estimatedROI = jsonValue.GetString("EstimatedROI");
57 
58     m_estimatedROIHasBeenSet = true;
59   }
60 
61   if(jsonValue.ValueExists("CurrencyCode"))
62   {
63     m_currencyCode = jsonValue.GetString("CurrencyCode");
64 
65     m_currencyCodeHasBeenSet = true;
66   }
67 
68   if(jsonValue.ValueExists("EstimatedTotalCost"))
69   {
70     m_estimatedTotalCost = jsonValue.GetString("EstimatedTotalCost");
71 
72     m_estimatedTotalCostHasBeenSet = true;
73   }
74 
75   if(jsonValue.ValueExists("CurrentOnDemandSpend"))
76   {
77     m_currentOnDemandSpend = jsonValue.GetString("CurrentOnDemandSpend");
78 
79     m_currentOnDemandSpendHasBeenSet = true;
80   }
81 
82   if(jsonValue.ValueExists("EstimatedSavingsAmount"))
83   {
84     m_estimatedSavingsAmount = jsonValue.GetString("EstimatedSavingsAmount");
85 
86     m_estimatedSavingsAmountHasBeenSet = true;
87   }
88 
89   if(jsonValue.ValueExists("TotalRecommendationCount"))
90   {
91     m_totalRecommendationCount = jsonValue.GetString("TotalRecommendationCount");
92 
93     m_totalRecommendationCountHasBeenSet = true;
94   }
95 
96   if(jsonValue.ValueExists("DailyCommitmentToPurchase"))
97   {
98     m_dailyCommitmentToPurchase = jsonValue.GetString("DailyCommitmentToPurchase");
99 
100     m_dailyCommitmentToPurchaseHasBeenSet = true;
101   }
102 
103   if(jsonValue.ValueExists("HourlyCommitmentToPurchase"))
104   {
105     m_hourlyCommitmentToPurchase = jsonValue.GetString("HourlyCommitmentToPurchase");
106 
107     m_hourlyCommitmentToPurchaseHasBeenSet = true;
108   }
109 
110   if(jsonValue.ValueExists("EstimatedSavingsPercentage"))
111   {
112     m_estimatedSavingsPercentage = jsonValue.GetString("EstimatedSavingsPercentage");
113 
114     m_estimatedSavingsPercentageHasBeenSet = true;
115   }
116 
117   if(jsonValue.ValueExists("EstimatedMonthlySavingsAmount"))
118   {
119     m_estimatedMonthlySavingsAmount = jsonValue.GetString("EstimatedMonthlySavingsAmount");
120 
121     m_estimatedMonthlySavingsAmountHasBeenSet = true;
122   }
123 
124   if(jsonValue.ValueExists("EstimatedOnDemandCostWithCurrentCommitment"))
125   {
126     m_estimatedOnDemandCostWithCurrentCommitment = jsonValue.GetString("EstimatedOnDemandCostWithCurrentCommitment");
127 
128     m_estimatedOnDemandCostWithCurrentCommitmentHasBeenSet = true;
129   }
130 
131   return *this;
132 }
133 
Jsonize() const134 JsonValue SavingsPlansPurchaseRecommendationSummary::Jsonize() const
135 {
136   JsonValue payload;
137 
138   if(m_estimatedROIHasBeenSet)
139   {
140    payload.WithString("EstimatedROI", m_estimatedROI);
141 
142   }
143 
144   if(m_currencyCodeHasBeenSet)
145   {
146    payload.WithString("CurrencyCode", m_currencyCode);
147 
148   }
149 
150   if(m_estimatedTotalCostHasBeenSet)
151   {
152    payload.WithString("EstimatedTotalCost", m_estimatedTotalCost);
153 
154   }
155 
156   if(m_currentOnDemandSpendHasBeenSet)
157   {
158    payload.WithString("CurrentOnDemandSpend", m_currentOnDemandSpend);
159 
160   }
161 
162   if(m_estimatedSavingsAmountHasBeenSet)
163   {
164    payload.WithString("EstimatedSavingsAmount", m_estimatedSavingsAmount);
165 
166   }
167 
168   if(m_totalRecommendationCountHasBeenSet)
169   {
170    payload.WithString("TotalRecommendationCount", m_totalRecommendationCount);
171 
172   }
173 
174   if(m_dailyCommitmentToPurchaseHasBeenSet)
175   {
176    payload.WithString("DailyCommitmentToPurchase", m_dailyCommitmentToPurchase);
177 
178   }
179 
180   if(m_hourlyCommitmentToPurchaseHasBeenSet)
181   {
182    payload.WithString("HourlyCommitmentToPurchase", m_hourlyCommitmentToPurchase);
183 
184   }
185 
186   if(m_estimatedSavingsPercentageHasBeenSet)
187   {
188    payload.WithString("EstimatedSavingsPercentage", m_estimatedSavingsPercentage);
189 
190   }
191 
192   if(m_estimatedMonthlySavingsAmountHasBeenSet)
193   {
194    payload.WithString("EstimatedMonthlySavingsAmount", m_estimatedMonthlySavingsAmount);
195 
196   }
197 
198   if(m_estimatedOnDemandCostWithCurrentCommitmentHasBeenSet)
199   {
200    payload.WithString("EstimatedOnDemandCostWithCurrentCommitment", m_estimatedOnDemandCostWithCurrentCommitment);
201 
202   }
203 
204   return payload;
205 }
206 
207 } // namespace Model
208 } // namespace CostExplorer
209 } // namespace Aws
210