1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #pragma once
7 #include <aws/budgets/Budgets_EXPORTS.h>
8 #include <aws/budgets/model/NotificationType.h>
9 #include <aws/budgets/model/ComparisonOperator.h>
10 #include <aws/budgets/model/ThresholdType.h>
11 #include <aws/budgets/model/NotificationState.h>
12 #include <utility>
13 
14 namespace Aws
15 {
16 namespace Utils
17 {
18 namespace Json
19 {
20   class JsonValue;
21   class JsonView;
22 } // namespace Json
23 } // namespace Utils
24 namespace Budgets
25 {
26 namespace Model
27 {
28 
29   /**
30    * <p>A notification that is associated with a budget. A budget can have up to ten
31    * notifications. </p> <p>Each notification must have at least one subscriber. A
32    * notification can have one SNS subscriber and up to 10 email subscribers, for a
33    * total of 11 subscribers.</p> <p>For example, if you have a budget for 200
34    * dollars and you want to be notified when you go over 160 dollars, create a
35    * notification with the following parameters:</p> <ul> <li> <p>A notificationType
36    * of <code>ACTUAL</code> </p> </li> <li> <p>A <code>thresholdType</code> of
37    * <code>PERCENTAGE</code> </p> </li> <li> <p>A <code>comparisonOperator</code> of
38    * <code>GREATER_THAN</code> </p> </li> <li> <p>A notification
39    * <code>threshold</code> of <code>80</code> </p> </li> </ul><p><h3>See Also:</h3>
40    * <a
41    * href="http://docs.aws.amazon.com/goto/WebAPI/budgets-2016-10-20/Notification">AWS
42    * API Reference</a></p>
43    */
44   class AWS_BUDGETS_API Notification
45   {
46   public:
47     Notification();
48     Notification(Aws::Utils::Json::JsonView jsonValue);
49     Notification& operator=(Aws::Utils::Json::JsonView jsonValue);
50     Aws::Utils::Json::JsonValue Jsonize() const;
51 
52 
53     /**
54      * <p>Whether the notification is for how much you have spent (<code>ACTUAL</code>)
55      * or for how much you're forecasted to spend (<code>FORECASTED</code>).</p>
56      */
GetNotificationType()57     inline const NotificationType& GetNotificationType() const{ return m_notificationType; }
58 
59     /**
60      * <p>Whether the notification is for how much you have spent (<code>ACTUAL</code>)
61      * or for how much you're forecasted to spend (<code>FORECASTED</code>).</p>
62      */
NotificationTypeHasBeenSet()63     inline bool NotificationTypeHasBeenSet() const { return m_notificationTypeHasBeenSet; }
64 
65     /**
66      * <p>Whether the notification is for how much you have spent (<code>ACTUAL</code>)
67      * or for how much you're forecasted to spend (<code>FORECASTED</code>).</p>
68      */
SetNotificationType(const NotificationType & value)69     inline void SetNotificationType(const NotificationType& value) { m_notificationTypeHasBeenSet = true; m_notificationType = value; }
70 
71     /**
72      * <p>Whether the notification is for how much you have spent (<code>ACTUAL</code>)
73      * or for how much you're forecasted to spend (<code>FORECASTED</code>).</p>
74      */
SetNotificationType(NotificationType && value)75     inline void SetNotificationType(NotificationType&& value) { m_notificationTypeHasBeenSet = true; m_notificationType = std::move(value); }
76 
77     /**
78      * <p>Whether the notification is for how much you have spent (<code>ACTUAL</code>)
79      * or for how much you're forecasted to spend (<code>FORECASTED</code>).</p>
80      */
WithNotificationType(const NotificationType & value)81     inline Notification& WithNotificationType(const NotificationType& value) { SetNotificationType(value); return *this;}
82 
83     /**
84      * <p>Whether the notification is for how much you have spent (<code>ACTUAL</code>)
85      * or for how much you're forecasted to spend (<code>FORECASTED</code>).</p>
86      */
WithNotificationType(NotificationType && value)87     inline Notification& WithNotificationType(NotificationType&& value) { SetNotificationType(std::move(value)); return *this;}
88 
89 
90     /**
91      * <p>The comparison that is used for this notification.</p>
92      */
GetComparisonOperator()93     inline const ComparisonOperator& GetComparisonOperator() const{ return m_comparisonOperator; }
94 
95     /**
96      * <p>The comparison that is used for this notification.</p>
97      */
ComparisonOperatorHasBeenSet()98     inline bool ComparisonOperatorHasBeenSet() const { return m_comparisonOperatorHasBeenSet; }
99 
100     /**
101      * <p>The comparison that is used for this notification.</p>
102      */
SetComparisonOperator(const ComparisonOperator & value)103     inline void SetComparisonOperator(const ComparisonOperator& value) { m_comparisonOperatorHasBeenSet = true; m_comparisonOperator = value; }
104 
105     /**
106      * <p>The comparison that is used for this notification.</p>
107      */
SetComparisonOperator(ComparisonOperator && value)108     inline void SetComparisonOperator(ComparisonOperator&& value) { m_comparisonOperatorHasBeenSet = true; m_comparisonOperator = std::move(value); }
109 
110     /**
111      * <p>The comparison that is used for this notification.</p>
112      */
WithComparisonOperator(const ComparisonOperator & value)113     inline Notification& WithComparisonOperator(const ComparisonOperator& value) { SetComparisonOperator(value); return *this;}
114 
115     /**
116      * <p>The comparison that is used for this notification.</p>
117      */
WithComparisonOperator(ComparisonOperator && value)118     inline Notification& WithComparisonOperator(ComparisonOperator&& value) { SetComparisonOperator(std::move(value)); return *this;}
119 
120 
121     /**
122      * <p>The threshold that is associated with a notification. Thresholds are always a
123      * percentage, and many customers find value being alerted between 50% - 200% of
124      * the budgeted amount. The maximum limit for your threshold is 1,000,000% above
125      * the budgeted amount.</p>
126      */
GetThreshold()127     inline double GetThreshold() const{ return m_threshold; }
128 
129     /**
130      * <p>The threshold that is associated with a notification. Thresholds are always a
131      * percentage, and many customers find value being alerted between 50% - 200% of
132      * the budgeted amount. The maximum limit for your threshold is 1,000,000% above
133      * the budgeted amount.</p>
134      */
ThresholdHasBeenSet()135     inline bool ThresholdHasBeenSet() const { return m_thresholdHasBeenSet; }
136 
137     /**
138      * <p>The threshold that is associated with a notification. Thresholds are always a
139      * percentage, and many customers find value being alerted between 50% - 200% of
140      * the budgeted amount. The maximum limit for your threshold is 1,000,000% above
141      * the budgeted amount.</p>
142      */
SetThreshold(double value)143     inline void SetThreshold(double value) { m_thresholdHasBeenSet = true; m_threshold = value; }
144 
145     /**
146      * <p>The threshold that is associated with a notification. Thresholds are always a
147      * percentage, and many customers find value being alerted between 50% - 200% of
148      * the budgeted amount. The maximum limit for your threshold is 1,000,000% above
149      * the budgeted amount.</p>
150      */
WithThreshold(double value)151     inline Notification& WithThreshold(double value) { SetThreshold(value); return *this;}
152 
153 
154     /**
155      * <p>The type of threshold for a notification. For <code>ABSOLUTE_VALUE</code>
156      * thresholds, AWS notifies you when you go over or are forecasted to go over your
157      * total cost threshold. For <code>PERCENTAGE</code> thresholds, AWS notifies you
158      * when you go over or are forecasted to go over a certain percentage of your
159      * forecasted spend. For example, if you have a budget for 200 dollars and you have
160      * a <code>PERCENTAGE</code> threshold of 80%, AWS notifies you when you go over
161      * 160 dollars.</p>
162      */
GetThresholdType()163     inline const ThresholdType& GetThresholdType() const{ return m_thresholdType; }
164 
165     /**
166      * <p>The type of threshold for a notification. For <code>ABSOLUTE_VALUE</code>
167      * thresholds, AWS notifies you when you go over or are forecasted to go over your
168      * total cost threshold. For <code>PERCENTAGE</code> thresholds, AWS notifies you
169      * when you go over or are forecasted to go over a certain percentage of your
170      * forecasted spend. For example, if you have a budget for 200 dollars and you have
171      * a <code>PERCENTAGE</code> threshold of 80%, AWS notifies you when you go over
172      * 160 dollars.</p>
173      */
ThresholdTypeHasBeenSet()174     inline bool ThresholdTypeHasBeenSet() const { return m_thresholdTypeHasBeenSet; }
175 
176     /**
177      * <p>The type of threshold for a notification. For <code>ABSOLUTE_VALUE</code>
178      * thresholds, AWS notifies you when you go over or are forecasted to go over your
179      * total cost threshold. For <code>PERCENTAGE</code> thresholds, AWS notifies you
180      * when you go over or are forecasted to go over a certain percentage of your
181      * forecasted spend. For example, if you have a budget for 200 dollars and you have
182      * a <code>PERCENTAGE</code> threshold of 80%, AWS notifies you when you go over
183      * 160 dollars.</p>
184      */
SetThresholdType(const ThresholdType & value)185     inline void SetThresholdType(const ThresholdType& value) { m_thresholdTypeHasBeenSet = true; m_thresholdType = value; }
186 
187     /**
188      * <p>The type of threshold for a notification. For <code>ABSOLUTE_VALUE</code>
189      * thresholds, AWS notifies you when you go over or are forecasted to go over your
190      * total cost threshold. For <code>PERCENTAGE</code> thresholds, AWS notifies you
191      * when you go over or are forecasted to go over a certain percentage of your
192      * forecasted spend. For example, if you have a budget for 200 dollars and you have
193      * a <code>PERCENTAGE</code> threshold of 80%, AWS notifies you when you go over
194      * 160 dollars.</p>
195      */
SetThresholdType(ThresholdType && value)196     inline void SetThresholdType(ThresholdType&& value) { m_thresholdTypeHasBeenSet = true; m_thresholdType = std::move(value); }
197 
198     /**
199      * <p>The type of threshold for a notification. For <code>ABSOLUTE_VALUE</code>
200      * thresholds, AWS notifies you when you go over or are forecasted to go over your
201      * total cost threshold. For <code>PERCENTAGE</code> thresholds, AWS notifies you
202      * when you go over or are forecasted to go over a certain percentage of your
203      * forecasted spend. For example, if you have a budget for 200 dollars and you have
204      * a <code>PERCENTAGE</code> threshold of 80%, AWS notifies you when you go over
205      * 160 dollars.</p>
206      */
WithThresholdType(const ThresholdType & value)207     inline Notification& WithThresholdType(const ThresholdType& value) { SetThresholdType(value); return *this;}
208 
209     /**
210      * <p>The type of threshold for a notification. For <code>ABSOLUTE_VALUE</code>
211      * thresholds, AWS notifies you when you go over or are forecasted to go over your
212      * total cost threshold. For <code>PERCENTAGE</code> thresholds, AWS notifies you
213      * when you go over or are forecasted to go over a certain percentage of your
214      * forecasted spend. For example, if you have a budget for 200 dollars and you have
215      * a <code>PERCENTAGE</code> threshold of 80%, AWS notifies you when you go over
216      * 160 dollars.</p>
217      */
WithThresholdType(ThresholdType && value)218     inline Notification& WithThresholdType(ThresholdType&& value) { SetThresholdType(std::move(value)); return *this;}
219 
220 
221     /**
222      * <p>Whether this notification is in alarm. If a budget notification is in the
223      * <code>ALARM</code> state, you have passed the set threshold for the budget.</p>
224      */
GetNotificationState()225     inline const NotificationState& GetNotificationState() const{ return m_notificationState; }
226 
227     /**
228      * <p>Whether this notification is in alarm. If a budget notification is in the
229      * <code>ALARM</code> state, you have passed the set threshold for the budget.</p>
230      */
NotificationStateHasBeenSet()231     inline bool NotificationStateHasBeenSet() const { return m_notificationStateHasBeenSet; }
232 
233     /**
234      * <p>Whether this notification is in alarm. If a budget notification is in the
235      * <code>ALARM</code> state, you have passed the set threshold for the budget.</p>
236      */
SetNotificationState(const NotificationState & value)237     inline void SetNotificationState(const NotificationState& value) { m_notificationStateHasBeenSet = true; m_notificationState = value; }
238 
239     /**
240      * <p>Whether this notification is in alarm. If a budget notification is in the
241      * <code>ALARM</code> state, you have passed the set threshold for the budget.</p>
242      */
SetNotificationState(NotificationState && value)243     inline void SetNotificationState(NotificationState&& value) { m_notificationStateHasBeenSet = true; m_notificationState = std::move(value); }
244 
245     /**
246      * <p>Whether this notification is in alarm. If a budget notification is in the
247      * <code>ALARM</code> state, you have passed the set threshold for the budget.</p>
248      */
WithNotificationState(const NotificationState & value)249     inline Notification& WithNotificationState(const NotificationState& value) { SetNotificationState(value); return *this;}
250 
251     /**
252      * <p>Whether this notification is in alarm. If a budget notification is in the
253      * <code>ALARM</code> state, you have passed the set threshold for the budget.</p>
254      */
WithNotificationState(NotificationState && value)255     inline Notification& WithNotificationState(NotificationState&& value) { SetNotificationState(std::move(value)); return *this;}
256 
257   private:
258 
259     NotificationType m_notificationType;
260     bool m_notificationTypeHasBeenSet;
261 
262     ComparisonOperator m_comparisonOperator;
263     bool m_comparisonOperatorHasBeenSet;
264 
265     double m_threshold;
266     bool m_thresholdHasBeenSet;
267 
268     ThresholdType m_thresholdType;
269     bool m_thresholdTypeHasBeenSet;
270 
271     NotificationState m_notificationState;
272     bool m_notificationStateHasBeenSet;
273   };
274 
275 } // namespace Model
276 } // namespace Budgets
277 } // namespace Aws
278