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/s3-crt/S3Crt_EXPORTS.h>
8 #include <aws/s3-crt/model/DefaultRetention.h>
9 #include <utility>
10 
11 namespace Aws
12 {
13 namespace Utils
14 {
15 namespace Xml
16 {
17   class XmlNode;
18 } // namespace Xml
19 } // namespace Utils
20 namespace S3Crt
21 {
22 namespace Model
23 {
24 
25   /**
26    * <p>The container element for an Object Lock rule.</p><p><h3>See Also:</h3>   <a
27    * href="http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ObjectLockRule">AWS
28    * API Reference</a></p>
29    */
30   class AWS_S3CRT_API ObjectLockRule
31   {
32   public:
33     ObjectLockRule();
34     ObjectLockRule(const Aws::Utils::Xml::XmlNode& xmlNode);
35     ObjectLockRule& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
36 
37     void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const;
38 
39 
40     /**
41      * <p>The default Object Lock retention mode and period that you want to apply to
42      * new objects placed in the specified bucket. Bucket settings require both a mode
43      * and a period. The period can be either <code>Days</code> or <code>Years</code>
44      * but you must select one. You cannot specify <code>Days</code> and
45      * <code>Years</code> at the same time.</p>
46      */
GetDefaultRetention()47     inline const DefaultRetention& GetDefaultRetention() const{ return m_defaultRetention; }
48 
49     /**
50      * <p>The default Object Lock retention mode and period that you want to apply to
51      * new objects placed in the specified bucket. Bucket settings require both a mode
52      * and a period. The period can be either <code>Days</code> or <code>Years</code>
53      * but you must select one. You cannot specify <code>Days</code> and
54      * <code>Years</code> at the same time.</p>
55      */
DefaultRetentionHasBeenSet()56     inline bool DefaultRetentionHasBeenSet() const { return m_defaultRetentionHasBeenSet; }
57 
58     /**
59      * <p>The default Object Lock retention mode and period that you want to apply to
60      * new objects placed in the specified bucket. Bucket settings require both a mode
61      * and a period. The period can be either <code>Days</code> or <code>Years</code>
62      * but you must select one. You cannot specify <code>Days</code> and
63      * <code>Years</code> at the same time.</p>
64      */
SetDefaultRetention(const DefaultRetention & value)65     inline void SetDefaultRetention(const DefaultRetention& value) { m_defaultRetentionHasBeenSet = true; m_defaultRetention = value; }
66 
67     /**
68      * <p>The default Object Lock retention mode and period that you want to apply to
69      * new objects placed in the specified bucket. Bucket settings require both a mode
70      * and a period. The period can be either <code>Days</code> or <code>Years</code>
71      * but you must select one. You cannot specify <code>Days</code> and
72      * <code>Years</code> at the same time.</p>
73      */
SetDefaultRetention(DefaultRetention && value)74     inline void SetDefaultRetention(DefaultRetention&& value) { m_defaultRetentionHasBeenSet = true; m_defaultRetention = std::move(value); }
75 
76     /**
77      * <p>The default Object Lock retention mode and period that you want to apply to
78      * new objects placed in the specified bucket. Bucket settings require both a mode
79      * and a period. The period can be either <code>Days</code> or <code>Years</code>
80      * but you must select one. You cannot specify <code>Days</code> and
81      * <code>Years</code> at the same time.</p>
82      */
WithDefaultRetention(const DefaultRetention & value)83     inline ObjectLockRule& WithDefaultRetention(const DefaultRetention& value) { SetDefaultRetention(value); return *this;}
84 
85     /**
86      * <p>The default Object Lock retention mode and period that you want to apply to
87      * new objects placed in the specified bucket. Bucket settings require both a mode
88      * and a period. The period can be either <code>Days</code> or <code>Years</code>
89      * but you must select one. You cannot specify <code>Days</code> and
90      * <code>Years</code> at the same time.</p>
91      */
WithDefaultRetention(DefaultRetention && value)92     inline ObjectLockRule& WithDefaultRetention(DefaultRetention&& value) { SetDefaultRetention(std::move(value)); return *this;}
93 
94   private:
95 
96     DefaultRetention m_defaultRetention;
97     bool m_defaultRetentionHasBeenSet;
98   };
99 
100 } // namespace Model
101 } // namespace S3Crt
102 } // namespace Aws
103