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/core/utils/memory/stl/AWSString.h>
9 #include <aws/s3-crt/model/Tag.h>
10 #include <aws/s3-crt/model/ReplicationRuleAndOperator.h>
11 #include <utility>
12 
13 namespace Aws
14 {
15 namespace Utils
16 {
17 namespace Xml
18 {
19   class XmlNode;
20 } // namespace Xml
21 } // namespace Utils
22 namespace S3Crt
23 {
24 namespace Model
25 {
26 
27   /**
28    * <p>A filter that identifies the subset of objects to which the replication rule
29    * applies. A <code>Filter</code> must specify exactly one <code>Prefix</code>,
30    * <code>Tag</code>, or an <code>And</code> child element.</p><p><h3>See Also:</h3>
31    * <a
32    * href="http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ReplicationRuleFilter">AWS
33    * API Reference</a></p>
34    */
35   class AWS_S3CRT_API ReplicationRuleFilter
36   {
37   public:
38     ReplicationRuleFilter();
39     ReplicationRuleFilter(const Aws::Utils::Xml::XmlNode& xmlNode);
40     ReplicationRuleFilter& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
41 
42     void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const;
43 
44 
45     /**
46      * <p>An object key name prefix that identifies the subset of objects to which the
47      * rule applies.</p>  <p>Replacement must be made for object keys
48      * containing special characters (such as carriage returns) when using XML
49      * requests. For more information, see <a
50      * href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints">
51      * XML related object key constraints</a>.</p>
52      */
GetPrefix()53     inline const Aws::String& GetPrefix() const{ return m_prefix; }
54 
55     /**
56      * <p>An object key name prefix that identifies the subset of objects to which the
57      * rule applies.</p>  <p>Replacement must be made for object keys
58      * containing special characters (such as carriage returns) when using XML
59      * requests. For more information, see <a
60      * href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints">
61      * XML related object key constraints</a>.</p>
62      */
PrefixHasBeenSet()63     inline bool PrefixHasBeenSet() const { return m_prefixHasBeenSet; }
64 
65     /**
66      * <p>An object key name prefix that identifies the subset of objects to which the
67      * rule applies.</p>  <p>Replacement must be made for object keys
68      * containing special characters (such as carriage returns) when using XML
69      * requests. For more information, see <a
70      * href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints">
71      * XML related object key constraints</a>.</p>
72      */
SetPrefix(const Aws::String & value)73     inline void SetPrefix(const Aws::String& value) { m_prefixHasBeenSet = true; m_prefix = value; }
74 
75     /**
76      * <p>An object key name prefix that identifies the subset of objects to which the
77      * rule applies.</p>  <p>Replacement must be made for object keys
78      * containing special characters (such as carriage returns) when using XML
79      * requests. For more information, see <a
80      * href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints">
81      * XML related object key constraints</a>.</p>
82      */
SetPrefix(Aws::String && value)83     inline void SetPrefix(Aws::String&& value) { m_prefixHasBeenSet = true; m_prefix = std::move(value); }
84 
85     /**
86      * <p>An object key name prefix that identifies the subset of objects to which the
87      * rule applies.</p>  <p>Replacement must be made for object keys
88      * containing special characters (such as carriage returns) when using XML
89      * requests. For more information, see <a
90      * href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints">
91      * XML related object key constraints</a>.</p>
92      */
SetPrefix(const char * value)93     inline void SetPrefix(const char* value) { m_prefixHasBeenSet = true; m_prefix.assign(value); }
94 
95     /**
96      * <p>An object key name prefix that identifies the subset of objects to which the
97      * rule applies.</p>  <p>Replacement must be made for object keys
98      * containing special characters (such as carriage returns) when using XML
99      * requests. For more information, see <a
100      * href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints">
101      * XML related object key constraints</a>.</p>
102      */
WithPrefix(const Aws::String & value)103     inline ReplicationRuleFilter& WithPrefix(const Aws::String& value) { SetPrefix(value); return *this;}
104 
105     /**
106      * <p>An object key name prefix that identifies the subset of objects to which the
107      * rule applies.</p>  <p>Replacement must be made for object keys
108      * containing special characters (such as carriage returns) when using XML
109      * requests. For more information, see <a
110      * href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints">
111      * XML related object key constraints</a>.</p>
112      */
WithPrefix(Aws::String && value)113     inline ReplicationRuleFilter& WithPrefix(Aws::String&& value) { SetPrefix(std::move(value)); return *this;}
114 
115     /**
116      * <p>An object key name prefix that identifies the subset of objects to which the
117      * rule applies.</p>  <p>Replacement must be made for object keys
118      * containing special characters (such as carriage returns) when using XML
119      * requests. For more information, see <a
120      * href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints">
121      * XML related object key constraints</a>.</p>
122      */
WithPrefix(const char * value)123     inline ReplicationRuleFilter& WithPrefix(const char* value) { SetPrefix(value); return *this;}
124 
125 
126     /**
127      * <p>A container for specifying a tag key and value. </p> <p>The rule applies only
128      * to objects that have the tag in their tag set.</p>
129      */
GetTag()130     inline const Tag& GetTag() const{ return m_tag; }
131 
132     /**
133      * <p>A container for specifying a tag key and value. </p> <p>The rule applies only
134      * to objects that have the tag in their tag set.</p>
135      */
TagHasBeenSet()136     inline bool TagHasBeenSet() const { return m_tagHasBeenSet; }
137 
138     /**
139      * <p>A container for specifying a tag key and value. </p> <p>The rule applies only
140      * to objects that have the tag in their tag set.</p>
141      */
SetTag(const Tag & value)142     inline void SetTag(const Tag& value) { m_tagHasBeenSet = true; m_tag = value; }
143 
144     /**
145      * <p>A container for specifying a tag key and value. </p> <p>The rule applies only
146      * to objects that have the tag in their tag set.</p>
147      */
SetTag(Tag && value)148     inline void SetTag(Tag&& value) { m_tagHasBeenSet = true; m_tag = std::move(value); }
149 
150     /**
151      * <p>A container for specifying a tag key and value. </p> <p>The rule applies only
152      * to objects that have the tag in their tag set.</p>
153      */
WithTag(const Tag & value)154     inline ReplicationRuleFilter& WithTag(const Tag& value) { SetTag(value); return *this;}
155 
156     /**
157      * <p>A container for specifying a tag key and value. </p> <p>The rule applies only
158      * to objects that have the tag in their tag set.</p>
159      */
WithTag(Tag && value)160     inline ReplicationRuleFilter& WithTag(Tag&& value) { SetTag(std::move(value)); return *this;}
161 
162 
163     /**
164      * <p>A container for specifying rule filters. The filters determine the subset of
165      * objects to which the rule applies. This element is required only if you specify
166      * more than one filter. For example: </p> <ul> <li> <p>If you specify both a
167      * <code>Prefix</code> and a <code>Tag</code> filter, wrap these filters in an
168      * <code>And</code> tag.</p> </li> <li> <p>If you specify a filter based on
169      * multiple tags, wrap the <code>Tag</code> elements in an <code>And</code>
170      * tag.</p> </li> </ul>
171      */
GetAnd()172     inline const ReplicationRuleAndOperator& GetAnd() const{ return m_and; }
173 
174     /**
175      * <p>A container for specifying rule filters. The filters determine the subset of
176      * objects to which the rule applies. This element is required only if you specify
177      * more than one filter. For example: </p> <ul> <li> <p>If you specify both a
178      * <code>Prefix</code> and a <code>Tag</code> filter, wrap these filters in an
179      * <code>And</code> tag.</p> </li> <li> <p>If you specify a filter based on
180      * multiple tags, wrap the <code>Tag</code> elements in an <code>And</code>
181      * tag.</p> </li> </ul>
182      */
AndHasBeenSet()183     inline bool AndHasBeenSet() const { return m_andHasBeenSet; }
184 
185     /**
186      * <p>A container for specifying rule filters. The filters determine the subset of
187      * objects to which the rule applies. This element is required only if you specify
188      * more than one filter. For example: </p> <ul> <li> <p>If you specify both a
189      * <code>Prefix</code> and a <code>Tag</code> filter, wrap these filters in an
190      * <code>And</code> tag.</p> </li> <li> <p>If you specify a filter based on
191      * multiple tags, wrap the <code>Tag</code> elements in an <code>And</code>
192      * tag.</p> </li> </ul>
193      */
SetAnd(const ReplicationRuleAndOperator & value)194     inline void SetAnd(const ReplicationRuleAndOperator& value) { m_andHasBeenSet = true; m_and = value; }
195 
196     /**
197      * <p>A container for specifying rule filters. The filters determine the subset of
198      * objects to which the rule applies. This element is required only if you specify
199      * more than one filter. For example: </p> <ul> <li> <p>If you specify both a
200      * <code>Prefix</code> and a <code>Tag</code> filter, wrap these filters in an
201      * <code>And</code> tag.</p> </li> <li> <p>If you specify a filter based on
202      * multiple tags, wrap the <code>Tag</code> elements in an <code>And</code>
203      * tag.</p> </li> </ul>
204      */
SetAnd(ReplicationRuleAndOperator && value)205     inline void SetAnd(ReplicationRuleAndOperator&& value) { m_andHasBeenSet = true; m_and = std::move(value); }
206 
207     /**
208      * <p>A container for specifying rule filters. The filters determine the subset of
209      * objects to which the rule applies. This element is required only if you specify
210      * more than one filter. For example: </p> <ul> <li> <p>If you specify both a
211      * <code>Prefix</code> and a <code>Tag</code> filter, wrap these filters in an
212      * <code>And</code> tag.</p> </li> <li> <p>If you specify a filter based on
213      * multiple tags, wrap the <code>Tag</code> elements in an <code>And</code>
214      * tag.</p> </li> </ul>
215      */
WithAnd(const ReplicationRuleAndOperator & value)216     inline ReplicationRuleFilter& WithAnd(const ReplicationRuleAndOperator& value) { SetAnd(value); return *this;}
217 
218     /**
219      * <p>A container for specifying rule filters. The filters determine the subset of
220      * objects to which the rule applies. This element is required only if you specify
221      * more than one filter. For example: </p> <ul> <li> <p>If you specify both a
222      * <code>Prefix</code> and a <code>Tag</code> filter, wrap these filters in an
223      * <code>And</code> tag.</p> </li> <li> <p>If you specify a filter based on
224      * multiple tags, wrap the <code>Tag</code> elements in an <code>And</code>
225      * tag.</p> </li> </ul>
226      */
WithAnd(ReplicationRuleAndOperator && value)227     inline ReplicationRuleFilter& WithAnd(ReplicationRuleAndOperator&& value) { SetAnd(std::move(value)); return *this;}
228 
229   private:
230 
231     Aws::String m_prefix;
232     bool m_prefixHasBeenSet;
233 
234     Tag m_tag;
235     bool m_tagHasBeenSet;
236 
237     ReplicationRuleAndOperator m_and;
238     bool m_andHasBeenSet;
239   };
240 
241 } // namespace Model
242 } // namespace S3Crt
243 } // namespace Aws
244