aws_sdk_cloudtrail/operation/get_event_selectors/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_event_selectors::_get_event_selectors_output::GetEventSelectorsOutputBuilder;
3
4pub use crate::operation::get_event_selectors::_get_event_selectors_input::GetEventSelectorsInputBuilder;
5
6impl crate::operation::get_event_selectors::builders::GetEventSelectorsInputBuilder {
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::get_event_selectors::GetEventSelectorsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::get_event_selectors::GetEventSelectorsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.get_event_selectors();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `GetEventSelectors`.
24///
25/// <p>Describes the settings for the event selectors that you configured for your trail. The information returned for your event selectors includes the following:</p>
26/// <ul>
27/// <li>
28/// <p>If your event selector includes read-only events, write-only events, or all events. This applies to management events, data events, and network activity events.</p></li>
29/// <li>
30/// <p>If your event selector includes management events.</p></li>
31/// <li>
32/// <p>If your event selector includes network activity events, the event sources for which you are logging network activity events.</p></li>
33/// <li>
34/// <p>If your event selector includes data events, the resources on which you are logging data events.</p></li>
35/// </ul>
36/// <p>For more information about logging management, data, and network activity events, see the following topics in the <i>CloudTrail User Guide</i>:</p>
37/// <ul>
38/// <li>
39/// <p><a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html">Logging management events</a></p></li>
40/// <li>
41/// <p><a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html">Logging data events</a></p></li>
42/// <li>
43/// <p><a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-network-events-with-cloudtrail.html">Logging network activity events</a></p></li>
44/// </ul>
45#[derive(::std::clone::Clone, ::std::fmt::Debug)]
46pub struct GetEventSelectorsFluentBuilder {
47 handle: ::std::sync::Arc<crate::client::Handle>,
48 inner: crate::operation::get_event_selectors::builders::GetEventSelectorsInputBuilder,
49 config_override: ::std::option::Option<crate::config::Builder>,
50}
51impl
52 crate::client::customize::internal::CustomizableSend<
53 crate::operation::get_event_selectors::GetEventSelectorsOutput,
54 crate::operation::get_event_selectors::GetEventSelectorsError,
55 > for GetEventSelectorsFluentBuilder
56{
57 fn send(
58 self,
59 config_override: crate::config::Builder,
60 ) -> crate::client::customize::internal::BoxFuture<
61 crate::client::customize::internal::SendResult<
62 crate::operation::get_event_selectors::GetEventSelectorsOutput,
63 crate::operation::get_event_selectors::GetEventSelectorsError,
64 >,
65 > {
66 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
67 }
68}
69impl GetEventSelectorsFluentBuilder {
70 /// Creates a new `GetEventSelectorsFluentBuilder`.
71 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
72 Self {
73 handle,
74 inner: ::std::default::Default::default(),
75 config_override: ::std::option::Option::None,
76 }
77 }
78 /// Access the GetEventSelectors as a reference.
79 pub fn as_input(&self) -> &crate::operation::get_event_selectors::builders::GetEventSelectorsInputBuilder {
80 &self.inner
81 }
82 /// Sends the request and returns the response.
83 ///
84 /// If an error occurs, an `SdkError` will be returned with additional details that
85 /// can be matched against.
86 ///
87 /// By default, any retryable failures will be retried twice. Retry behavior
88 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
89 /// set when configuring the client.
90 pub async fn send(
91 self,
92 ) -> ::std::result::Result<
93 crate::operation::get_event_selectors::GetEventSelectorsOutput,
94 ::aws_smithy_runtime_api::client::result::SdkError<
95 crate::operation::get_event_selectors::GetEventSelectorsError,
96 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
97 >,
98 > {
99 let input = self
100 .inner
101 .build()
102 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
103 let runtime_plugins = crate::operation::get_event_selectors::GetEventSelectors::operation_runtime_plugins(
104 self.handle.runtime_plugins.clone(),
105 &self.handle.conf,
106 self.config_override,
107 );
108 crate::operation::get_event_selectors::GetEventSelectors::orchestrate(&runtime_plugins, input).await
109 }
110
111 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
112 pub fn customize(
113 self,
114 ) -> crate::client::customize::CustomizableOperation<
115 crate::operation::get_event_selectors::GetEventSelectorsOutput,
116 crate::operation::get_event_selectors::GetEventSelectorsError,
117 Self,
118 > {
119 crate::client::customize::CustomizableOperation::new(self)
120 }
121 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
122 self.set_config_override(::std::option::Option::Some(config_override.into()));
123 self
124 }
125
126 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
127 self.config_override = config_override;
128 self
129 }
130 /// <p>Specifies the name of the trail or trail ARN. If you specify a trail name, the string must meet the following requirements:</p>
131 /// <ul>
132 /// <li>
133 /// <p>Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)</p></li>
134 /// <li>
135 /// <p>Start with a letter or number, and end with a letter or number</p></li>
136 /// <li>
137 /// <p>Be between 3 and 128 characters</p></li>
138 /// <li>
139 /// <p>Have no adjacent periods, underscores or dashes. Names like <code>my-_namespace</code> and <code>my--namespace</code> are not valid.</p></li>
140 /// <li>
141 /// <p>Not be in IP address format (for example, 192.168.5.4)</p></li>
142 /// </ul>
143 /// <p>If you specify a trail ARN, it must be in the format:</p>
144 /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
145 pub fn trail_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146 self.inner = self.inner.trail_name(input.into());
147 self
148 }
149 /// <p>Specifies the name of the trail or trail ARN. If you specify a trail name, the string must meet the following requirements:</p>
150 /// <ul>
151 /// <li>
152 /// <p>Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)</p></li>
153 /// <li>
154 /// <p>Start with a letter or number, and end with a letter or number</p></li>
155 /// <li>
156 /// <p>Be between 3 and 128 characters</p></li>
157 /// <li>
158 /// <p>Have no adjacent periods, underscores or dashes. Names like <code>my-_namespace</code> and <code>my--namespace</code> are not valid.</p></li>
159 /// <li>
160 /// <p>Not be in IP address format (for example, 192.168.5.4)</p></li>
161 /// </ul>
162 /// <p>If you specify a trail ARN, it must be in the format:</p>
163 /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
164 pub fn set_trail_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165 self.inner = self.inner.set_trail_name(input);
166 self
167 }
168 /// <p>Specifies the name of the trail or trail ARN. If you specify a trail name, the string must meet the following requirements:</p>
169 /// <ul>
170 /// <li>
171 /// <p>Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)</p></li>
172 /// <li>
173 /// <p>Start with a letter or number, and end with a letter or number</p></li>
174 /// <li>
175 /// <p>Be between 3 and 128 characters</p></li>
176 /// <li>
177 /// <p>Have no adjacent periods, underscores or dashes. Names like <code>my-_namespace</code> and <code>my--namespace</code> are not valid.</p></li>
178 /// <li>
179 /// <p>Not be in IP address format (for example, 192.168.5.4)</p></li>
180 /// </ul>
181 /// <p>If you specify a trail ARN, it must be in the format:</p>
182 /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
183 pub fn get_trail_name(&self) -> &::std::option::Option<::std::string::String> {
184 self.inner.get_trail_name()
185 }
186}