aws_sdk_redshift/operation/modify_event_subscription/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::modify_event_subscription::_modify_event_subscription_output::ModifyEventSubscriptionOutputBuilder;
3
4pub use crate::operation::modify_event_subscription::_modify_event_subscription_input::ModifyEventSubscriptionInputBuilder;
5
6impl crate::operation::modify_event_subscription::builders::ModifyEventSubscriptionInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::modify_event_subscription::ModifyEventSubscriptionOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::modify_event_subscription::ModifyEventSubscriptionError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.modify_event_subscription();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ModifyEventSubscription`.
24///
25/// <p>Modifies an existing Amazon Redshift event notification subscription.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ModifyEventSubscriptionFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::modify_event_subscription::builders::ModifyEventSubscriptionInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::modify_event_subscription::ModifyEventSubscriptionOutput,
35 crate::operation::modify_event_subscription::ModifyEventSubscriptionError,
36 > for ModifyEventSubscriptionFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::modify_event_subscription::ModifyEventSubscriptionOutput,
44 crate::operation::modify_event_subscription::ModifyEventSubscriptionError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl ModifyEventSubscriptionFluentBuilder {
51 /// Creates a new `ModifyEventSubscriptionFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the ModifyEventSubscription as a reference.
60 pub fn as_input(&self) -> &crate::operation::modify_event_subscription::builders::ModifyEventSubscriptionInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::modify_event_subscription::ModifyEventSubscriptionOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::modify_event_subscription::ModifyEventSubscriptionError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::modify_event_subscription::ModifyEventSubscription::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::modify_event_subscription::ModifyEventSubscription::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::modify_event_subscription::ModifyEventSubscriptionOutput,
97 crate::operation::modify_event_subscription::ModifyEventSubscriptionError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// <p>The name of the modified Amazon Redshift event notification subscription.</p>
112 pub fn subscription_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.subscription_name(input.into());
114 self
115 }
116 /// <p>The name of the modified Amazon Redshift event notification subscription.</p>
117 pub fn set_subscription_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_subscription_name(input);
119 self
120 }
121 /// <p>The name of the modified Amazon Redshift event notification subscription.</p>
122 pub fn get_subscription_name(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_subscription_name()
124 }
125 /// <p>The Amazon Resource Name (ARN) of the SNS topic to be used by the event notification subscription.</p>
126 pub fn sns_topic_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127 self.inner = self.inner.sns_topic_arn(input.into());
128 self
129 }
130 /// <p>The Amazon Resource Name (ARN) of the SNS topic to be used by the event notification subscription.</p>
131 pub fn set_sns_topic_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132 self.inner = self.inner.set_sns_topic_arn(input);
133 self
134 }
135 /// <p>The Amazon Resource Name (ARN) of the SNS topic to be used by the event notification subscription.</p>
136 pub fn get_sns_topic_arn(&self) -> &::std::option::Option<::std::string::String> {
137 self.inner.get_sns_topic_arn()
138 }
139 /// <p>The type of source that will be generating the events. For example, if you want to be notified of events generated by a cluster, you would set this parameter to cluster. If this value is not specified, events are returned for all Amazon Redshift objects in your Amazon Web Services account. You must specify a source type in order to specify source IDs.</p>
140 /// <p>Valid values: cluster, cluster-parameter-group, cluster-security-group, cluster-snapshot, and scheduled-action.</p>
141 pub fn source_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142 self.inner = self.inner.source_type(input.into());
143 self
144 }
145 /// <p>The type of source that will be generating the events. For example, if you want to be notified of events generated by a cluster, you would set this parameter to cluster. If this value is not specified, events are returned for all Amazon Redshift objects in your Amazon Web Services account. You must specify a source type in order to specify source IDs.</p>
146 /// <p>Valid values: cluster, cluster-parameter-group, cluster-security-group, cluster-snapshot, and scheduled-action.</p>
147 pub fn set_source_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148 self.inner = self.inner.set_source_type(input);
149 self
150 }
151 /// <p>The type of source that will be generating the events. For example, if you want to be notified of events generated by a cluster, you would set this parameter to cluster. If this value is not specified, events are returned for all Amazon Redshift objects in your Amazon Web Services account. You must specify a source type in order to specify source IDs.</p>
152 /// <p>Valid values: cluster, cluster-parameter-group, cluster-security-group, cluster-snapshot, and scheduled-action.</p>
153 pub fn get_source_type(&self) -> &::std::option::Option<::std::string::String> {
154 self.inner.get_source_type()
155 }
156 ///
157 /// Appends an item to `SourceIds`.
158 ///
159 /// To override the contents of this collection use [`set_source_ids`](Self::set_source_ids).
160 ///
161 /// <p>A list of one or more identifiers of Amazon Redshift source objects. All of the objects must be of the same type as was specified in the source type parameter. The event subscription will return only events generated by the specified objects. If not specified, then events are returned for all objects within the source type specified.</p>
162 /// <p>Example: my-cluster-1, my-cluster-2</p>
163 /// <p>Example: my-snapshot-20131010</p>
164 pub fn source_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165 self.inner = self.inner.source_ids(input.into());
166 self
167 }
168 /// <p>A list of one or more identifiers of Amazon Redshift source objects. All of the objects must be of the same type as was specified in the source type parameter. The event subscription will return only events generated by the specified objects. If not specified, then events are returned for all objects within the source type specified.</p>
169 /// <p>Example: my-cluster-1, my-cluster-2</p>
170 /// <p>Example: my-snapshot-20131010</p>
171 pub fn set_source_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
172 self.inner = self.inner.set_source_ids(input);
173 self
174 }
175 /// <p>A list of one or more identifiers of Amazon Redshift source objects. All of the objects must be of the same type as was specified in the source type parameter. The event subscription will return only events generated by the specified objects. If not specified, then events are returned for all objects within the source type specified.</p>
176 /// <p>Example: my-cluster-1, my-cluster-2</p>
177 /// <p>Example: my-snapshot-20131010</p>
178 pub fn get_source_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
179 self.inner.get_source_ids()
180 }
181 ///
182 /// Appends an item to `EventCategories`.
183 ///
184 /// To override the contents of this collection use [`set_event_categories`](Self::set_event_categories).
185 ///
186 /// <p>Specifies the Amazon Redshift event categories to be published by the event notification subscription.</p>
187 /// <p>Values: configuration, management, monitoring, security, pending</p>
188 pub fn event_categories(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
189 self.inner = self.inner.event_categories(input.into());
190 self
191 }
192 /// <p>Specifies the Amazon Redshift event categories to be published by the event notification subscription.</p>
193 /// <p>Values: configuration, management, monitoring, security, pending</p>
194 pub fn set_event_categories(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
195 self.inner = self.inner.set_event_categories(input);
196 self
197 }
198 /// <p>Specifies the Amazon Redshift event categories to be published by the event notification subscription.</p>
199 /// <p>Values: configuration, management, monitoring, security, pending</p>
200 pub fn get_event_categories(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
201 self.inner.get_event_categories()
202 }
203 /// <p>Specifies the Amazon Redshift event severity to be published by the event notification subscription.</p>
204 /// <p>Values: ERROR, INFO</p>
205 pub fn severity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
206 self.inner = self.inner.severity(input.into());
207 self
208 }
209 /// <p>Specifies the Amazon Redshift event severity to be published by the event notification subscription.</p>
210 /// <p>Values: ERROR, INFO</p>
211 pub fn set_severity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212 self.inner = self.inner.set_severity(input);
213 self
214 }
215 /// <p>Specifies the Amazon Redshift event severity to be published by the event notification subscription.</p>
216 /// <p>Values: ERROR, INFO</p>
217 pub fn get_severity(&self) -> &::std::option::Option<::std::string::String> {
218 self.inner.get_severity()
219 }
220 /// <p>A Boolean value indicating if the subscription is enabled. <code>true</code> indicates the subscription is enabled</p>
221 pub fn enabled(mut self, input: bool) -> Self {
222 self.inner = self.inner.enabled(input);
223 self
224 }
225 /// <p>A Boolean value indicating if the subscription is enabled. <code>true</code> indicates the subscription is enabled</p>
226 pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
227 self.inner = self.inner.set_enabled(input);
228 self
229 }
230 /// <p>A Boolean value indicating if the subscription is enabled. <code>true</code> indicates the subscription is enabled</p>
231 pub fn get_enabled(&self) -> &::std::option::Option<bool> {
232 self.inner.get_enabled()
233 }
234}