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/core/utils/memory/stl/AWSVector.h>
10 #include <aws/s3-crt/model/NotificationConfigurationFilter.h>
11 #include <aws/s3-crt/model/Event.h>
12 #include <utility>
13 
14 namespace Aws
15 {
16 namespace Utils
17 {
18 namespace Xml
19 {
20   class XmlNode;
21 } // namespace Xml
22 } // namespace Utils
23 namespace S3Crt
24 {
25 namespace Model
26 {
27 
28   /**
29    * <p>A container for specifying the configuration for publication of messages to
30    * an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects
31    * specified events.</p><p><h3>See Also:</h3>   <a
32    * href="http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/TopicConfiguration">AWS
33    * API Reference</a></p>
34    */
35   class AWS_S3CRT_API TopicConfiguration
36   {
37   public:
38     TopicConfiguration();
39     TopicConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode);
40     TopicConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
41 
42     void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const;
43 
44 
45 
GetId()46     inline const Aws::String& GetId() const{ return m_id; }
47 
48 
IdHasBeenSet()49     inline bool IdHasBeenSet() const { return m_idHasBeenSet; }
50 
51 
SetId(const Aws::String & value)52     inline void SetId(const Aws::String& value) { m_idHasBeenSet = true; m_id = value; }
53 
54 
SetId(Aws::String && value)55     inline void SetId(Aws::String&& value) { m_idHasBeenSet = true; m_id = std::move(value); }
56 
57 
SetId(const char * value)58     inline void SetId(const char* value) { m_idHasBeenSet = true; m_id.assign(value); }
59 
60 
WithId(const Aws::String & value)61     inline TopicConfiguration& WithId(const Aws::String& value) { SetId(value); return *this;}
62 
63 
WithId(Aws::String && value)64     inline TopicConfiguration& WithId(Aws::String&& value) { SetId(std::move(value)); return *this;}
65 
66 
WithId(const char * value)67     inline TopicConfiguration& WithId(const char* value) { SetId(value); return *this;}
68 
69 
70     /**
71      * <p>The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3
72      * publishes a message when it detects events of the specified type.</p>
73      */
GetTopicArn()74     inline const Aws::String& GetTopicArn() const{ return m_topicArn; }
75 
76     /**
77      * <p>The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3
78      * publishes a message when it detects events of the specified type.</p>
79      */
TopicArnHasBeenSet()80     inline bool TopicArnHasBeenSet() const { return m_topicArnHasBeenSet; }
81 
82     /**
83      * <p>The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3
84      * publishes a message when it detects events of the specified type.</p>
85      */
SetTopicArn(const Aws::String & value)86     inline void SetTopicArn(const Aws::String& value) { m_topicArnHasBeenSet = true; m_topicArn = value; }
87 
88     /**
89      * <p>The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3
90      * publishes a message when it detects events of the specified type.</p>
91      */
SetTopicArn(Aws::String && value)92     inline void SetTopicArn(Aws::String&& value) { m_topicArnHasBeenSet = true; m_topicArn = std::move(value); }
93 
94     /**
95      * <p>The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3
96      * publishes a message when it detects events of the specified type.</p>
97      */
SetTopicArn(const char * value)98     inline void SetTopicArn(const char* value) { m_topicArnHasBeenSet = true; m_topicArn.assign(value); }
99 
100     /**
101      * <p>The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3
102      * publishes a message when it detects events of the specified type.</p>
103      */
WithTopicArn(const Aws::String & value)104     inline TopicConfiguration& WithTopicArn(const Aws::String& value) { SetTopicArn(value); return *this;}
105 
106     /**
107      * <p>The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3
108      * publishes a message when it detects events of the specified type.</p>
109      */
WithTopicArn(Aws::String && value)110     inline TopicConfiguration& WithTopicArn(Aws::String&& value) { SetTopicArn(std::move(value)); return *this;}
111 
112     /**
113      * <p>The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3
114      * publishes a message when it detects events of the specified type.</p>
115      */
WithTopicArn(const char * value)116     inline TopicConfiguration& WithTopicArn(const char* value) { SetTopicArn(value); return *this;}
117 
118 
119     /**
120      * <p>The Amazon S3 bucket event about which to send notifications. For more
121      * information, see <a
122      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Supported
123      * Event Types</a> in the <i>Amazon S3 User Guide</i>.</p>
124      */
GetEvents()125     inline const Aws::Vector<Event>& GetEvents() const{ return m_events; }
126 
127     /**
128      * <p>The Amazon S3 bucket event about which to send notifications. For more
129      * information, see <a
130      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Supported
131      * Event Types</a> in the <i>Amazon S3 User Guide</i>.</p>
132      */
EventsHasBeenSet()133     inline bool EventsHasBeenSet() const { return m_eventsHasBeenSet; }
134 
135     /**
136      * <p>The Amazon S3 bucket event about which to send notifications. For more
137      * information, see <a
138      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Supported
139      * Event Types</a> in the <i>Amazon S3 User Guide</i>.</p>
140      */
SetEvents(const Aws::Vector<Event> & value)141     inline void SetEvents(const Aws::Vector<Event>& value) { m_eventsHasBeenSet = true; m_events = value; }
142 
143     /**
144      * <p>The Amazon S3 bucket event about which to send notifications. For more
145      * information, see <a
146      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Supported
147      * Event Types</a> in the <i>Amazon S3 User Guide</i>.</p>
148      */
SetEvents(Aws::Vector<Event> && value)149     inline void SetEvents(Aws::Vector<Event>&& value) { m_eventsHasBeenSet = true; m_events = std::move(value); }
150 
151     /**
152      * <p>The Amazon S3 bucket event about which to send notifications. For more
153      * information, see <a
154      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Supported
155      * Event Types</a> in the <i>Amazon S3 User Guide</i>.</p>
156      */
WithEvents(const Aws::Vector<Event> & value)157     inline TopicConfiguration& WithEvents(const Aws::Vector<Event>& value) { SetEvents(value); return *this;}
158 
159     /**
160      * <p>The Amazon S3 bucket event about which to send notifications. For more
161      * information, see <a
162      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Supported
163      * Event Types</a> in the <i>Amazon S3 User Guide</i>.</p>
164      */
WithEvents(Aws::Vector<Event> && value)165     inline TopicConfiguration& WithEvents(Aws::Vector<Event>&& value) { SetEvents(std::move(value)); return *this;}
166 
167     /**
168      * <p>The Amazon S3 bucket event about which to send notifications. For more
169      * information, see <a
170      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Supported
171      * Event Types</a> in the <i>Amazon S3 User Guide</i>.</p>
172      */
AddEvents(const Event & value)173     inline TopicConfiguration& AddEvents(const Event& value) { m_eventsHasBeenSet = true; m_events.push_back(value); return *this; }
174 
175     /**
176      * <p>The Amazon S3 bucket event about which to send notifications. For more
177      * information, see <a
178      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Supported
179      * Event Types</a> in the <i>Amazon S3 User Guide</i>.</p>
180      */
AddEvents(Event && value)181     inline TopicConfiguration& AddEvents(Event&& value) { m_eventsHasBeenSet = true; m_events.push_back(std::move(value)); return *this; }
182 
183 
184 
GetFilter()185     inline const NotificationConfigurationFilter& GetFilter() const{ return m_filter; }
186 
187 
FilterHasBeenSet()188     inline bool FilterHasBeenSet() const { return m_filterHasBeenSet; }
189 
190 
SetFilter(const NotificationConfigurationFilter & value)191     inline void SetFilter(const NotificationConfigurationFilter& value) { m_filterHasBeenSet = true; m_filter = value; }
192 
193 
SetFilter(NotificationConfigurationFilter && value)194     inline void SetFilter(NotificationConfigurationFilter&& value) { m_filterHasBeenSet = true; m_filter = std::move(value); }
195 
196 
WithFilter(const NotificationConfigurationFilter & value)197     inline TopicConfiguration& WithFilter(const NotificationConfigurationFilter& value) { SetFilter(value); return *this;}
198 
199 
WithFilter(NotificationConfigurationFilter && value)200     inline TopicConfiguration& WithFilter(NotificationConfigurationFilter&& value) { SetFilter(std::move(value)); return *this;}
201 
202   private:
203 
204     Aws::String m_id;
205     bool m_idHasBeenSet;
206 
207     Aws::String m_topicArn;
208     bool m_topicArnHasBeenSet;
209 
210     Aws::Vector<Event> m_events;
211     bool m_eventsHasBeenSet;
212 
213     NotificationConfigurationFilter m_filter;
214     bool m_filterHasBeenSet;
215   };
216 
217 } // namespace Model
218 } // namespace S3Crt
219 } // namespace Aws
220