Skip to main content

aws_sdk_redshift/operation/disable_logging/
_disable_logging_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p></p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DisableLoggingInput {
7    /// <p>The identifier of the cluster on which logging is to be stopped.</p>
8    /// <p>Example: <code>examplecluster</code></p>
9    pub cluster_identifier: ::std::option::Option<::std::string::String>,
10    /// <p>The log destination type. An enum with possible values of <code>s3</code>, <code>cloudwatch</code>, and <code>s3table</code>. When set to <code>s3table</code>, stops system table publishing. When omitted, the operation disables audit logging.</p>
11    pub log_destination_type: ::std::option::Option<crate::types::LogDestinationType>,
12    /// <p>The collection of log types to stop exporting. When <code>LogDestinationType</code> is <code>s3table</code>, the values are the names of the system tables to stop publishing. Omitting this parameter or passing <code>all</code> stops publishing all system tables.</p>
13    pub log_exports: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
14}
15impl DisableLoggingInput {
16    /// <p>The identifier of the cluster on which logging is to be stopped.</p>
17    /// <p>Example: <code>examplecluster</code></p>
18    pub fn cluster_identifier(&self) -> ::std::option::Option<&str> {
19        self.cluster_identifier.as_deref()
20    }
21    /// <p>The log destination type. An enum with possible values of <code>s3</code>, <code>cloudwatch</code>, and <code>s3table</code>. When set to <code>s3table</code>, stops system table publishing. When omitted, the operation disables audit logging.</p>
22    pub fn log_destination_type(&self) -> ::std::option::Option<&crate::types::LogDestinationType> {
23        self.log_destination_type.as_ref()
24    }
25    /// <p>The collection of log types to stop exporting. When <code>LogDestinationType</code> is <code>s3table</code>, the values are the names of the system tables to stop publishing. Omitting this parameter or passing <code>all</code> stops publishing all system tables.</p>
26    ///
27    /// 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()`.
28    pub fn log_exports(&self) -> &[::std::string::String] {
29        self.log_exports.as_deref().unwrap_or_default()
30    }
31}
32impl DisableLoggingInput {
33    /// Creates a new builder-style object to manufacture [`DisableLoggingInput`](crate::operation::disable_logging::DisableLoggingInput).
34    pub fn builder() -> crate::operation::disable_logging::builders::DisableLoggingInputBuilder {
35        crate::operation::disable_logging::builders::DisableLoggingInputBuilder::default()
36    }
37}
38
39/// A builder for [`DisableLoggingInput`](crate::operation::disable_logging::DisableLoggingInput).
40#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
41#[non_exhaustive]
42pub struct DisableLoggingInputBuilder {
43    pub(crate) cluster_identifier: ::std::option::Option<::std::string::String>,
44    pub(crate) log_destination_type: ::std::option::Option<crate::types::LogDestinationType>,
45    pub(crate) log_exports: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
46}
47impl DisableLoggingInputBuilder {
48    /// <p>The identifier of the cluster on which logging is to be stopped.</p>
49    /// <p>Example: <code>examplecluster</code></p>
50    /// This field is required.
51    pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
52        self.cluster_identifier = ::std::option::Option::Some(input.into());
53        self
54    }
55    /// <p>The identifier of the cluster on which logging is to be stopped.</p>
56    /// <p>Example: <code>examplecluster</code></p>
57    pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.cluster_identifier = input;
59        self
60    }
61    /// <p>The identifier of the cluster on which logging is to be stopped.</p>
62    /// <p>Example: <code>examplecluster</code></p>
63    pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
64        &self.cluster_identifier
65    }
66    /// <p>The log destination type. An enum with possible values of <code>s3</code>, <code>cloudwatch</code>, and <code>s3table</code>. When set to <code>s3table</code>, stops system table publishing. When omitted, the operation disables audit logging.</p>
67    pub fn log_destination_type(mut self, input: crate::types::LogDestinationType) -> Self {
68        self.log_destination_type = ::std::option::Option::Some(input);
69        self
70    }
71    /// <p>The log destination type. An enum with possible values of <code>s3</code>, <code>cloudwatch</code>, and <code>s3table</code>. When set to <code>s3table</code>, stops system table publishing. When omitted, the operation disables audit logging.</p>
72    pub fn set_log_destination_type(mut self, input: ::std::option::Option<crate::types::LogDestinationType>) -> Self {
73        self.log_destination_type = input;
74        self
75    }
76    /// <p>The log destination type. An enum with possible values of <code>s3</code>, <code>cloudwatch</code>, and <code>s3table</code>. When set to <code>s3table</code>, stops system table publishing. When omitted, the operation disables audit logging.</p>
77    pub fn get_log_destination_type(&self) -> &::std::option::Option<crate::types::LogDestinationType> {
78        &self.log_destination_type
79    }
80    /// Appends an item to `log_exports`.
81    ///
82    /// To override the contents of this collection use [`set_log_exports`](Self::set_log_exports).
83    ///
84    /// <p>The collection of log types to stop exporting. When <code>LogDestinationType</code> is <code>s3table</code>, the values are the names of the system tables to stop publishing. Omitting this parameter or passing <code>all</code> stops publishing all system tables.</p>
85    pub fn log_exports(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86        let mut v = self.log_exports.unwrap_or_default();
87        v.push(input.into());
88        self.log_exports = ::std::option::Option::Some(v);
89        self
90    }
91    /// <p>The collection of log types to stop exporting. When <code>LogDestinationType</code> is <code>s3table</code>, the values are the names of the system tables to stop publishing. Omitting this parameter or passing <code>all</code> stops publishing all system tables.</p>
92    pub fn set_log_exports(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
93        self.log_exports = input;
94        self
95    }
96    /// <p>The collection of log types to stop exporting. When <code>LogDestinationType</code> is <code>s3table</code>, the values are the names of the system tables to stop publishing. Omitting this parameter or passing <code>all</code> stops publishing all system tables.</p>
97    pub fn get_log_exports(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
98        &self.log_exports
99    }
100    /// Consumes the builder and constructs a [`DisableLoggingInput`](crate::operation::disable_logging::DisableLoggingInput).
101    pub fn build(
102        self,
103    ) -> ::std::result::Result<crate::operation::disable_logging::DisableLoggingInput, ::aws_smithy_types::error::operation::BuildError> {
104        ::std::result::Result::Ok(crate::operation::disable_logging::DisableLoggingInput {
105            cluster_identifier: self.cluster_identifier,
106            log_destination_type: self.log_destination_type,
107            log_exports: self.log_exports,
108        })
109    }
110}