Skip to main content

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