aws_sdk_redshift/operation/enable_logging/_enable_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 EnableLoggingInput {
7 /// <p>The identifier of the cluster on which logging is to be started.</p>
8 /// <p>Example: <code>examplecluster</code></p>
9 pub cluster_identifier: ::std::option::Option<::std::string::String>,
10 /// <p>The name of an existing S3 bucket where the log files are to be stored.</p>
11 /// <p>Constraints:</p>
12 /// <ul>
13 /// <li>
14 /// <p>Must be in the same region as the cluster</p></li>
15 /// <li>
16 /// <p>The cluster must have read bucket and put object permissions</p></li>
17 /// </ul>
18 pub bucket_name: ::std::option::Option<::std::string::String>,
19 /// <p>The prefix applied to the log file names.</p>
20 /// <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>
21 pub s3_key_prefix: ::std::option::Option<::std::string::String>,
22 /// <p>The log destination type. An enum with possible values of <code>s3</code>, <code>cloudwatch</code>, and <code>s3table</code>.</p>
23 pub log_destination_type: ::std::option::Option<crate::types::LogDestinationType>,
24 /// <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 to publish. Omitting this parameter, passing an empty list, or including the value <code>all</code> publishes all current and future system tables.</p>
25 pub log_exports: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
26 /// <p>The identifier of a customer managed KMS key used to encrypt the S3 tables. This parameter is valid only when <code>LogDestinationType</code> is <code>s3table</code>.</p>
27 pub s3_table_kms_key_id: ::std::option::Option<::std::string::String>,
28 /// <p>The scope of system table publishing. Valid values are <code>cluster</code> and <code>account</code>. A value of <code>cluster</code> scopes publishing to the individual cluster. A value of <code>account</code> scopes publishing to the Amazon Web Services account. This parameter is valid only when <code>LogDestinationType</code> is <code>s3table</code>.</p>
29 pub s3_table_granularity: ::std::option::Option<::std::string::String>,
30}
31impl EnableLoggingInput {
32 /// <p>The identifier of the cluster on which logging is to be started.</p>
33 /// <p>Example: <code>examplecluster</code></p>
34 pub fn cluster_identifier(&self) -> ::std::option::Option<&str> {
35 self.cluster_identifier.as_deref()
36 }
37 /// <p>The name of an existing S3 bucket where the log files are to be stored.</p>
38 /// <p>Constraints:</p>
39 /// <ul>
40 /// <li>
41 /// <p>Must be in the same region as the cluster</p></li>
42 /// <li>
43 /// <p>The cluster must have read bucket and put object permissions</p></li>
44 /// </ul>
45 pub fn bucket_name(&self) -> ::std::option::Option<&str> {
46 self.bucket_name.as_deref()
47 }
48 /// <p>The prefix applied to the log file names.</p>
49 /// <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>
50 pub fn s3_key_prefix(&self) -> ::std::option::Option<&str> {
51 self.s3_key_prefix.as_deref()
52 }
53 /// <p>The log destination type. An enum with possible values of <code>s3</code>, <code>cloudwatch</code>, and <code>s3table</code>.</p>
54 pub fn log_destination_type(&self) -> ::std::option::Option<&crate::types::LogDestinationType> {
55 self.log_destination_type.as_ref()
56 }
57 /// <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 to publish. Omitting this parameter, passing an empty list, or including the value <code>all</code> publishes all current and future system tables.</p>
58 ///
59 /// 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()`.
60 pub fn log_exports(&self) -> &[::std::string::String] {
61 self.log_exports.as_deref().unwrap_or_default()
62 }
63 /// <p>The identifier of a customer managed KMS key used to encrypt the S3 tables. This parameter is valid only when <code>LogDestinationType</code> is <code>s3table</code>.</p>
64 pub fn s3_table_kms_key_id(&self) -> ::std::option::Option<&str> {
65 self.s3_table_kms_key_id.as_deref()
66 }
67 /// <p>The scope of system table publishing. Valid values are <code>cluster</code> and <code>account</code>. A value of <code>cluster</code> scopes publishing to the individual cluster. A value of <code>account</code> scopes publishing to the Amazon Web Services account. This parameter is valid only when <code>LogDestinationType</code> is <code>s3table</code>.</p>
68 pub fn s3_table_granularity(&self) -> ::std::option::Option<&str> {
69 self.s3_table_granularity.as_deref()
70 }
71}
72impl EnableLoggingInput {
73 /// Creates a new builder-style object to manufacture [`EnableLoggingInput`](crate::operation::enable_logging::EnableLoggingInput).
74 pub fn builder() -> crate::operation::enable_logging::builders::EnableLoggingInputBuilder {
75 crate::operation::enable_logging::builders::EnableLoggingInputBuilder::default()
76 }
77}
78
79/// A builder for [`EnableLoggingInput`](crate::operation::enable_logging::EnableLoggingInput).
80#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
81#[non_exhaustive]
82pub struct EnableLoggingInputBuilder {
83 pub(crate) cluster_identifier: ::std::option::Option<::std::string::String>,
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) log_destination_type: ::std::option::Option<crate::types::LogDestinationType>,
87 pub(crate) log_exports: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
88 pub(crate) s3_table_kms_key_id: ::std::option::Option<::std::string::String>,
89 pub(crate) s3_table_granularity: ::std::option::Option<::std::string::String>,
90}
91impl EnableLoggingInputBuilder {
92 /// <p>The identifier of the cluster on which logging is to be started.</p>
93 /// <p>Example: <code>examplecluster</code></p>
94 /// This field is required.
95 pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96 self.cluster_identifier = ::std::option::Option::Some(input.into());
97 self
98 }
99 /// <p>The identifier of the cluster on which logging is to be started.</p>
100 /// <p>Example: <code>examplecluster</code></p>
101 pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102 self.cluster_identifier = input;
103 self
104 }
105 /// <p>The identifier of the cluster on which logging is to be started.</p>
106 /// <p>Example: <code>examplecluster</code></p>
107 pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
108 &self.cluster_identifier
109 }
110 /// <p>The name of an existing S3 bucket where the log files are to be stored.</p>
111 /// <p>Constraints:</p>
112 /// <ul>
113 /// <li>
114 /// <p>Must be in the same region as the cluster</p></li>
115 /// <li>
116 /// <p>The cluster must have read bucket and put object permissions</p></li>
117 /// </ul>
118 pub fn bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119 self.bucket_name = ::std::option::Option::Some(input.into());
120 self
121 }
122 /// <p>The name of an existing S3 bucket where the log files are to be stored.</p>
123 /// <p>Constraints:</p>
124 /// <ul>
125 /// <li>
126 /// <p>Must be in the same region as the cluster</p></li>
127 /// <li>
128 /// <p>The cluster must have read bucket and put object permissions</p></li>
129 /// </ul>
130 pub fn set_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131 self.bucket_name = input;
132 self
133 }
134 /// <p>The name of an existing S3 bucket where the log files are to be stored.</p>
135 /// <p>Constraints:</p>
136 /// <ul>
137 /// <li>
138 /// <p>Must be in the same region as the cluster</p></li>
139 /// <li>
140 /// <p>The cluster must have read bucket and put object permissions</p></li>
141 /// </ul>
142 pub fn get_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
143 &self.bucket_name
144 }
145 /// <p>The prefix applied to the log file names.</p>
146 /// <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>
147 pub fn s3_key_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148 self.s3_key_prefix = ::std::option::Option::Some(input.into());
149 self
150 }
151 /// <p>The prefix applied to the log file names.</p>
152 /// <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>
153 pub fn set_s3_key_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154 self.s3_key_prefix = input;
155 self
156 }
157 /// <p>The prefix applied to the log file names.</p>
158 /// <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>
159 pub fn get_s3_key_prefix(&self) -> &::std::option::Option<::std::string::String> {
160 &self.s3_key_prefix
161 }
162 /// <p>The log destination type. An enum with possible values of <code>s3</code>, <code>cloudwatch</code>, and <code>s3table</code>.</p>
163 pub fn log_destination_type(mut self, input: crate::types::LogDestinationType) -> Self {
164 self.log_destination_type = ::std::option::Option::Some(input);
165 self
166 }
167 /// <p>The log destination type. An enum with possible values of <code>s3</code>, <code>cloudwatch</code>, and <code>s3table</code>.</p>
168 pub fn set_log_destination_type(mut self, input: ::std::option::Option<crate::types::LogDestinationType>) -> Self {
169 self.log_destination_type = input;
170 self
171 }
172 /// <p>The log destination type. An enum with possible values of <code>s3</code>, <code>cloudwatch</code>, and <code>s3table</code>.</p>
173 pub fn get_log_destination_type(&self) -> &::std::option::Option<crate::types::LogDestinationType> {
174 &self.log_destination_type
175 }
176 /// Appends an item to `log_exports`.
177 ///
178 /// To override the contents of this collection use [`set_log_exports`](Self::set_log_exports).
179 ///
180 /// <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 to publish. Omitting this parameter, passing an empty list, or including the value <code>all</code> publishes all current and future system tables.</p>
181 pub fn log_exports(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
182 let mut v = self.log_exports.unwrap_or_default();
183 v.push(input.into());
184 self.log_exports = ::std::option::Option::Some(v);
185 self
186 }
187 /// <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 to publish. Omitting this parameter, passing an empty list, or including the value <code>all</code> publishes all current and future system tables.</p>
188 pub fn set_log_exports(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
189 self.log_exports = input;
190 self
191 }
192 /// <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 to publish. Omitting this parameter, passing an empty list, or including the value <code>all</code> publishes all current and future system tables.</p>
193 pub fn get_log_exports(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
194 &self.log_exports
195 }
196 /// <p>The identifier of a customer managed KMS key used to encrypt the S3 tables. This parameter is valid only when <code>LogDestinationType</code> is <code>s3table</code>.</p>
197 pub fn s3_table_kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198 self.s3_table_kms_key_id = ::std::option::Option::Some(input.into());
199 self
200 }
201 /// <p>The identifier of a customer managed KMS key used to encrypt the S3 tables. This parameter is valid only when <code>LogDestinationType</code> is <code>s3table</code>.</p>
202 pub fn set_s3_table_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203 self.s3_table_kms_key_id = input;
204 self
205 }
206 /// <p>The identifier of a customer managed KMS key used to encrypt the S3 tables. This parameter is valid only when <code>LogDestinationType</code> is <code>s3table</code>.</p>
207 pub fn get_s3_table_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
208 &self.s3_table_kms_key_id
209 }
210 /// <p>The scope of system table publishing. Valid values are <code>cluster</code> and <code>account</code>. A value of <code>cluster</code> scopes publishing to the individual cluster. A value of <code>account</code> scopes publishing to the Amazon Web Services account. This parameter is valid only when <code>LogDestinationType</code> is <code>s3table</code>.</p>
211 pub fn s3_table_granularity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
212 self.s3_table_granularity = ::std::option::Option::Some(input.into());
213 self
214 }
215 /// <p>The scope of system table publishing. Valid values are <code>cluster</code> and <code>account</code>. A value of <code>cluster</code> scopes publishing to the individual cluster. A value of <code>account</code> scopes publishing to the Amazon Web Services account. This parameter is valid only when <code>LogDestinationType</code> is <code>s3table</code>.</p>
216 pub fn set_s3_table_granularity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
217 self.s3_table_granularity = input;
218 self
219 }
220 /// <p>The scope of system table publishing. Valid values are <code>cluster</code> and <code>account</code>. A value of <code>cluster</code> scopes publishing to the individual cluster. A value of <code>account</code> scopes publishing to the Amazon Web Services account. This parameter is valid only when <code>LogDestinationType</code> is <code>s3table</code>.</p>
221 pub fn get_s3_table_granularity(&self) -> &::std::option::Option<::std::string::String> {
222 &self.s3_table_granularity
223 }
224 /// Consumes the builder and constructs a [`EnableLoggingInput`](crate::operation::enable_logging::EnableLoggingInput).
225 pub fn build(
226 self,
227 ) -> ::std::result::Result<crate::operation::enable_logging::EnableLoggingInput, ::aws_smithy_types::error::operation::BuildError> {
228 ::std::result::Result::Ok(crate::operation::enable_logging::EnableLoggingInput {
229 cluster_identifier: self.cluster_identifier,
230 bucket_name: self.bucket_name,
231 s3_key_prefix: self.s3_key_prefix,
232 log_destination_type: self.log_destination_type,
233 log_exports: self.log_exports,
234 s3_table_kms_key_id: self.s3_table_kms_key_id,
235 s3_table_granularity: self.s3_table_granularity,
236 })
237 }
238}