aws_sdk_workspacesweb/operation/create_session_logger/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_session_logger::_create_session_logger_output::CreateSessionLoggerOutputBuilder;
3
4pub use crate::operation::create_session_logger::_create_session_logger_input::CreateSessionLoggerInputBuilder;
5
6impl crate::operation::create_session_logger::builders::CreateSessionLoggerInputBuilder {
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_session_logger::CreateSessionLoggerOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_session_logger::CreateSessionLoggerError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_session_logger();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateSessionLogger`.
24///
25/// <p>Creates a session logger.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateSessionLoggerFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_session_logger::builders::CreateSessionLoggerInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_session_logger::CreateSessionLoggerOutput,
35        crate::operation::create_session_logger::CreateSessionLoggerError,
36    > for CreateSessionLoggerFluentBuilder
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_session_logger::CreateSessionLoggerOutput,
44            crate::operation::create_session_logger::CreateSessionLoggerError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateSessionLoggerFluentBuilder {
51    /// Creates a new `CreateSessionLoggerFluentBuilder`.
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 CreateSessionLogger as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_session_logger::builders::CreateSessionLoggerInputBuilder {
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_session_logger::CreateSessionLoggerOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_session_logger::CreateSessionLoggerError,
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_session_logger::CreateSessionLogger::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_session_logger::CreateSessionLogger::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_session_logger::CreateSessionLoggerOutput,
97        crate::operation::create_session_logger::CreateSessionLoggerError,
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 filter that specifies the events to monitor.</p>
112    pub fn event_filter(mut self, input: crate::types::EventFilter) -> Self {
113        self.inner = self.inner.event_filter(input);
114        self
115    }
116    /// <p>The filter that specifies the events to monitor.</p>
117    pub fn set_event_filter(mut self, input: ::std::option::Option<crate::types::EventFilter>) -> Self {
118        self.inner = self.inner.set_event_filter(input);
119        self
120    }
121    /// <p>The filter that specifies the events to monitor.</p>
122    pub fn get_event_filter(&self) -> &::std::option::Option<crate::types::EventFilter> {
123        self.inner.get_event_filter()
124    }
125    /// <p>The configuration that specifies where logs are delivered.</p>
126    pub fn log_configuration(mut self, input: crate::types::LogConfiguration) -> Self {
127        self.inner = self.inner.log_configuration(input);
128        self
129    }
130    /// <p>The configuration that specifies where logs are delivered.</p>
131    pub fn set_log_configuration(mut self, input: ::std::option::Option<crate::types::LogConfiguration>) -> Self {
132        self.inner = self.inner.set_log_configuration(input);
133        self
134    }
135    /// <p>The configuration that specifies where logs are delivered.</p>
136    pub fn get_log_configuration(&self) -> &::std::option::Option<crate::types::LogConfiguration> {
137        self.inner.get_log_configuration()
138    }
139    /// <p>The human-readable display name for the session logger resource.</p>
140    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.display_name(input.into());
142        self
143    }
144    /// <p>The human-readable display name for the session logger resource.</p>
145    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_display_name(input);
147        self
148    }
149    /// <p>The human-readable display name for the session logger resource.</p>
150    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_display_name()
152    }
153    /// <p>The custom managed key of the session logger.</p>
154    pub fn customer_managed_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.customer_managed_key(input.into());
156        self
157    }
158    /// <p>The custom managed key of the session logger.</p>
159    pub fn set_customer_managed_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_customer_managed_key(input);
161        self
162    }
163    /// <p>The custom managed key of the session logger.</p>
164    pub fn get_customer_managed_key(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_customer_managed_key()
166    }
167    ///
168    /// Adds a key-value pair to `additionalEncryptionContext`.
169    ///
170    /// To override the contents of this collection use [`set_additional_encryption_context`](Self::set_additional_encryption_context).
171    ///
172    /// <p>The additional encryption context of the session logger.</p>
173    pub fn additional_encryption_context(
174        mut self,
175        k: impl ::std::convert::Into<::std::string::String>,
176        v: impl ::std::convert::Into<::std::string::String>,
177    ) -> Self {
178        self.inner = self.inner.additional_encryption_context(k.into(), v.into());
179        self
180    }
181    /// <p>The additional encryption context of the session logger.</p>
182    pub fn set_additional_encryption_context(
183        mut self,
184        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
185    ) -> Self {
186        self.inner = self.inner.set_additional_encryption_context(input);
187        self
188    }
189    /// <p>The additional encryption context of the session logger.</p>
190    pub fn get_additional_encryption_context(
191        &self,
192    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
193        self.inner.get_additional_encryption_context()
194    }
195    ///
196    /// Appends an item to `tags`.
197    ///
198    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
199    ///
200    /// <p>The tags to add to the session logger.</p>
201    pub fn tags(mut self, input: crate::types::Tag) -> Self {
202        self.inner = self.inner.tags(input);
203        self
204    }
205    /// <p>The tags to add to the session logger.</p>
206    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
207        self.inner = self.inner.set_tags(input);
208        self
209    }
210    /// <p>The tags to add to the session logger.</p>
211    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
212        self.inner.get_tags()
213    }
214    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request. If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
215    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
216        self.inner = self.inner.client_token(input.into());
217        self
218    }
219    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request. If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
220    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221        self.inner = self.inner.set_client_token(input);
222        self
223    }
224    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request. If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
225    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
226        self.inner.get_client_token()
227    }
228}