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> and <code>cloudwatch</code>.</p>
23 pub log_destination_type: ::std::option::Option<crate::types::LogDestinationType>,
24 /// <p>The collection of exported log types. Possible values are <code>connectionlog</code>, <code>useractivitylog</code>, and <code>userlog</code>.</p>
25 pub log_exports: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
26}
27impl EnableLoggingInput {
28 /// <p>The identifier of the cluster on which logging is to be started.</p>
29 /// <p>Example: <code>examplecluster</code></p>
30 pub fn cluster_identifier(&self) -> ::std::option::Option<&str> {
31 self.cluster_identifier.as_deref()
32 }
33 /// <p>The name of an existing S3 bucket where the log files are to be stored.</p>
34 /// <p>Constraints:</p>
35 /// <ul>
36 /// <li>
37 /// <p>Must be in the same region as the cluster</p></li>
38 /// <li>
39 /// <p>The cluster must have read bucket and put object permissions</p></li>
40 /// </ul>
41 pub fn bucket_name(&self) -> ::std::option::Option<&str> {
42 self.bucket_name.as_deref()
43 }
44 /// <p>The prefix applied to the log file names.</p>
45 /// <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>
46 pub fn s3_key_prefix(&self) -> ::std::option::Option<&str> {
47 self.s3_key_prefix.as_deref()
48 }
49 /// <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
50 pub fn log_destination_type(&self) -> ::std::option::Option<&crate::types::LogDestinationType> {
51 self.log_destination_type.as_ref()
52 }
53 /// <p>The collection of exported log types. Possible values are <code>connectionlog</code>, <code>useractivitylog</code>, and <code>userlog</code>.</p>
54 ///
55 /// 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()`.
56 pub fn log_exports(&self) -> &[::std::string::String] {
57 self.log_exports.as_deref().unwrap_or_default()
58 }
59}
60impl EnableLoggingInput {
61 /// Creates a new builder-style object to manufacture [`EnableLoggingInput`](crate::operation::enable_logging::EnableLoggingInput).
62 pub fn builder() -> crate::operation::enable_logging::builders::EnableLoggingInputBuilder {
63 crate::operation::enable_logging::builders::EnableLoggingInputBuilder::default()
64 }
65}
66
67/// A builder for [`EnableLoggingInput`](crate::operation::enable_logging::EnableLoggingInput).
68#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
69#[non_exhaustive]
70pub struct EnableLoggingInputBuilder {
71 pub(crate) cluster_identifier: ::std::option::Option<::std::string::String>,
72 pub(crate) bucket_name: ::std::option::Option<::std::string::String>,
73 pub(crate) s3_key_prefix: ::std::option::Option<::std::string::String>,
74 pub(crate) log_destination_type: ::std::option::Option<crate::types::LogDestinationType>,
75 pub(crate) log_exports: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
76}
77impl EnableLoggingInputBuilder {
78 /// <p>The identifier of the cluster on which logging is to be started.</p>
79 /// <p>Example: <code>examplecluster</code></p>
80 /// This field is required.
81 pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82 self.cluster_identifier = ::std::option::Option::Some(input.into());
83 self
84 }
85 /// <p>The identifier of the cluster on which logging is to be started.</p>
86 /// <p>Example: <code>examplecluster</code></p>
87 pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88 self.cluster_identifier = input;
89 self
90 }
91 /// <p>The identifier of the cluster on which logging is to be started.</p>
92 /// <p>Example: <code>examplecluster</code></p>
93 pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
94 &self.cluster_identifier
95 }
96 /// <p>The name of an existing S3 bucket where the log files are to be stored.</p>
97 /// <p>Constraints:</p>
98 /// <ul>
99 /// <li>
100 /// <p>Must be in the same region as the cluster</p></li>
101 /// <li>
102 /// <p>The cluster must have read bucket and put object permissions</p></li>
103 /// </ul>
104 pub fn bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105 self.bucket_name = ::std::option::Option::Some(input.into());
106 self
107 }
108 /// <p>The name of an existing S3 bucket where the log files are to be stored.</p>
109 /// <p>Constraints:</p>
110 /// <ul>
111 /// <li>
112 /// <p>Must be in the same region as the cluster</p></li>
113 /// <li>
114 /// <p>The cluster must have read bucket and put object permissions</p></li>
115 /// </ul>
116 pub fn set_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
117 self.bucket_name = input;
118 self
119 }
120 /// <p>The name of an existing S3 bucket where the log files are to be stored.</p>
121 /// <p>Constraints:</p>
122 /// <ul>
123 /// <li>
124 /// <p>Must be in the same region as the cluster</p></li>
125 /// <li>
126 /// <p>The cluster must have read bucket and put object permissions</p></li>
127 /// </ul>
128 pub fn get_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
129 &self.bucket_name
130 }
131 /// <p>The prefix applied to the log file names.</p>
132 /// <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>
133 pub fn s3_key_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134 self.s3_key_prefix = ::std::option::Option::Some(input.into());
135 self
136 }
137 /// <p>The prefix applied to the log file names.</p>
138 /// <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>
139 pub fn set_s3_key_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140 self.s3_key_prefix = input;
141 self
142 }
143 /// <p>The prefix applied to the log file names.</p>
144 /// <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>
145 pub fn get_s3_key_prefix(&self) -> &::std::option::Option<::std::string::String> {
146 &self.s3_key_prefix
147 }
148 /// <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
149 pub fn log_destination_type(mut self, input: crate::types::LogDestinationType) -> Self {
150 self.log_destination_type = ::std::option::Option::Some(input);
151 self
152 }
153 /// <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
154 pub fn set_log_destination_type(mut self, input: ::std::option::Option<crate::types::LogDestinationType>) -> Self {
155 self.log_destination_type = input;
156 self
157 }
158 /// <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
159 pub fn get_log_destination_type(&self) -> &::std::option::Option<crate::types::LogDestinationType> {
160 &self.log_destination_type
161 }
162 /// Appends an item to `log_exports`.
163 ///
164 /// To override the contents of this collection use [`set_log_exports`](Self::set_log_exports).
165 ///
166 /// <p>The collection of exported log types. Possible values are <code>connectionlog</code>, <code>useractivitylog</code>, and <code>userlog</code>.</p>
167 pub fn log_exports(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168 let mut v = self.log_exports.unwrap_or_default();
169 v.push(input.into());
170 self.log_exports = ::std::option::Option::Some(v);
171 self
172 }
173 /// <p>The collection of exported log types. Possible values are <code>connectionlog</code>, <code>useractivitylog</code>, and <code>userlog</code>.</p>
174 pub fn set_log_exports(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
175 self.log_exports = input;
176 self
177 }
178 /// <p>The collection of exported log types. Possible values are <code>connectionlog</code>, <code>useractivitylog</code>, and <code>userlog</code>.</p>
179 pub fn get_log_exports(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
180 &self.log_exports
181 }
182 /// Consumes the builder and constructs a [`EnableLoggingInput`](crate::operation::enable_logging::EnableLoggingInput).
183 pub fn build(
184 self,
185 ) -> ::std::result::Result<crate::operation::enable_logging::EnableLoggingInput, ::aws_smithy_types::error::operation::BuildError> {
186 ::std::result::Result::Ok(crate::operation::enable_logging::EnableLoggingInput {
187 cluster_identifier: self.cluster_identifier,
188 bucket_name: self.bucket_name,
189 s3_key_prefix: self.s3_key_prefix,
190 log_destination_type: self.log_destination_type,
191 log_exports: self.log_exports,
192 })
193 }
194}