aws_sdk_redshift/operation/enable_logging/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::enable_logging::_enable_logging_output::EnableLoggingOutputBuilder;
3
4pub use crate::operation::enable_logging::_enable_logging_input::EnableLoggingInputBuilder;
5
6impl crate::operation::enable_logging::builders::EnableLoggingInputBuilder {
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::enable_logging::EnableLoggingOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::enable_logging::EnableLoggingError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.enable_logging();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `EnableLogging`.
24///
25/// <p>Starts logging information, such as queries and connection attempts, for the specified Amazon Redshift cluster.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct EnableLoggingFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::enable_logging::builders::EnableLoggingInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::enable_logging::EnableLoggingOutput,
35        crate::operation::enable_logging::EnableLoggingError,
36    > for EnableLoggingFluentBuilder
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::enable_logging::EnableLoggingOutput,
44            crate::operation::enable_logging::EnableLoggingError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl EnableLoggingFluentBuilder {
51    /// Creates a new `EnableLoggingFluentBuilder`.
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 EnableLogging as a reference.
60    pub fn as_input(&self) -> &crate::operation::enable_logging::builders::EnableLoggingInputBuilder {
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::enable_logging::EnableLoggingOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::enable_logging::EnableLoggingError,
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::enable_logging::EnableLogging::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::enable_logging::EnableLogging::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::enable_logging::EnableLoggingOutput,
97        crate::operation::enable_logging::EnableLoggingError,
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 identifier of the cluster on which logging is to be started.</p>
112    /// <p>Example: <code>examplecluster</code></p>
113    pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.cluster_identifier(input.into());
115        self
116    }
117    /// <p>The identifier of the cluster on which logging is to be started.</p>
118    /// <p>Example: <code>examplecluster</code></p>
119    pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_cluster_identifier(input);
121        self
122    }
123    /// <p>The identifier of the cluster on which logging is to be started.</p>
124    /// <p>Example: <code>examplecluster</code></p>
125    pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_cluster_identifier()
127    }
128    /// <p>The name of an existing S3 bucket where the log files are to be stored.</p>
129    /// <p>Constraints:</p>
130    /// <ul>
131    /// <li>
132    /// <p>Must be in the same region as the cluster</p></li>
133    /// <li>
134    /// <p>The cluster must have read bucket and put object permissions</p></li>
135    /// </ul>
136    pub fn bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.inner = self.inner.bucket_name(input.into());
138        self
139    }
140    /// <p>The name of an existing S3 bucket where the log files are to be stored.</p>
141    /// <p>Constraints:</p>
142    /// <ul>
143    /// <li>
144    /// <p>Must be in the same region as the cluster</p></li>
145    /// <li>
146    /// <p>The cluster must have read bucket and put object permissions</p></li>
147    /// </ul>
148    pub fn set_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_bucket_name(input);
150        self
151    }
152    /// <p>The name of an existing S3 bucket where the log files are to be stored.</p>
153    /// <p>Constraints:</p>
154    /// <ul>
155    /// <li>
156    /// <p>Must be in the same region as the cluster</p></li>
157    /// <li>
158    /// <p>The cluster must have read bucket and put object permissions</p></li>
159    /// </ul>
160    pub fn get_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
161        self.inner.get_bucket_name()
162    }
163    /// <p>The prefix applied to the log file names.</p>
164    /// <p>Valid characters are any letter from any language, any whitespace character, any numeric character, and the following characters: underscore (<code>_</code>), period (<code>.</code>), colon (<code>:</code>), slash (<code>/</code>), equal (<code>=</code>), plus (<code>+</code>), backslash (<code>\</code>), hyphen (<code>-</code>), at symbol (<code>@</code>).</p>
165    pub fn s3_key_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166        self.inner = self.inner.s3_key_prefix(input.into());
167        self
168    }
169    /// <p>The prefix applied to the log file names.</p>
170    /// <p>Valid characters are any letter from any language, any whitespace character, any numeric character, and the following characters: underscore (<code>_</code>), period (<code>.</code>), colon (<code>:</code>), slash (<code>/</code>), equal (<code>=</code>), plus (<code>+</code>), backslash (<code>\</code>), hyphen (<code>-</code>), at symbol (<code>@</code>).</p>
171    pub fn set_s3_key_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.inner = self.inner.set_s3_key_prefix(input);
173        self
174    }
175    /// <p>The prefix applied to the log file names.</p>
176    /// <p>Valid characters are any letter from any language, any whitespace character, any numeric character, and the following characters: underscore (<code>_</code>), period (<code>.</code>), colon (<code>:</code>), slash (<code>/</code>), equal (<code>=</code>), plus (<code>+</code>), backslash (<code>\</code>), hyphen (<code>-</code>), at symbol (<code>@</code>).</p>
177    pub fn get_s3_key_prefix(&self) -> &::std::option::Option<::std::string::String> {
178        self.inner.get_s3_key_prefix()
179    }
180    /// <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
181    pub fn log_destination_type(mut self, input: crate::types::LogDestinationType) -> Self {
182        self.inner = self.inner.log_destination_type(input);
183        self
184    }
185    /// <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
186    pub fn set_log_destination_type(mut self, input: ::std::option::Option<crate::types::LogDestinationType>) -> Self {
187        self.inner = self.inner.set_log_destination_type(input);
188        self
189    }
190    /// <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
191    pub fn get_log_destination_type(&self) -> &::std::option::Option<crate::types::LogDestinationType> {
192        self.inner.get_log_destination_type()
193    }
194    ///
195    /// Appends an item to `LogExports`.
196    ///
197    /// To override the contents of this collection use [`set_log_exports`](Self::set_log_exports).
198    ///
199    /// <p>The collection of exported log types. Possible values are <code>connectionlog</code>, <code>useractivitylog</code>, and <code>userlog</code>.</p>
200    pub fn log_exports(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
201        self.inner = self.inner.log_exports(input.into());
202        self
203    }
204    /// <p>The collection of exported log types. Possible values are <code>connectionlog</code>, <code>useractivitylog</code>, and <code>userlog</code>.</p>
205    pub fn set_log_exports(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
206        self.inner = self.inner.set_log_exports(input);
207        self
208    }
209    /// <p>The collection of exported log types. Possible values are <code>connectionlog</code>, <code>useractivitylog</code>, and <code>userlog</code>.</p>
210    pub fn get_log_exports(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
211        self.inner.get_log_exports()
212    }
213}