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/LifecycleRuleAndOperator.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>The <code>Filter</code> is used to identify objects that a Lifecycle Rule 29 * applies to. A <code>Filter</code> must have exactly one of <code>Prefix</code>, 30 * <code>Tag</code>, or <code>And</code> specified.</p><p><h3>See Also:</h3> <a 31 * href="http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LifecycleRuleFilter">AWS 32 * API Reference</a></p> 33 */ 34 class AWS_S3CRT_API LifecycleRuleFilter 35 { 36 public: 37 LifecycleRuleFilter(); 38 LifecycleRuleFilter(const Aws::Utils::Xml::XmlNode& xmlNode); 39 LifecycleRuleFilter& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); 40 41 void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; 42 43 44 /** 45 * <p>Prefix identifying one or more objects to which the rule applies.</p> 46 * <p>Replacement must be made for object keys containing special 47 * characters (such as carriage returns) when using XML requests. For more 48 * information, see <a 49 * href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints"> 50 * XML related object key constraints</a>.</p> 51 */ GetPrefix()52 inline const Aws::String& GetPrefix() const{ return m_prefix; } 53 54 /** 55 * <p>Prefix identifying one or more objects to which the rule applies.</p> 56 * <p>Replacement must be made for object keys containing special 57 * characters (such as carriage returns) when using XML requests. For more 58 * information, see <a 59 * href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints"> 60 * XML related object key constraints</a>.</p> 61 */ PrefixHasBeenSet()62 inline bool PrefixHasBeenSet() const { return m_prefixHasBeenSet; } 63 64 /** 65 * <p>Prefix identifying one or more objects to which the rule applies.</p> 66 * <p>Replacement must be made for object keys containing special 67 * characters (such as carriage returns) when using XML requests. For more 68 * information, see <a 69 * href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints"> 70 * XML related object key constraints</a>.</p> 71 */ SetPrefix(const Aws::String & value)72 inline void SetPrefix(const Aws::String& value) { m_prefixHasBeenSet = true; m_prefix = value; } 73 74 /** 75 * <p>Prefix identifying one or more objects to which the rule applies.</p> 76 * <p>Replacement must be made for object keys containing special 77 * characters (such as carriage returns) when using XML requests. For more 78 * information, see <a 79 * href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints"> 80 * XML related object key constraints</a>.</p> 81 */ SetPrefix(Aws::String && value)82 inline void SetPrefix(Aws::String&& value) { m_prefixHasBeenSet = true; m_prefix = std::move(value); } 83 84 /** 85 * <p>Prefix identifying one or more objects to which the rule applies.</p> 86 * <p>Replacement must be made for object keys containing special 87 * characters (such as carriage returns) when using XML requests. For more 88 * information, see <a 89 * href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints"> 90 * XML related object key constraints</a>.</p> 91 */ SetPrefix(const char * value)92 inline void SetPrefix(const char* value) { m_prefixHasBeenSet = true; m_prefix.assign(value); } 93 94 /** 95 * <p>Prefix identifying one or more objects to which the rule applies.</p> 96 * <p>Replacement must be made for object keys containing special 97 * characters (such as carriage returns) when using XML requests. For more 98 * information, see <a 99 * href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints"> 100 * XML related object key constraints</a>.</p> 101 */ WithPrefix(const Aws::String & value)102 inline LifecycleRuleFilter& WithPrefix(const Aws::String& value) { SetPrefix(value); return *this;} 103 104 /** 105 * <p>Prefix identifying one or more objects to which the rule applies.</p> 106 * <p>Replacement must be made for object keys containing special 107 * characters (such as carriage returns) when using XML requests. For more 108 * information, see <a 109 * href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints"> 110 * XML related object key constraints</a>.</p> 111 */ WithPrefix(Aws::String && value)112 inline LifecycleRuleFilter& WithPrefix(Aws::String&& value) { SetPrefix(std::move(value)); return *this;} 113 114 /** 115 * <p>Prefix identifying one or more objects to which the rule applies.</p> 116 * <p>Replacement must be made for object keys containing special 117 * characters (such as carriage returns) when using XML requests. For more 118 * information, see <a 119 * href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints"> 120 * XML related object key constraints</a>.</p> 121 */ WithPrefix(const char * value)122 inline LifecycleRuleFilter& WithPrefix(const char* value) { SetPrefix(value); return *this;} 123 124 125 /** 126 * <p>This tag must exist in the object's tag set in order for the rule to 127 * apply.</p> 128 */ GetTag()129 inline const Tag& GetTag() const{ return m_tag; } 130 131 /** 132 * <p>This tag must exist in the object's tag set in order for the rule to 133 * apply.</p> 134 */ TagHasBeenSet()135 inline bool TagHasBeenSet() const { return m_tagHasBeenSet; } 136 137 /** 138 * <p>This tag must exist in the object's tag set in order for the rule to 139 * apply.</p> 140 */ SetTag(const Tag & value)141 inline void SetTag(const Tag& value) { m_tagHasBeenSet = true; m_tag = value; } 142 143 /** 144 * <p>This tag must exist in the object's tag set in order for the rule to 145 * apply.</p> 146 */ SetTag(Tag && value)147 inline void SetTag(Tag&& value) { m_tagHasBeenSet = true; m_tag = std::move(value); } 148 149 /** 150 * <p>This tag must exist in the object's tag set in order for the rule to 151 * apply.</p> 152 */ WithTag(const Tag & value)153 inline LifecycleRuleFilter& WithTag(const Tag& value) { SetTag(value); return *this;} 154 155 /** 156 * <p>This tag must exist in the object's tag set in order for the rule to 157 * apply.</p> 158 */ WithTag(Tag && value)159 inline LifecycleRuleFilter& WithTag(Tag&& value) { SetTag(std::move(value)); return *this;} 160 161 162 GetAnd()163 inline const LifecycleRuleAndOperator& GetAnd() const{ return m_and; } 164 165 AndHasBeenSet()166 inline bool AndHasBeenSet() const { return m_andHasBeenSet; } 167 168 SetAnd(const LifecycleRuleAndOperator & value)169 inline void SetAnd(const LifecycleRuleAndOperator& value) { m_andHasBeenSet = true; m_and = value; } 170 171 SetAnd(LifecycleRuleAndOperator && value)172 inline void SetAnd(LifecycleRuleAndOperator&& value) { m_andHasBeenSet = true; m_and = std::move(value); } 173 174 WithAnd(const LifecycleRuleAndOperator & value)175 inline LifecycleRuleFilter& WithAnd(const LifecycleRuleAndOperator& value) { SetAnd(value); return *this;} 176 177 WithAnd(LifecycleRuleAndOperator && value)178 inline LifecycleRuleFilter& WithAnd(LifecycleRuleAndOperator&& value) { SetAnd(std::move(value)); return *this;} 179 180 private: 181 182 Aws::String m_prefix; 183 bool m_prefixHasBeenSet; 184 185 Tag m_tag; 186 bool m_tagHasBeenSet; 187 188 LifecycleRuleAndOperator m_and; 189 bool m_andHasBeenSet; 190 }; 191 192 } // namespace Model 193 } // namespace S3Crt 194 } // namespace Aws 195