aws_sdk_rds/operation/modify_event_subscription/
_modify_event_subscription_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p></p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ModifyEventSubscriptionInput {
7    /// <p>The name of the RDS event notification subscription.</p>
8    pub subscription_name: ::std::option::Option<::std::string::String>,
9    /// <p>The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by Amazon SNS when you create a topic and subscribe to it.</p>
10    pub sns_topic_arn: ::std::option::Option<::std::string::String>,
11    /// <p>The type of source that is generating the events. For example, if you want to be notified of events generated by a DB instance, you would set this parameter to db-instance. For RDS Proxy events, specify <code>db-proxy</code>. If this value isn't specified, all events are returned.</p>
12    /// <p>Valid Values:<code> db-instance | db-cluster | db-parameter-group | db-security-group | db-snapshot | db-cluster-snapshot | db-proxy | zero-etl | custom-engine-version | blue-green-deployment </code></p>
13    pub source_type: ::std::option::Option<::std::string::String>,
14    /// <p>A list of event categories for a source type (<code>SourceType</code>) that you want to subscribe to. You can see a list of the categories for a given source type in <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html">Events</a> in the <i>Amazon RDS User Guide</i> or by using the <code>DescribeEventCategories</code> operation.</p>
15    pub event_categories: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
16    /// <p>Specifies whether to activate the subscription.</p>
17    pub enabled: ::std::option::Option<bool>,
18}
19impl ModifyEventSubscriptionInput {
20    /// <p>The name of the RDS event notification subscription.</p>
21    pub fn subscription_name(&self) -> ::std::option::Option<&str> {
22        self.subscription_name.as_deref()
23    }
24    /// <p>The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by Amazon SNS when you create a topic and subscribe to it.</p>
25    pub fn sns_topic_arn(&self) -> ::std::option::Option<&str> {
26        self.sns_topic_arn.as_deref()
27    }
28    /// <p>The type of source that is generating the events. For example, if you want to be notified of events generated by a DB instance, you would set this parameter to db-instance. For RDS Proxy events, specify <code>db-proxy</code>. If this value isn't specified, all events are returned.</p>
29    /// <p>Valid Values:<code> db-instance | db-cluster | db-parameter-group | db-security-group | db-snapshot | db-cluster-snapshot | db-proxy | zero-etl | custom-engine-version | blue-green-deployment </code></p>
30    pub fn source_type(&self) -> ::std::option::Option<&str> {
31        self.source_type.as_deref()
32    }
33    /// <p>A list of event categories for a source type (<code>SourceType</code>) that you want to subscribe to. You can see a list of the categories for a given source type in <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html">Events</a> in the <i>Amazon RDS User Guide</i> or by using the <code>DescribeEventCategories</code> operation.</p>
34    ///
35    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.event_categories.is_none()`.
36    pub fn event_categories(&self) -> &[::std::string::String] {
37        self.event_categories.as_deref().unwrap_or_default()
38    }
39    /// <p>Specifies whether to activate the subscription.</p>
40    pub fn enabled(&self) -> ::std::option::Option<bool> {
41        self.enabled
42    }
43}
44impl ModifyEventSubscriptionInput {
45    /// Creates a new builder-style object to manufacture [`ModifyEventSubscriptionInput`](crate::operation::modify_event_subscription::ModifyEventSubscriptionInput).
46    pub fn builder() -> crate::operation::modify_event_subscription::builders::ModifyEventSubscriptionInputBuilder {
47        crate::operation::modify_event_subscription::builders::ModifyEventSubscriptionInputBuilder::default()
48    }
49}
50
51/// A builder for [`ModifyEventSubscriptionInput`](crate::operation::modify_event_subscription::ModifyEventSubscriptionInput).
52#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
53#[non_exhaustive]
54pub struct ModifyEventSubscriptionInputBuilder {
55    pub(crate) subscription_name: ::std::option::Option<::std::string::String>,
56    pub(crate) sns_topic_arn: ::std::option::Option<::std::string::String>,
57    pub(crate) source_type: ::std::option::Option<::std::string::String>,
58    pub(crate) event_categories: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
59    pub(crate) enabled: ::std::option::Option<bool>,
60}
61impl ModifyEventSubscriptionInputBuilder {
62    /// <p>The name of the RDS event notification subscription.</p>
63    /// This field is required.
64    pub fn subscription_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
65        self.subscription_name = ::std::option::Option::Some(input.into());
66        self
67    }
68    /// <p>The name of the RDS event notification subscription.</p>
69    pub fn set_subscription_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
70        self.subscription_name = input;
71        self
72    }
73    /// <p>The name of the RDS event notification subscription.</p>
74    pub fn get_subscription_name(&self) -> &::std::option::Option<::std::string::String> {
75        &self.subscription_name
76    }
77    /// <p>The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by Amazon SNS when you create a topic and subscribe to it.</p>
78    pub fn sns_topic_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
79        self.sns_topic_arn = ::std::option::Option::Some(input.into());
80        self
81    }
82    /// <p>The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by Amazon SNS when you create a topic and subscribe to it.</p>
83    pub fn set_sns_topic_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
84        self.sns_topic_arn = input;
85        self
86    }
87    /// <p>The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by Amazon SNS when you create a topic and subscribe to it.</p>
88    pub fn get_sns_topic_arn(&self) -> &::std::option::Option<::std::string::String> {
89        &self.sns_topic_arn
90    }
91    /// <p>The type of source that is generating the events. For example, if you want to be notified of events generated by a DB instance, you would set this parameter to db-instance. For RDS Proxy events, specify <code>db-proxy</code>. If this value isn't specified, all events are returned.</p>
92    /// <p>Valid Values:<code> db-instance | db-cluster | db-parameter-group | db-security-group | db-snapshot | db-cluster-snapshot | db-proxy | zero-etl | custom-engine-version | blue-green-deployment </code></p>
93    pub fn source_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        self.source_type = ::std::option::Option::Some(input.into());
95        self
96    }
97    /// <p>The type of source that is generating the events. For example, if you want to be notified of events generated by a DB instance, you would set this parameter to db-instance. For RDS Proxy events, specify <code>db-proxy</code>. If this value isn't specified, all events are returned.</p>
98    /// <p>Valid Values:<code> db-instance | db-cluster | db-parameter-group | db-security-group | db-snapshot | db-cluster-snapshot | db-proxy | zero-etl | custom-engine-version | blue-green-deployment </code></p>
99    pub fn set_source_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.source_type = input;
101        self
102    }
103    /// <p>The type of source that is generating the events. For example, if you want to be notified of events generated by a DB instance, you would set this parameter to db-instance. For RDS Proxy events, specify <code>db-proxy</code>. If this value isn't specified, all events are returned.</p>
104    /// <p>Valid Values:<code> db-instance | db-cluster | db-parameter-group | db-security-group | db-snapshot | db-cluster-snapshot | db-proxy | zero-etl | custom-engine-version | blue-green-deployment </code></p>
105    pub fn get_source_type(&self) -> &::std::option::Option<::std::string::String> {
106        &self.source_type
107    }
108    /// Appends an item to `event_categories`.
109    ///
110    /// To override the contents of this collection use [`set_event_categories`](Self::set_event_categories).
111    ///
112    /// <p>A list of event categories for a source type (<code>SourceType</code>) that you want to subscribe to. You can see a list of the categories for a given source type in <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html">Events</a> in the <i>Amazon RDS User Guide</i> or by using the <code>DescribeEventCategories</code> operation.</p>
113    pub fn event_categories(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        let mut v = self.event_categories.unwrap_or_default();
115        v.push(input.into());
116        self.event_categories = ::std::option::Option::Some(v);
117        self
118    }
119    /// <p>A list of event categories for a source type (<code>SourceType</code>) that you want to subscribe to. You can see a list of the categories for a given source type in <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html">Events</a> in the <i>Amazon RDS User Guide</i> or by using the <code>DescribeEventCategories</code> operation.</p>
120    pub fn set_event_categories(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
121        self.event_categories = input;
122        self
123    }
124    /// <p>A list of event categories for a source type (<code>SourceType</code>) that you want to subscribe to. You can see a list of the categories for a given source type in <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html">Events</a> in the <i>Amazon RDS User Guide</i> or by using the <code>DescribeEventCategories</code> operation.</p>
125    pub fn get_event_categories(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
126        &self.event_categories
127    }
128    /// <p>Specifies whether to activate the subscription.</p>
129    pub fn enabled(mut self, input: bool) -> Self {
130        self.enabled = ::std::option::Option::Some(input);
131        self
132    }
133    /// <p>Specifies whether to activate the subscription.</p>
134    pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
135        self.enabled = input;
136        self
137    }
138    /// <p>Specifies whether to activate the subscription.</p>
139    pub fn get_enabled(&self) -> &::std::option::Option<bool> {
140        &self.enabled
141    }
142    /// Consumes the builder and constructs a [`ModifyEventSubscriptionInput`](crate::operation::modify_event_subscription::ModifyEventSubscriptionInput).
143    pub fn build(
144        self,
145    ) -> ::std::result::Result<
146        crate::operation::modify_event_subscription::ModifyEventSubscriptionInput,
147        ::aws_smithy_types::error::operation::BuildError,
148    > {
149        ::std::result::Result::Ok(crate::operation::modify_event_subscription::ModifyEventSubscriptionInput {
150            subscription_name: self.subscription_name,
151            sns_topic_arn: self.sns_topic_arn,
152            source_type: self.source_type,
153            event_categories: self.event_categories,
154            enabled: self.enabled,
155        })
156    }
157}