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/dlm/DLM_EXPORTS.h>
8 #include <aws/core/utils/memory/stl/AWSString.h>
9 #include <aws/dlm/model/CrossRegionCopyRetainRule.h>
10 #include <aws/dlm/model/CrossRegionCopyDeprecateRule.h>
11 #include <utility>
12 
13 namespace Aws
14 {
15 namespace Utils
16 {
17 namespace Json
18 {
19   class JsonValue;
20   class JsonView;
21 } // namespace Json
22 } // namespace Utils
23 namespace DLM
24 {
25 namespace Model
26 {
27 
28   /**
29    * <p>Specifies a rule for cross-Region snapshot copies.</p><p><h3>See Also:</h3>
30    * <a
31    * href="http://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/CrossRegionCopyRule">AWS
32    * API Reference</a></p>
33    */
34   class AWS_DLM_API CrossRegionCopyRule
35   {
36   public:
37     CrossRegionCopyRule();
38     CrossRegionCopyRule(Aws::Utils::Json::JsonView jsonValue);
39     CrossRegionCopyRule& operator=(Aws::Utils::Json::JsonView jsonValue);
40     Aws::Utils::Json::JsonValue Jsonize() const;
41 
42 
43     /**
44      * <p>Avoid using this parameter when creating new policies. Instead, use
45      * <b>Target</b> to specify a target Region or a target Outpost for snapshot
46      * copies.</p> <p>For policies created before the <b>Target</b> parameter was
47      * introduced, this parameter indicates the target Region for snapshot copies.</p>
48      */
GetTargetRegion()49     inline const Aws::String& GetTargetRegion() const{ return m_targetRegion; }
50 
51     /**
52      * <p>Avoid using this parameter when creating new policies. Instead, use
53      * <b>Target</b> to specify a target Region or a target Outpost for snapshot
54      * copies.</p> <p>For policies created before the <b>Target</b> parameter was
55      * introduced, this parameter indicates the target Region for snapshot copies.</p>
56      */
TargetRegionHasBeenSet()57     inline bool TargetRegionHasBeenSet() const { return m_targetRegionHasBeenSet; }
58 
59     /**
60      * <p>Avoid using this parameter when creating new policies. Instead, use
61      * <b>Target</b> to specify a target Region or a target Outpost for snapshot
62      * copies.</p> <p>For policies created before the <b>Target</b> parameter was
63      * introduced, this parameter indicates the target Region for snapshot copies.</p>
64      */
SetTargetRegion(const Aws::String & value)65     inline void SetTargetRegion(const Aws::String& value) { m_targetRegionHasBeenSet = true; m_targetRegion = value; }
66 
67     /**
68      * <p>Avoid using this parameter when creating new policies. Instead, use
69      * <b>Target</b> to specify a target Region or a target Outpost for snapshot
70      * copies.</p> <p>For policies created before the <b>Target</b> parameter was
71      * introduced, this parameter indicates the target Region for snapshot copies.</p>
72      */
SetTargetRegion(Aws::String && value)73     inline void SetTargetRegion(Aws::String&& value) { m_targetRegionHasBeenSet = true; m_targetRegion = std::move(value); }
74 
75     /**
76      * <p>Avoid using this parameter when creating new policies. Instead, use
77      * <b>Target</b> to specify a target Region or a target Outpost for snapshot
78      * copies.</p> <p>For policies created before the <b>Target</b> parameter was
79      * introduced, this parameter indicates the target Region for snapshot copies.</p>
80      */
SetTargetRegion(const char * value)81     inline void SetTargetRegion(const char* value) { m_targetRegionHasBeenSet = true; m_targetRegion.assign(value); }
82 
83     /**
84      * <p>Avoid using this parameter when creating new policies. Instead, use
85      * <b>Target</b> to specify a target Region or a target Outpost for snapshot
86      * copies.</p> <p>For policies created before the <b>Target</b> parameter was
87      * introduced, this parameter indicates the target Region for snapshot copies.</p>
88      */
WithTargetRegion(const Aws::String & value)89     inline CrossRegionCopyRule& WithTargetRegion(const Aws::String& value) { SetTargetRegion(value); return *this;}
90 
91     /**
92      * <p>Avoid using this parameter when creating new policies. Instead, use
93      * <b>Target</b> to specify a target Region or a target Outpost for snapshot
94      * copies.</p> <p>For policies created before the <b>Target</b> parameter was
95      * introduced, this parameter indicates the target Region for snapshot copies.</p>
96      */
WithTargetRegion(Aws::String && value)97     inline CrossRegionCopyRule& WithTargetRegion(Aws::String&& value) { SetTargetRegion(std::move(value)); return *this;}
98 
99     /**
100      * <p>Avoid using this parameter when creating new policies. Instead, use
101      * <b>Target</b> to specify a target Region or a target Outpost for snapshot
102      * copies.</p> <p>For policies created before the <b>Target</b> parameter was
103      * introduced, this parameter indicates the target Region for snapshot copies.</p>
104      */
WithTargetRegion(const char * value)105     inline CrossRegionCopyRule& WithTargetRegion(const char* value) { SetTargetRegion(value); return *this;}
106 
107 
108     /**
109      * <p>The target Region or the Amazon Resource Name (ARN) of the target Outpost for
110      * the snapshot copies.</p> <p>Use this parameter instead of <b>TargetRegion</b>.
111      * Do not specify both.</p>
112      */
GetTarget()113     inline const Aws::String& GetTarget() const{ return m_target; }
114 
115     /**
116      * <p>The target Region or the Amazon Resource Name (ARN) of the target Outpost for
117      * the snapshot copies.</p> <p>Use this parameter instead of <b>TargetRegion</b>.
118      * Do not specify both.</p>
119      */
TargetHasBeenSet()120     inline bool TargetHasBeenSet() const { return m_targetHasBeenSet; }
121 
122     /**
123      * <p>The target Region or the Amazon Resource Name (ARN) of the target Outpost for
124      * the snapshot copies.</p> <p>Use this parameter instead of <b>TargetRegion</b>.
125      * Do not specify both.</p>
126      */
SetTarget(const Aws::String & value)127     inline void SetTarget(const Aws::String& value) { m_targetHasBeenSet = true; m_target = value; }
128 
129     /**
130      * <p>The target Region or the Amazon Resource Name (ARN) of the target Outpost for
131      * the snapshot copies.</p> <p>Use this parameter instead of <b>TargetRegion</b>.
132      * Do not specify both.</p>
133      */
SetTarget(Aws::String && value)134     inline void SetTarget(Aws::String&& value) { m_targetHasBeenSet = true; m_target = std::move(value); }
135 
136     /**
137      * <p>The target Region or the Amazon Resource Name (ARN) of the target Outpost for
138      * the snapshot copies.</p> <p>Use this parameter instead of <b>TargetRegion</b>.
139      * Do not specify both.</p>
140      */
SetTarget(const char * value)141     inline void SetTarget(const char* value) { m_targetHasBeenSet = true; m_target.assign(value); }
142 
143     /**
144      * <p>The target Region or the Amazon Resource Name (ARN) of the target Outpost for
145      * the snapshot copies.</p> <p>Use this parameter instead of <b>TargetRegion</b>.
146      * Do not specify both.</p>
147      */
WithTarget(const Aws::String & value)148     inline CrossRegionCopyRule& WithTarget(const Aws::String& value) { SetTarget(value); return *this;}
149 
150     /**
151      * <p>The target Region or the Amazon Resource Name (ARN) of the target Outpost for
152      * the snapshot copies.</p> <p>Use this parameter instead of <b>TargetRegion</b>.
153      * Do not specify both.</p>
154      */
WithTarget(Aws::String && value)155     inline CrossRegionCopyRule& WithTarget(Aws::String&& value) { SetTarget(std::move(value)); return *this;}
156 
157     /**
158      * <p>The target Region or the Amazon Resource Name (ARN) of the target Outpost for
159      * the snapshot copies.</p> <p>Use this parameter instead of <b>TargetRegion</b>.
160      * Do not specify both.</p>
161      */
WithTarget(const char * value)162     inline CrossRegionCopyRule& WithTarget(const char* value) { SetTarget(value); return *this;}
163 
164 
165     /**
166      * <p>To encrypt a copy of an unencrypted snapshot if encryption by default is not
167      * enabled, enable encryption using this parameter. Copies of encrypted snapshots
168      * are encrypted, even if this parameter is false or if encryption by default is
169      * not enabled.</p>
170      */
GetEncrypted()171     inline bool GetEncrypted() const{ return m_encrypted; }
172 
173     /**
174      * <p>To encrypt a copy of an unencrypted snapshot if encryption by default is not
175      * enabled, enable encryption using this parameter. Copies of encrypted snapshots
176      * are encrypted, even if this parameter is false or if encryption by default is
177      * not enabled.</p>
178      */
EncryptedHasBeenSet()179     inline bool EncryptedHasBeenSet() const { return m_encryptedHasBeenSet; }
180 
181     /**
182      * <p>To encrypt a copy of an unencrypted snapshot if encryption by default is not
183      * enabled, enable encryption using this parameter. Copies of encrypted snapshots
184      * are encrypted, even if this parameter is false or if encryption by default is
185      * not enabled.</p>
186      */
SetEncrypted(bool value)187     inline void SetEncrypted(bool value) { m_encryptedHasBeenSet = true; m_encrypted = value; }
188 
189     /**
190      * <p>To encrypt a copy of an unencrypted snapshot if encryption by default is not
191      * enabled, enable encryption using this parameter. Copies of encrypted snapshots
192      * are encrypted, even if this parameter is false or if encryption by default is
193      * not enabled.</p>
194      */
WithEncrypted(bool value)195     inline CrossRegionCopyRule& WithEncrypted(bool value) { SetEncrypted(value); return *this;}
196 
197 
198     /**
199      * <p>The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption. If
200      * this parameter is not specified, the default KMS key for the account is
201      * used.</p>
202      */
GetCmkArn()203     inline const Aws::String& GetCmkArn() const{ return m_cmkArn; }
204 
205     /**
206      * <p>The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption. If
207      * this parameter is not specified, the default KMS key for the account is
208      * used.</p>
209      */
CmkArnHasBeenSet()210     inline bool CmkArnHasBeenSet() const { return m_cmkArnHasBeenSet; }
211 
212     /**
213      * <p>The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption. If
214      * this parameter is not specified, the default KMS key for the account is
215      * used.</p>
216      */
SetCmkArn(const Aws::String & value)217     inline void SetCmkArn(const Aws::String& value) { m_cmkArnHasBeenSet = true; m_cmkArn = value; }
218 
219     /**
220      * <p>The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption. If
221      * this parameter is not specified, the default KMS key for the account is
222      * used.</p>
223      */
SetCmkArn(Aws::String && value)224     inline void SetCmkArn(Aws::String&& value) { m_cmkArnHasBeenSet = true; m_cmkArn = std::move(value); }
225 
226     /**
227      * <p>The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption. If
228      * this parameter is not specified, the default KMS key for the account is
229      * used.</p>
230      */
SetCmkArn(const char * value)231     inline void SetCmkArn(const char* value) { m_cmkArnHasBeenSet = true; m_cmkArn.assign(value); }
232 
233     /**
234      * <p>The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption. If
235      * this parameter is not specified, the default KMS key for the account is
236      * used.</p>
237      */
WithCmkArn(const Aws::String & value)238     inline CrossRegionCopyRule& WithCmkArn(const Aws::String& value) { SetCmkArn(value); return *this;}
239 
240     /**
241      * <p>The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption. If
242      * this parameter is not specified, the default KMS key for the account is
243      * used.</p>
244      */
WithCmkArn(Aws::String && value)245     inline CrossRegionCopyRule& WithCmkArn(Aws::String&& value) { SetCmkArn(std::move(value)); return *this;}
246 
247     /**
248      * <p>The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption. If
249      * this parameter is not specified, the default KMS key for the account is
250      * used.</p>
251      */
WithCmkArn(const char * value)252     inline CrossRegionCopyRule& WithCmkArn(const char* value) { SetCmkArn(value); return *this;}
253 
254 
255     /**
256      * <p>Indicates whether to copy all user-defined tags from the source snapshot to
257      * the cross-Region snapshot copy.</p>
258      */
GetCopyTags()259     inline bool GetCopyTags() const{ return m_copyTags; }
260 
261     /**
262      * <p>Indicates whether to copy all user-defined tags from the source snapshot to
263      * the cross-Region snapshot copy.</p>
264      */
CopyTagsHasBeenSet()265     inline bool CopyTagsHasBeenSet() const { return m_copyTagsHasBeenSet; }
266 
267     /**
268      * <p>Indicates whether to copy all user-defined tags from the source snapshot to
269      * the cross-Region snapshot copy.</p>
270      */
SetCopyTags(bool value)271     inline void SetCopyTags(bool value) { m_copyTagsHasBeenSet = true; m_copyTags = value; }
272 
273     /**
274      * <p>Indicates whether to copy all user-defined tags from the source snapshot to
275      * the cross-Region snapshot copy.</p>
276      */
WithCopyTags(bool value)277     inline CrossRegionCopyRule& WithCopyTags(bool value) { SetCopyTags(value); return *this;}
278 
279 
280     /**
281      * <p>The retention rule that indicates how long snapshot copies are to be retained
282      * in the destination Region.</p>
283      */
GetRetainRule()284     inline const CrossRegionCopyRetainRule& GetRetainRule() const{ return m_retainRule; }
285 
286     /**
287      * <p>The retention rule that indicates how long snapshot copies are to be retained
288      * in the destination Region.</p>
289      */
RetainRuleHasBeenSet()290     inline bool RetainRuleHasBeenSet() const { return m_retainRuleHasBeenSet; }
291 
292     /**
293      * <p>The retention rule that indicates how long snapshot copies are to be retained
294      * in the destination Region.</p>
295      */
SetRetainRule(const CrossRegionCopyRetainRule & value)296     inline void SetRetainRule(const CrossRegionCopyRetainRule& value) { m_retainRuleHasBeenSet = true; m_retainRule = value; }
297 
298     /**
299      * <p>The retention rule that indicates how long snapshot copies are to be retained
300      * in the destination Region.</p>
301      */
SetRetainRule(CrossRegionCopyRetainRule && value)302     inline void SetRetainRule(CrossRegionCopyRetainRule&& value) { m_retainRuleHasBeenSet = true; m_retainRule = std::move(value); }
303 
304     /**
305      * <p>The retention rule that indicates how long snapshot copies are to be retained
306      * in the destination Region.</p>
307      */
WithRetainRule(const CrossRegionCopyRetainRule & value)308     inline CrossRegionCopyRule& WithRetainRule(const CrossRegionCopyRetainRule& value) { SetRetainRule(value); return *this;}
309 
310     /**
311      * <p>The retention rule that indicates how long snapshot copies are to be retained
312      * in the destination Region.</p>
313      */
WithRetainRule(CrossRegionCopyRetainRule && value)314     inline CrossRegionCopyRule& WithRetainRule(CrossRegionCopyRetainRule&& value) { SetRetainRule(std::move(value)); return *this;}
315 
316 
317     /**
318      * <p>The AMI deprecation rule for cross-Region AMI copies created by the rule.</p>
319      */
GetDeprecateRule()320     inline const CrossRegionCopyDeprecateRule& GetDeprecateRule() const{ return m_deprecateRule; }
321 
322     /**
323      * <p>The AMI deprecation rule for cross-Region AMI copies created by the rule.</p>
324      */
DeprecateRuleHasBeenSet()325     inline bool DeprecateRuleHasBeenSet() const { return m_deprecateRuleHasBeenSet; }
326 
327     /**
328      * <p>The AMI deprecation rule for cross-Region AMI copies created by the rule.</p>
329      */
SetDeprecateRule(const CrossRegionCopyDeprecateRule & value)330     inline void SetDeprecateRule(const CrossRegionCopyDeprecateRule& value) { m_deprecateRuleHasBeenSet = true; m_deprecateRule = value; }
331 
332     /**
333      * <p>The AMI deprecation rule for cross-Region AMI copies created by the rule.</p>
334      */
SetDeprecateRule(CrossRegionCopyDeprecateRule && value)335     inline void SetDeprecateRule(CrossRegionCopyDeprecateRule&& value) { m_deprecateRuleHasBeenSet = true; m_deprecateRule = std::move(value); }
336 
337     /**
338      * <p>The AMI deprecation rule for cross-Region AMI copies created by the rule.</p>
339      */
WithDeprecateRule(const CrossRegionCopyDeprecateRule & value)340     inline CrossRegionCopyRule& WithDeprecateRule(const CrossRegionCopyDeprecateRule& value) { SetDeprecateRule(value); return *this;}
341 
342     /**
343      * <p>The AMI deprecation rule for cross-Region AMI copies created by the rule.</p>
344      */
WithDeprecateRule(CrossRegionCopyDeprecateRule && value)345     inline CrossRegionCopyRule& WithDeprecateRule(CrossRegionCopyDeprecateRule&& value) { SetDeprecateRule(std::move(value)); return *this;}
346 
347   private:
348 
349     Aws::String m_targetRegion;
350     bool m_targetRegionHasBeenSet;
351 
352     Aws::String m_target;
353     bool m_targetHasBeenSet;
354 
355     bool m_encrypted;
356     bool m_encryptedHasBeenSet;
357 
358     Aws::String m_cmkArn;
359     bool m_cmkArnHasBeenSet;
360 
361     bool m_copyTags;
362     bool m_copyTagsHasBeenSet;
363 
364     CrossRegionCopyRetainRule m_retainRule;
365     bool m_retainRuleHasBeenSet;
366 
367     CrossRegionCopyDeprecateRule m_deprecateRule;
368     bool m_deprecateRuleHasBeenSet;
369   };
370 
371 } // namespace Model
372 } // namespace DLM
373 } // namespace Aws
374