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/ObjectLockEnabled.h>
9 #include <aws/s3-crt/model/ObjectLockRule.h>
10 #include <utility>
11 
12 namespace Aws
13 {
14 namespace Utils
15 {
16 namespace Xml
17 {
18   class XmlNode;
19 } // namespace Xml
20 } // namespace Utils
21 namespace S3Crt
22 {
23 namespace Model
24 {
25 
26   /**
27    * <p>The container element for Object Lock configuration parameters.</p><p><h3>See
28    * Also:</h3>   <a
29    * href="http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ObjectLockConfiguration">AWS
30    * API Reference</a></p>
31    */
32   class AWS_S3CRT_API ObjectLockConfiguration
33   {
34   public:
35     ObjectLockConfiguration();
36     ObjectLockConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode);
37     ObjectLockConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
38 
39     void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const;
40 
41 
42     /**
43      * <p>Indicates whether this bucket has an Object Lock configuration enabled.
44      * Enable <code>ObjectLockEnabled</code> when you apply
45      * <code>ObjectLockConfiguration</code> to a bucket. </p>
46      */
GetObjectLockEnabled()47     inline const ObjectLockEnabled& GetObjectLockEnabled() const{ return m_objectLockEnabled; }
48 
49     /**
50      * <p>Indicates whether this bucket has an Object Lock configuration enabled.
51      * Enable <code>ObjectLockEnabled</code> when you apply
52      * <code>ObjectLockConfiguration</code> to a bucket. </p>
53      */
ObjectLockEnabledHasBeenSet()54     inline bool ObjectLockEnabledHasBeenSet() const { return m_objectLockEnabledHasBeenSet; }
55 
56     /**
57      * <p>Indicates whether this bucket has an Object Lock configuration enabled.
58      * Enable <code>ObjectLockEnabled</code> when you apply
59      * <code>ObjectLockConfiguration</code> to a bucket. </p>
60      */
SetObjectLockEnabled(const ObjectLockEnabled & value)61     inline void SetObjectLockEnabled(const ObjectLockEnabled& value) { m_objectLockEnabledHasBeenSet = true; m_objectLockEnabled = value; }
62 
63     /**
64      * <p>Indicates whether this bucket has an Object Lock configuration enabled.
65      * Enable <code>ObjectLockEnabled</code> when you apply
66      * <code>ObjectLockConfiguration</code> to a bucket. </p>
67      */
SetObjectLockEnabled(ObjectLockEnabled && value)68     inline void SetObjectLockEnabled(ObjectLockEnabled&& value) { m_objectLockEnabledHasBeenSet = true; m_objectLockEnabled = std::move(value); }
69 
70     /**
71      * <p>Indicates whether this bucket has an Object Lock configuration enabled.
72      * Enable <code>ObjectLockEnabled</code> when you apply
73      * <code>ObjectLockConfiguration</code> to a bucket. </p>
74      */
WithObjectLockEnabled(const ObjectLockEnabled & value)75     inline ObjectLockConfiguration& WithObjectLockEnabled(const ObjectLockEnabled& value) { SetObjectLockEnabled(value); return *this;}
76 
77     /**
78      * <p>Indicates whether this bucket has an Object Lock configuration enabled.
79      * Enable <code>ObjectLockEnabled</code> when you apply
80      * <code>ObjectLockConfiguration</code> to a bucket. </p>
81      */
WithObjectLockEnabled(ObjectLockEnabled && value)82     inline ObjectLockConfiguration& WithObjectLockEnabled(ObjectLockEnabled&& value) { SetObjectLockEnabled(std::move(value)); return *this;}
83 
84 
85     /**
86      * <p>Specifies the Object Lock rule for the specified object. Enable the this rule
87      * when you apply <code>ObjectLockConfiguration</code> to a bucket. Bucket settings
88      * require both a mode and a period. The period can be either <code>Days</code> or
89      * <code>Years</code> but you must select one. You cannot specify <code>Days</code>
90      * and <code>Years</code> at the same time.</p>
91      */
GetRule()92     inline const ObjectLockRule& GetRule() const{ return m_rule; }
93 
94     /**
95      * <p>Specifies the Object Lock rule for the specified object. Enable the this rule
96      * when you apply <code>ObjectLockConfiguration</code> to a bucket. Bucket settings
97      * require both a mode and a period. The period can be either <code>Days</code> or
98      * <code>Years</code> but you must select one. You cannot specify <code>Days</code>
99      * and <code>Years</code> at the same time.</p>
100      */
RuleHasBeenSet()101     inline bool RuleHasBeenSet() const { return m_ruleHasBeenSet; }
102 
103     /**
104      * <p>Specifies the Object Lock rule for the specified object. Enable the this rule
105      * when you apply <code>ObjectLockConfiguration</code> to a bucket. Bucket settings
106      * require both a mode and a period. The period can be either <code>Days</code> or
107      * <code>Years</code> but you must select one. You cannot specify <code>Days</code>
108      * and <code>Years</code> at the same time.</p>
109      */
SetRule(const ObjectLockRule & value)110     inline void SetRule(const ObjectLockRule& value) { m_ruleHasBeenSet = true; m_rule = value; }
111 
112     /**
113      * <p>Specifies the Object Lock rule for the specified object. Enable the this rule
114      * when you apply <code>ObjectLockConfiguration</code> to a bucket. Bucket settings
115      * require both a mode and a period. The period can be either <code>Days</code> or
116      * <code>Years</code> but you must select one. You cannot specify <code>Days</code>
117      * and <code>Years</code> at the same time.</p>
118      */
SetRule(ObjectLockRule && value)119     inline void SetRule(ObjectLockRule&& value) { m_ruleHasBeenSet = true; m_rule = std::move(value); }
120 
121     /**
122      * <p>Specifies the Object Lock rule for the specified object. Enable the this rule
123      * when you apply <code>ObjectLockConfiguration</code> to a bucket. Bucket settings
124      * require both a mode and a period. The period can be either <code>Days</code> or
125      * <code>Years</code> but you must select one. You cannot specify <code>Days</code>
126      * and <code>Years</code> at the same time.</p>
127      */
WithRule(const ObjectLockRule & value)128     inline ObjectLockConfiguration& WithRule(const ObjectLockRule& value) { SetRule(value); return *this;}
129 
130     /**
131      * <p>Specifies the Object Lock rule for the specified object. Enable the this rule
132      * when you apply <code>ObjectLockConfiguration</code> to a bucket. Bucket settings
133      * require both a mode and a period. The period can be either <code>Days</code> or
134      * <code>Years</code> but you must select one. You cannot specify <code>Days</code>
135      * and <code>Years</code> at the same time.</p>
136      */
WithRule(ObjectLockRule && value)137     inline ObjectLockConfiguration& WithRule(ObjectLockRule&& value) { SetRule(std::move(value)); return *this;}
138 
139   private:
140 
141     ObjectLockEnabled m_objectLockEnabled;
142     bool m_objectLockEnabledHasBeenSet;
143 
144     ObjectLockRule m_rule;
145     bool m_ruleHasBeenSet;
146   };
147 
148 } // namespace Model
149 } // namespace S3Crt
150 } // namespace Aws
151