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/redshift/Redshift_EXPORTS.h>
8 #include <aws/core/utils/memory/stl/AWSStreamFwd.h>
9 #include <aws/core/utils/memory/stl/AWSString.h>
10 #include <aws/redshift/model/UsageLimitFeatureType.h>
11 #include <aws/redshift/model/UsageLimitLimitType.h>
12 #include <aws/redshift/model/UsageLimitPeriod.h>
13 #include <aws/redshift/model/UsageLimitBreachAction.h>
14 #include <aws/core/utils/memory/stl/AWSVector.h>
15 #include <aws/redshift/model/ResponseMetadata.h>
16 #include <aws/redshift/model/Tag.h>
17 #include <utility>
18 
19 namespace Aws
20 {
21 namespace Utils
22 {
23 namespace Xml
24 {
25   class XmlNode;
26 } // namespace Xml
27 } // namespace Utils
28 namespace Redshift
29 {
30 namespace Model
31 {
32 
33   /**
34    * <p>Describes a usage limit object for a cluster. </p><p><h3>See Also:</h3>   <a
35    * href="http://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/UsageLimit">AWS
36    * API Reference</a></p>
37    */
38   class AWS_REDSHIFT_API UsageLimit
39   {
40   public:
41     UsageLimit();
42     UsageLimit(const Aws::Utils::Xml::XmlNode& xmlNode);
43     UsageLimit& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
44 
45     void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
46     void OutputToStream(Aws::OStream& oStream, const char* location) const;
47 
48 
49     /**
50      * <p>The identifier of the usage limit.</p>
51      */
GetUsageLimitId()52     inline const Aws::String& GetUsageLimitId() const{ return m_usageLimitId; }
53 
54     /**
55      * <p>The identifier of the usage limit.</p>
56      */
UsageLimitIdHasBeenSet()57     inline bool UsageLimitIdHasBeenSet() const { return m_usageLimitIdHasBeenSet; }
58 
59     /**
60      * <p>The identifier of the usage limit.</p>
61      */
SetUsageLimitId(const Aws::String & value)62     inline void SetUsageLimitId(const Aws::String& value) { m_usageLimitIdHasBeenSet = true; m_usageLimitId = value; }
63 
64     /**
65      * <p>The identifier of the usage limit.</p>
66      */
SetUsageLimitId(Aws::String && value)67     inline void SetUsageLimitId(Aws::String&& value) { m_usageLimitIdHasBeenSet = true; m_usageLimitId = std::move(value); }
68 
69     /**
70      * <p>The identifier of the usage limit.</p>
71      */
SetUsageLimitId(const char * value)72     inline void SetUsageLimitId(const char* value) { m_usageLimitIdHasBeenSet = true; m_usageLimitId.assign(value); }
73 
74     /**
75      * <p>The identifier of the usage limit.</p>
76      */
WithUsageLimitId(const Aws::String & value)77     inline UsageLimit& WithUsageLimitId(const Aws::String& value) { SetUsageLimitId(value); return *this;}
78 
79     /**
80      * <p>The identifier of the usage limit.</p>
81      */
WithUsageLimitId(Aws::String && value)82     inline UsageLimit& WithUsageLimitId(Aws::String&& value) { SetUsageLimitId(std::move(value)); return *this;}
83 
84     /**
85      * <p>The identifier of the usage limit.</p>
86      */
WithUsageLimitId(const char * value)87     inline UsageLimit& WithUsageLimitId(const char* value) { SetUsageLimitId(value); return *this;}
88 
89 
90     /**
91      * <p>The identifier of the cluster with a usage limit.</p>
92      */
GetClusterIdentifier()93     inline const Aws::String& GetClusterIdentifier() const{ return m_clusterIdentifier; }
94 
95     /**
96      * <p>The identifier of the cluster with a usage limit.</p>
97      */
ClusterIdentifierHasBeenSet()98     inline bool ClusterIdentifierHasBeenSet() const { return m_clusterIdentifierHasBeenSet; }
99 
100     /**
101      * <p>The identifier of the cluster with a usage limit.</p>
102      */
SetClusterIdentifier(const Aws::String & value)103     inline void SetClusterIdentifier(const Aws::String& value) { m_clusterIdentifierHasBeenSet = true; m_clusterIdentifier = value; }
104 
105     /**
106      * <p>The identifier of the cluster with a usage limit.</p>
107      */
SetClusterIdentifier(Aws::String && value)108     inline void SetClusterIdentifier(Aws::String&& value) { m_clusterIdentifierHasBeenSet = true; m_clusterIdentifier = std::move(value); }
109 
110     /**
111      * <p>The identifier of the cluster with a usage limit.</p>
112      */
SetClusterIdentifier(const char * value)113     inline void SetClusterIdentifier(const char* value) { m_clusterIdentifierHasBeenSet = true; m_clusterIdentifier.assign(value); }
114 
115     /**
116      * <p>The identifier of the cluster with a usage limit.</p>
117      */
WithClusterIdentifier(const Aws::String & value)118     inline UsageLimit& WithClusterIdentifier(const Aws::String& value) { SetClusterIdentifier(value); return *this;}
119 
120     /**
121      * <p>The identifier of the cluster with a usage limit.</p>
122      */
WithClusterIdentifier(Aws::String && value)123     inline UsageLimit& WithClusterIdentifier(Aws::String&& value) { SetClusterIdentifier(std::move(value)); return *this;}
124 
125     /**
126      * <p>The identifier of the cluster with a usage limit.</p>
127      */
WithClusterIdentifier(const char * value)128     inline UsageLimit& WithClusterIdentifier(const char* value) { SetClusterIdentifier(value); return *this;}
129 
130 
131     /**
132      * <p>The Amazon Redshift feature to which the limit applies.</p>
133      */
GetFeatureType()134     inline const UsageLimitFeatureType& GetFeatureType() const{ return m_featureType; }
135 
136     /**
137      * <p>The Amazon Redshift feature to which the limit applies.</p>
138      */
FeatureTypeHasBeenSet()139     inline bool FeatureTypeHasBeenSet() const { return m_featureTypeHasBeenSet; }
140 
141     /**
142      * <p>The Amazon Redshift feature to which the limit applies.</p>
143      */
SetFeatureType(const UsageLimitFeatureType & value)144     inline void SetFeatureType(const UsageLimitFeatureType& value) { m_featureTypeHasBeenSet = true; m_featureType = value; }
145 
146     /**
147      * <p>The Amazon Redshift feature to which the limit applies.</p>
148      */
SetFeatureType(UsageLimitFeatureType && value)149     inline void SetFeatureType(UsageLimitFeatureType&& value) { m_featureTypeHasBeenSet = true; m_featureType = std::move(value); }
150 
151     /**
152      * <p>The Amazon Redshift feature to which the limit applies.</p>
153      */
WithFeatureType(const UsageLimitFeatureType & value)154     inline UsageLimit& WithFeatureType(const UsageLimitFeatureType& value) { SetFeatureType(value); return *this;}
155 
156     /**
157      * <p>The Amazon Redshift feature to which the limit applies.</p>
158      */
WithFeatureType(UsageLimitFeatureType && value)159     inline UsageLimit& WithFeatureType(UsageLimitFeatureType&& value) { SetFeatureType(std::move(value)); return *this;}
160 
161 
162     /**
163      * <p>The type of limit. Depending on the feature type, this can be based on a time
164      * duration or data size.</p>
165      */
GetLimitType()166     inline const UsageLimitLimitType& GetLimitType() const{ return m_limitType; }
167 
168     /**
169      * <p>The type of limit. Depending on the feature type, this can be based on a time
170      * duration or data size.</p>
171      */
LimitTypeHasBeenSet()172     inline bool LimitTypeHasBeenSet() const { return m_limitTypeHasBeenSet; }
173 
174     /**
175      * <p>The type of limit. Depending on the feature type, this can be based on a time
176      * duration or data size.</p>
177      */
SetLimitType(const UsageLimitLimitType & value)178     inline void SetLimitType(const UsageLimitLimitType& value) { m_limitTypeHasBeenSet = true; m_limitType = value; }
179 
180     /**
181      * <p>The type of limit. Depending on the feature type, this can be based on a time
182      * duration or data size.</p>
183      */
SetLimitType(UsageLimitLimitType && value)184     inline void SetLimitType(UsageLimitLimitType&& value) { m_limitTypeHasBeenSet = true; m_limitType = std::move(value); }
185 
186     /**
187      * <p>The type of limit. Depending on the feature type, this can be based on a time
188      * duration or data size.</p>
189      */
WithLimitType(const UsageLimitLimitType & value)190     inline UsageLimit& WithLimitType(const UsageLimitLimitType& value) { SetLimitType(value); return *this;}
191 
192     /**
193      * <p>The type of limit. Depending on the feature type, this can be based on a time
194      * duration or data size.</p>
195      */
WithLimitType(UsageLimitLimitType && value)196     inline UsageLimit& WithLimitType(UsageLimitLimitType&& value) { SetLimitType(std::move(value)); return *this;}
197 
198 
199     /**
200      * <p>The limit amount. If time-based, this amount is in minutes. If data-based,
201      * this amount is in terabytes (TB).</p>
202      */
GetAmount()203     inline long long GetAmount() const{ return m_amount; }
204 
205     /**
206      * <p>The limit amount. If time-based, this amount is in minutes. If data-based,
207      * this amount is in terabytes (TB).</p>
208      */
AmountHasBeenSet()209     inline bool AmountHasBeenSet() const { return m_amountHasBeenSet; }
210 
211     /**
212      * <p>The limit amount. If time-based, this amount is in minutes. If data-based,
213      * this amount is in terabytes (TB).</p>
214      */
SetAmount(long long value)215     inline void SetAmount(long long value) { m_amountHasBeenSet = true; m_amount = value; }
216 
217     /**
218      * <p>The limit amount. If time-based, this amount is in minutes. If data-based,
219      * this amount is in terabytes (TB).</p>
220      */
WithAmount(long long value)221     inline UsageLimit& WithAmount(long long value) { SetAmount(value); return *this;}
222 
223 
224     /**
225      * <p>The time period that the amount applies to. A <code>weekly</code> period
226      * begins on Sunday. The default is <code>monthly</code>. </p>
227      */
GetPeriod()228     inline const UsageLimitPeriod& GetPeriod() const{ return m_period; }
229 
230     /**
231      * <p>The time period that the amount applies to. A <code>weekly</code> period
232      * begins on Sunday. The default is <code>monthly</code>. </p>
233      */
PeriodHasBeenSet()234     inline bool PeriodHasBeenSet() const { return m_periodHasBeenSet; }
235 
236     /**
237      * <p>The time period that the amount applies to. A <code>weekly</code> period
238      * begins on Sunday. The default is <code>monthly</code>. </p>
239      */
SetPeriod(const UsageLimitPeriod & value)240     inline void SetPeriod(const UsageLimitPeriod& value) { m_periodHasBeenSet = true; m_period = value; }
241 
242     /**
243      * <p>The time period that the amount applies to. A <code>weekly</code> period
244      * begins on Sunday. The default is <code>monthly</code>. </p>
245      */
SetPeriod(UsageLimitPeriod && value)246     inline void SetPeriod(UsageLimitPeriod&& value) { m_periodHasBeenSet = true; m_period = std::move(value); }
247 
248     /**
249      * <p>The time period that the amount applies to. A <code>weekly</code> period
250      * begins on Sunday. The default is <code>monthly</code>. </p>
251      */
WithPeriod(const UsageLimitPeriod & value)252     inline UsageLimit& WithPeriod(const UsageLimitPeriod& value) { SetPeriod(value); return *this;}
253 
254     /**
255      * <p>The time period that the amount applies to. A <code>weekly</code> period
256      * begins on Sunday. The default is <code>monthly</code>. </p>
257      */
WithPeriod(UsageLimitPeriod && value)258     inline UsageLimit& WithPeriod(UsageLimitPeriod&& value) { SetPeriod(std::move(value)); return *this;}
259 
260 
261     /**
262      * <p>The action that Amazon Redshift takes when the limit is reached. Possible
263      * values are: </p> <ul> <li> <p> <b>log</b> - To log an event in a system table.
264      * The default is log.</p> </li> <li> <p> <b>emit-metric</b> - To emit CloudWatch
265      * metrics.</p> </li> <li> <p> <b>disable</b> - To disable the feature until the
266      * next usage period begins.</p> </li> </ul>
267      */
GetBreachAction()268     inline const UsageLimitBreachAction& GetBreachAction() const{ return m_breachAction; }
269 
270     /**
271      * <p>The action that Amazon Redshift takes when the limit is reached. Possible
272      * values are: </p> <ul> <li> <p> <b>log</b> - To log an event in a system table.
273      * The default is log.</p> </li> <li> <p> <b>emit-metric</b> - To emit CloudWatch
274      * metrics.</p> </li> <li> <p> <b>disable</b> - To disable the feature until the
275      * next usage period begins.</p> </li> </ul>
276      */
BreachActionHasBeenSet()277     inline bool BreachActionHasBeenSet() const { return m_breachActionHasBeenSet; }
278 
279     /**
280      * <p>The action that Amazon Redshift takes when the limit is reached. Possible
281      * values are: </p> <ul> <li> <p> <b>log</b> - To log an event in a system table.
282      * The default is log.</p> </li> <li> <p> <b>emit-metric</b> - To emit CloudWatch
283      * metrics.</p> </li> <li> <p> <b>disable</b> - To disable the feature until the
284      * next usage period begins.</p> </li> </ul>
285      */
SetBreachAction(const UsageLimitBreachAction & value)286     inline void SetBreachAction(const UsageLimitBreachAction& value) { m_breachActionHasBeenSet = true; m_breachAction = value; }
287 
288     /**
289      * <p>The action that Amazon Redshift takes when the limit is reached. Possible
290      * values are: </p> <ul> <li> <p> <b>log</b> - To log an event in a system table.
291      * The default is log.</p> </li> <li> <p> <b>emit-metric</b> - To emit CloudWatch
292      * metrics.</p> </li> <li> <p> <b>disable</b> - To disable the feature until the
293      * next usage period begins.</p> </li> </ul>
294      */
SetBreachAction(UsageLimitBreachAction && value)295     inline void SetBreachAction(UsageLimitBreachAction&& value) { m_breachActionHasBeenSet = true; m_breachAction = std::move(value); }
296 
297     /**
298      * <p>The action that Amazon Redshift takes when the limit is reached. Possible
299      * values are: </p> <ul> <li> <p> <b>log</b> - To log an event in a system table.
300      * The default is log.</p> </li> <li> <p> <b>emit-metric</b> - To emit CloudWatch
301      * metrics.</p> </li> <li> <p> <b>disable</b> - To disable the feature until the
302      * next usage period begins.</p> </li> </ul>
303      */
WithBreachAction(const UsageLimitBreachAction & value)304     inline UsageLimit& WithBreachAction(const UsageLimitBreachAction& value) { SetBreachAction(value); return *this;}
305 
306     /**
307      * <p>The action that Amazon Redshift takes when the limit is reached. Possible
308      * values are: </p> <ul> <li> <p> <b>log</b> - To log an event in a system table.
309      * The default is log.</p> </li> <li> <p> <b>emit-metric</b> - To emit CloudWatch
310      * metrics.</p> </li> <li> <p> <b>disable</b> - To disable the feature until the
311      * next usage period begins.</p> </li> </ul>
312      */
WithBreachAction(UsageLimitBreachAction && value)313     inline UsageLimit& WithBreachAction(UsageLimitBreachAction&& value) { SetBreachAction(std::move(value)); return *this;}
314 
315 
316     /**
317      * <p>A list of tag instances.</p>
318      */
GetTags()319     inline const Aws::Vector<Tag>& GetTags() const{ return m_tags; }
320 
321     /**
322      * <p>A list of tag instances.</p>
323      */
TagsHasBeenSet()324     inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
325 
326     /**
327      * <p>A list of tag instances.</p>
328      */
SetTags(const Aws::Vector<Tag> & value)329     inline void SetTags(const Aws::Vector<Tag>& value) { m_tagsHasBeenSet = true; m_tags = value; }
330 
331     /**
332      * <p>A list of tag instances.</p>
333      */
SetTags(Aws::Vector<Tag> && value)334     inline void SetTags(Aws::Vector<Tag>&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); }
335 
336     /**
337      * <p>A list of tag instances.</p>
338      */
WithTags(const Aws::Vector<Tag> & value)339     inline UsageLimit& WithTags(const Aws::Vector<Tag>& value) { SetTags(value); return *this;}
340 
341     /**
342      * <p>A list of tag instances.</p>
343      */
WithTags(Aws::Vector<Tag> && value)344     inline UsageLimit& WithTags(Aws::Vector<Tag>&& value) { SetTags(std::move(value)); return *this;}
345 
346     /**
347      * <p>A list of tag instances.</p>
348      */
AddTags(const Tag & value)349     inline UsageLimit& AddTags(const Tag& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; }
350 
351     /**
352      * <p>A list of tag instances.</p>
353      */
AddTags(Tag && value)354     inline UsageLimit& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(std::move(value)); return *this; }
355 
356 
357 
GetResponseMetadata()358     inline const ResponseMetadata& GetResponseMetadata() const{ return m_responseMetadata; }
359 
360 
ResponseMetadataHasBeenSet()361     inline bool ResponseMetadataHasBeenSet() const { return m_responseMetadataHasBeenSet; }
362 
363 
SetResponseMetadata(const ResponseMetadata & value)364     inline void SetResponseMetadata(const ResponseMetadata& value) { m_responseMetadataHasBeenSet = true; m_responseMetadata = value; }
365 
366 
SetResponseMetadata(ResponseMetadata && value)367     inline void SetResponseMetadata(ResponseMetadata&& value) { m_responseMetadataHasBeenSet = true; m_responseMetadata = std::move(value); }
368 
369 
WithResponseMetadata(const ResponseMetadata & value)370     inline UsageLimit& WithResponseMetadata(const ResponseMetadata& value) { SetResponseMetadata(value); return *this;}
371 
372 
WithResponseMetadata(ResponseMetadata && value)373     inline UsageLimit& WithResponseMetadata(ResponseMetadata&& value) { SetResponseMetadata(std::move(value)); return *this;}
374 
375   private:
376 
377     Aws::String m_usageLimitId;
378     bool m_usageLimitIdHasBeenSet;
379 
380     Aws::String m_clusterIdentifier;
381     bool m_clusterIdentifierHasBeenSet;
382 
383     UsageLimitFeatureType m_featureType;
384     bool m_featureTypeHasBeenSet;
385 
386     UsageLimitLimitType m_limitType;
387     bool m_limitTypeHasBeenSet;
388 
389     long long m_amount;
390     bool m_amountHasBeenSet;
391 
392     UsageLimitPeriod m_period;
393     bool m_periodHasBeenSet;
394 
395     UsageLimitBreachAction m_breachAction;
396     bool m_breachActionHasBeenSet;
397 
398     Aws::Vector<Tag> m_tags;
399     bool m_tagsHasBeenSet;
400 
401     ResponseMetadata m_responseMetadata;
402     bool m_responseMetadataHasBeenSet;
403   };
404 
405 } // namespace Model
406 } // namespace Redshift
407 } // namespace Aws
408