aws_sdk_eventbridge/operation/create_event_bus/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_event_bus::_create_event_bus_output::CreateEventBusOutputBuilder;
3
4pub use crate::operation::create_event_bus::_create_event_bus_input::CreateEventBusInputBuilder;
5
6impl crate::operation::create_event_bus::builders::CreateEventBusInputBuilder {
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::create_event_bus::CreateEventBusOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_event_bus::CreateEventBusError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_event_bus();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateEventBus`.
24///
25/// <p>Creates a new event bus within your account. This can be a custom event bus which you can use to receive events from your custom applications and services, or it can be a partner event bus which can be matched to a partner event source.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateEventBusFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::create_event_bus::builders::CreateEventBusInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::create_event_bus::CreateEventBusOutput,
35 crate::operation::create_event_bus::CreateEventBusError,
36 > for CreateEventBusFluentBuilder
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::create_event_bus::CreateEventBusOutput,
44 crate::operation::create_event_bus::CreateEventBusError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl CreateEventBusFluentBuilder {
51 /// Creates a new `CreateEventBusFluentBuilder`.
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 CreateEventBus as a reference.
60 pub fn as_input(&self) -> &crate::operation::create_event_bus::builders::CreateEventBusInputBuilder {
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::create_event_bus::CreateEventBusOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::create_event_bus::CreateEventBusError,
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::create_event_bus::CreateEventBus::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::create_event_bus::CreateEventBus::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::create_event_bus::CreateEventBusOutput,
97 crate::operation::create_event_bus::CreateEventBusError,
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 new event bus.</p>
112 /// <p>Custom event bus names can't contain the <code>/</code> character, but you can use the <code>/</code> character in partner event bus names. In addition, for partner event buses, the name must exactly match the name of the partner event source that this event bus is matched to.</p>
113 /// <p>You can't use the name <code>default</code> for a custom event bus, as this name is already used for your account's default event bus.</p>
114 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.inner = self.inner.name(input.into());
116 self
117 }
118 /// <p>The name of the new event bus.</p>
119 /// <p>Custom event bus names can't contain the <code>/</code> character, but you can use the <code>/</code> character in partner event bus names. In addition, for partner event buses, the name must exactly match the name of the partner event source that this event bus is matched to.</p>
120 /// <p>You can't use the name <code>default</code> for a custom event bus, as this name is already used for your account's default event bus.</p>
121 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.inner = self.inner.set_name(input);
123 self
124 }
125 /// <p>The name of the new event bus.</p>
126 /// <p>Custom event bus names can't contain the <code>/</code> character, but you can use the <code>/</code> character in partner event bus names. In addition, for partner event buses, the name must exactly match the name of the partner event source that this event bus is matched to.</p>
127 /// <p>You can't use the name <code>default</code> for a custom event bus, as this name is already used for your account's default event bus.</p>
128 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
129 self.inner.get_name()
130 }
131 /// <p>If you are creating a partner event bus, this specifies the partner event source that the new event bus will be matched with.</p>
132 pub fn event_source_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133 self.inner = self.inner.event_source_name(input.into());
134 self
135 }
136 /// <p>If you are creating a partner event bus, this specifies the partner event source that the new event bus will be matched with.</p>
137 pub fn set_event_source_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138 self.inner = self.inner.set_event_source_name(input);
139 self
140 }
141 /// <p>If you are creating a partner event bus, this specifies the partner event source that the new event bus will be matched with.</p>
142 pub fn get_event_source_name(&self) -> &::std::option::Option<::std::string::String> {
143 self.inner.get_event_source_name()
144 }
145 /// <p>The event bus description.</p>
146 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147 self.inner = self.inner.description(input.into());
148 self
149 }
150 /// <p>The event bus description.</p>
151 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152 self.inner = self.inner.set_description(input);
153 self
154 }
155 /// <p>The event bus description.</p>
156 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
157 self.inner.get_description()
158 }
159 /// <p>The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt events on this event bus. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.</p>
160 /// <p>If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt events on the event bus.</p>
161 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html">Identify and view keys</a> in the <i>Key Management Service Developer Guide</i>.</p><note>
162 /// <p>Schema discovery is not supported for event buses encrypted using a customer managed key. EventBridge returns an error if:</p>
163 /// <ul>
164 /// <li>
165 /// <p>You call <code> <a href="https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-discoverers.html#CreateDiscoverer">CreateDiscoverer</a> </code> on an event bus set to use a customer managed key for encryption.</p></li>
166 /// <li>
167 /// <p>You call <code> <a href="https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_UpdatedEventBus.html">UpdatedEventBus</a> </code> to set a customer managed key on an event bus with schema discovery enabled.</p></li>
168 /// </ul>
169 /// <p>To enable schema discovery on an event bus, choose to use an Amazon Web Services owned key. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-encryption-event-bus-cmkey.html">Encrypting events</a> in the <i>Amazon EventBridge User Guide</i>.</p>
170 /// </note> <important>
171 /// <p>If you have specified that EventBridge use a customer managed key for encrypting the source event bus, we strongly recommend you also specify a customer managed key for any archives for the event bus as well.</p>
172 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/encryption-archives.html">Encrypting archives</a> in the <i>Amazon EventBridge User Guide</i>.</p>
173 /// </important>
174 pub fn kms_key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
175 self.inner = self.inner.kms_key_identifier(input.into());
176 self
177 }
178 /// <p>The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt events on this event bus. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.</p>
179 /// <p>If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt events on the event bus.</p>
180 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html">Identify and view keys</a> in the <i>Key Management Service Developer Guide</i>.</p><note>
181 /// <p>Schema discovery is not supported for event buses encrypted using a customer managed key. EventBridge returns an error if:</p>
182 /// <ul>
183 /// <li>
184 /// <p>You call <code> <a href="https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-discoverers.html#CreateDiscoverer">CreateDiscoverer</a> </code> on an event bus set to use a customer managed key for encryption.</p></li>
185 /// <li>
186 /// <p>You call <code> <a href="https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_UpdatedEventBus.html">UpdatedEventBus</a> </code> to set a customer managed key on an event bus with schema discovery enabled.</p></li>
187 /// </ul>
188 /// <p>To enable schema discovery on an event bus, choose to use an Amazon Web Services owned key. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-encryption-event-bus-cmkey.html">Encrypting events</a> in the <i>Amazon EventBridge User Guide</i>.</p>
189 /// </note> <important>
190 /// <p>If you have specified that EventBridge use a customer managed key for encrypting the source event bus, we strongly recommend you also specify a customer managed key for any archives for the event bus as well.</p>
191 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/encryption-archives.html">Encrypting archives</a> in the <i>Amazon EventBridge User Guide</i>.</p>
192 /// </important>
193 pub fn set_kms_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194 self.inner = self.inner.set_kms_key_identifier(input);
195 self
196 }
197 /// <p>The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt events on this event bus. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.</p>
198 /// <p>If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt events on the event bus.</p>
199 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html">Identify and view keys</a> in the <i>Key Management Service Developer Guide</i>.</p><note>
200 /// <p>Schema discovery is not supported for event buses encrypted using a customer managed key. EventBridge returns an error if:</p>
201 /// <ul>
202 /// <li>
203 /// <p>You call <code> <a href="https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-discoverers.html#CreateDiscoverer">CreateDiscoverer</a> </code> on an event bus set to use a customer managed key for encryption.</p></li>
204 /// <li>
205 /// <p>You call <code> <a href="https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_UpdatedEventBus.html">UpdatedEventBus</a> </code> to set a customer managed key on an event bus with schema discovery enabled.</p></li>
206 /// </ul>
207 /// <p>To enable schema discovery on an event bus, choose to use an Amazon Web Services owned key. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-encryption-event-bus-cmkey.html">Encrypting events</a> in the <i>Amazon EventBridge User Guide</i>.</p>
208 /// </note> <important>
209 /// <p>If you have specified that EventBridge use a customer managed key for encrypting the source event bus, we strongly recommend you also specify a customer managed key for any archives for the event bus as well.</p>
210 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/encryption-archives.html">Encrypting archives</a> in the <i>Amazon EventBridge User Guide</i>.</p>
211 /// </important>
212 pub fn get_kms_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
213 self.inner.get_kms_key_identifier()
214 }
215 /// <p>Configuration details of the Amazon SQS queue for EventBridge to use as a dead-letter queue (DLQ).</p>
216 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-rule-event-delivery.html#eb-rule-dlq">Using dead-letter queues to process undelivered events</a> in the <i>EventBridge User Guide</i>.</p>
217 pub fn dead_letter_config(mut self, input: crate::types::DeadLetterConfig) -> Self {
218 self.inner = self.inner.dead_letter_config(input);
219 self
220 }
221 /// <p>Configuration details of the Amazon SQS queue for EventBridge to use as a dead-letter queue (DLQ).</p>
222 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-rule-event-delivery.html#eb-rule-dlq">Using dead-letter queues to process undelivered events</a> in the <i>EventBridge User Guide</i>.</p>
223 pub fn set_dead_letter_config(mut self, input: ::std::option::Option<crate::types::DeadLetterConfig>) -> Self {
224 self.inner = self.inner.set_dead_letter_config(input);
225 self
226 }
227 /// <p>Configuration details of the Amazon SQS queue for EventBridge to use as a dead-letter queue (DLQ).</p>
228 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-rule-event-delivery.html#eb-rule-dlq">Using dead-letter queues to process undelivered events</a> in the <i>EventBridge User Guide</i>.</p>
229 pub fn get_dead_letter_config(&self) -> &::std::option::Option<crate::types::DeadLetterConfig> {
230 self.inner.get_dead_letter_config()
231 }
232 /// <p>The logging configuration settings for the event bus.</p>
233 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eb-event-bus-logs.html">Configuring logs for event buses</a> in the <i>EventBridge User Guide</i>.</p>
234 pub fn log_config(mut self, input: crate::types::LogConfig) -> Self {
235 self.inner = self.inner.log_config(input);
236 self
237 }
238 /// <p>The logging configuration settings for the event bus.</p>
239 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eb-event-bus-logs.html">Configuring logs for event buses</a> in the <i>EventBridge User Guide</i>.</p>
240 pub fn set_log_config(mut self, input: ::std::option::Option<crate::types::LogConfig>) -> Self {
241 self.inner = self.inner.set_log_config(input);
242 self
243 }
244 /// <p>The logging configuration settings for the event bus.</p>
245 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eb-event-bus-logs.html">Configuring logs for event buses</a> in the <i>EventBridge User Guide</i>.</p>
246 pub fn get_log_config(&self) -> &::std::option::Option<crate::types::LogConfig> {
247 self.inner.get_log_config()
248 }
249 ///
250 /// Appends an item to `Tags`.
251 ///
252 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
253 ///
254 /// <p>Tags to associate with the event bus.</p>
255 pub fn tags(mut self, input: crate::types::Tag) -> Self {
256 self.inner = self.inner.tags(input);
257 self
258 }
259 /// <p>Tags to associate with the event bus.</p>
260 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
261 self.inner = self.inner.set_tags(input);
262 self
263 }
264 /// <p>Tags to associate with the event bus.</p>
265 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
266 self.inner.get_tags()
267 }
268}