aws_sdk_redshift/operation/disable_logging/
_disable_logging_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes the status of logging for a cluster.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DisableLoggingOutput {
7    /// <p><code>true</code> if logging is on, <code>false</code> if logging is off.</p>
8    pub logging_enabled: ::std::option::Option<bool>,
9    /// <p>The name of the S3 bucket where the log files are stored.</p>
10    pub bucket_name: ::std::option::Option<::std::string::String>,
11    /// <p>The prefix applied to the log file names.</p>
12    pub s3_key_prefix: ::std::option::Option<::std::string::String>,
13    /// <p>The last time that logs were delivered.</p>
14    pub last_successful_delivery_time: ::std::option::Option<::aws_smithy_types::DateTime>,
15    /// <p>The last time when logs failed to be delivered.</p>
16    pub last_failure_time: ::std::option::Option<::aws_smithy_types::DateTime>,
17    /// <p>The message indicating that logs failed to be delivered.</p>
18    pub last_failure_message: ::std::option::Option<::std::string::String>,
19    /// <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
20    pub log_destination_type: ::std::option::Option<crate::types::LogDestinationType>,
21    /// <p>The collection of exported log types. Possible values are <code>connectionlog</code>, <code>useractivitylog</code>, and <code>userlog</code>.</p>
22    pub log_exports: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
23    _request_id: Option<String>,
24}
25impl DisableLoggingOutput {
26    /// <p><code>true</code> if logging is on, <code>false</code> if logging is off.</p>
27    pub fn logging_enabled(&self) -> ::std::option::Option<bool> {
28        self.logging_enabled
29    }
30    /// <p>The name of the S3 bucket where the log files are stored.</p>
31    pub fn bucket_name(&self) -> ::std::option::Option<&str> {
32        self.bucket_name.as_deref()
33    }
34    /// <p>The prefix applied to the log file names.</p>
35    pub fn s3_key_prefix(&self) -> ::std::option::Option<&str> {
36        self.s3_key_prefix.as_deref()
37    }
38    /// <p>The last time that logs were delivered.</p>
39    pub fn last_successful_delivery_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
40        self.last_successful_delivery_time.as_ref()
41    }
42    /// <p>The last time when logs failed to be delivered.</p>
43    pub fn last_failure_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
44        self.last_failure_time.as_ref()
45    }
46    /// <p>The message indicating that logs failed to be delivered.</p>
47    pub fn last_failure_message(&self) -> ::std::option::Option<&str> {
48        self.last_failure_message.as_deref()
49    }
50    /// <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
51    pub fn log_destination_type(&self) -> ::std::option::Option<&crate::types::LogDestinationType> {
52        self.log_destination_type.as_ref()
53    }
54    /// <p>The collection of exported log types. Possible values are <code>connectionlog</code>, <code>useractivitylog</code>, and <code>userlog</code>.</p>
55    ///
56    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.log_exports.is_none()`.
57    pub fn log_exports(&self) -> &[::std::string::String] {
58        self.log_exports.as_deref().unwrap_or_default()
59    }
60}
61impl ::aws_types::request_id::RequestId for DisableLoggingOutput {
62    fn request_id(&self) -> Option<&str> {
63        self._request_id.as_deref()
64    }
65}
66impl DisableLoggingOutput {
67    /// Creates a new builder-style object to manufacture [`DisableLoggingOutput`](crate::operation::disable_logging::DisableLoggingOutput).
68    pub fn builder() -> crate::operation::disable_logging::builders::DisableLoggingOutputBuilder {
69        crate::operation::disable_logging::builders::DisableLoggingOutputBuilder::default()
70    }
71}
72
73/// A builder for [`DisableLoggingOutput`](crate::operation::disable_logging::DisableLoggingOutput).
74#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
75#[non_exhaustive]
76pub struct DisableLoggingOutputBuilder {
77    pub(crate) logging_enabled: ::std::option::Option<bool>,
78    pub(crate) bucket_name: ::std::option::Option<::std::string::String>,
79    pub(crate) s3_key_prefix: ::std::option::Option<::std::string::String>,
80    pub(crate) last_successful_delivery_time: ::std::option::Option<::aws_smithy_types::DateTime>,
81    pub(crate) last_failure_time: ::std::option::Option<::aws_smithy_types::DateTime>,
82    pub(crate) last_failure_message: ::std::option::Option<::std::string::String>,
83    pub(crate) log_destination_type: ::std::option::Option<crate::types::LogDestinationType>,
84    pub(crate) log_exports: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
85    _request_id: Option<String>,
86}
87impl DisableLoggingOutputBuilder {
88    /// <p><code>true</code> if logging is on, <code>false</code> if logging is off.</p>
89    pub fn logging_enabled(mut self, input: bool) -> Self {
90        self.logging_enabled = ::std::option::Option::Some(input);
91        self
92    }
93    /// <p><code>true</code> if logging is on, <code>false</code> if logging is off.</p>
94    pub fn set_logging_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
95        self.logging_enabled = input;
96        self
97    }
98    /// <p><code>true</code> if logging is on, <code>false</code> if logging is off.</p>
99    pub fn get_logging_enabled(&self) -> &::std::option::Option<bool> {
100        &self.logging_enabled
101    }
102    /// <p>The name of the S3 bucket where the log files are stored.</p>
103    pub fn bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.bucket_name = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// <p>The name of the S3 bucket where the log files are stored.</p>
108    pub fn set_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.bucket_name = input;
110        self
111    }
112    /// <p>The name of the S3 bucket where the log files are stored.</p>
113    pub fn get_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
114        &self.bucket_name
115    }
116    /// <p>The prefix applied to the log file names.</p>
117    pub fn s3_key_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.s3_key_prefix = ::std::option::Option::Some(input.into());
119        self
120    }
121    /// <p>The prefix applied to the log file names.</p>
122    pub fn set_s3_key_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.s3_key_prefix = input;
124        self
125    }
126    /// <p>The prefix applied to the log file names.</p>
127    pub fn get_s3_key_prefix(&self) -> &::std::option::Option<::std::string::String> {
128        &self.s3_key_prefix
129    }
130    /// <p>The last time that logs were delivered.</p>
131    pub fn last_successful_delivery_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
132        self.last_successful_delivery_time = ::std::option::Option::Some(input);
133        self
134    }
135    /// <p>The last time that logs were delivered.</p>
136    pub fn set_last_successful_delivery_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
137        self.last_successful_delivery_time = input;
138        self
139    }
140    /// <p>The last time that logs were delivered.</p>
141    pub fn get_last_successful_delivery_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
142        &self.last_successful_delivery_time
143    }
144    /// <p>The last time when logs failed to be delivered.</p>
145    pub fn last_failure_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
146        self.last_failure_time = ::std::option::Option::Some(input);
147        self
148    }
149    /// <p>The last time when logs failed to be delivered.</p>
150    pub fn set_last_failure_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
151        self.last_failure_time = input;
152        self
153    }
154    /// <p>The last time when logs failed to be delivered.</p>
155    pub fn get_last_failure_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
156        &self.last_failure_time
157    }
158    /// <p>The message indicating that logs failed to be delivered.</p>
159    pub fn last_failure_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.last_failure_message = ::std::option::Option::Some(input.into());
161        self
162    }
163    /// <p>The message indicating that logs failed to be delivered.</p>
164    pub fn set_last_failure_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.last_failure_message = input;
166        self
167    }
168    /// <p>The message indicating that logs failed to be delivered.</p>
169    pub fn get_last_failure_message(&self) -> &::std::option::Option<::std::string::String> {
170        &self.last_failure_message
171    }
172    /// <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
173    pub fn log_destination_type(mut self, input: crate::types::LogDestinationType) -> Self {
174        self.log_destination_type = ::std::option::Option::Some(input);
175        self
176    }
177    /// <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
178    pub fn set_log_destination_type(mut self, input: ::std::option::Option<crate::types::LogDestinationType>) -> Self {
179        self.log_destination_type = input;
180        self
181    }
182    /// <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
183    pub fn get_log_destination_type(&self) -> &::std::option::Option<crate::types::LogDestinationType> {
184        &self.log_destination_type
185    }
186    /// Appends an item to `log_exports`.
187    ///
188    /// To override the contents of this collection use [`set_log_exports`](Self::set_log_exports).
189    ///
190    /// <p>The collection of exported log types. Possible values are <code>connectionlog</code>, <code>useractivitylog</code>, and <code>userlog</code>.</p>
191    pub fn log_exports(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
192        let mut v = self.log_exports.unwrap_or_default();
193        v.push(input.into());
194        self.log_exports = ::std::option::Option::Some(v);
195        self
196    }
197    /// <p>The collection of exported log types. Possible values are <code>connectionlog</code>, <code>useractivitylog</code>, and <code>userlog</code>.</p>
198    pub fn set_log_exports(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
199        self.log_exports = input;
200        self
201    }
202    /// <p>The collection of exported log types. Possible values are <code>connectionlog</code>, <code>useractivitylog</code>, and <code>userlog</code>.</p>
203    pub fn get_log_exports(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
204        &self.log_exports
205    }
206    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
207        self._request_id = Some(request_id.into());
208        self
209    }
210
211    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
212        self._request_id = request_id;
213        self
214    }
215    /// Consumes the builder and constructs a [`DisableLoggingOutput`](crate::operation::disable_logging::DisableLoggingOutput).
216    pub fn build(self) -> crate::operation::disable_logging::DisableLoggingOutput {
217        crate::operation::disable_logging::DisableLoggingOutput {
218            logging_enabled: self.logging_enabled,
219            bucket_name: self.bucket_name,
220            s3_key_prefix: self.s3_key_prefix,
221            last_successful_delivery_time: self.last_successful_delivery_time,
222            last_failure_time: self.last_failure_time,
223            last_failure_message: self.last_failure_message,
224            log_destination_type: self.log_destination_type,
225            log_exports: self.log_exports,
226            _request_id: self._request_id,
227        }
228    }
229}