aws_sdk_securityhub/types/
_aws_cloud_trail_trail_details.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Provides details about a CloudTrail trail.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AwsCloudTrailTrailDetails {
7    /// <p>The ARN of the log group that CloudTrail logs are delivered to.</p>
8    pub cloud_watch_logs_log_group_arn: ::std::option::Option<::std::string::String>,
9    /// <p>The ARN of the role that the CloudWatch Events endpoint assumes when it writes to the log group.</p>
10    pub cloud_watch_logs_role_arn: ::std::option::Option<::std::string::String>,
11    /// <p>Indicates whether the trail has custom event selectors.</p>
12    pub has_custom_event_selectors: ::std::option::Option<bool>,
13    /// <p>The Region where the trail was created.</p>
14    pub home_region: ::std::option::Option<::std::string::String>,
15    /// <p>Indicates whether the trail publishes events from global services such as IAM to the log files.</p>
16    pub include_global_service_events: ::std::option::Option<bool>,
17    /// <p>Indicates whether the trail applies only to the current Region or to all Regions.</p>
18    pub is_multi_region_trail: ::std::option::Option<bool>,
19    /// <p>Whether the trail is created for all accounts in an organization in Organizations, or only for the current Amazon Web Services account.</p>
20    pub is_organization_trail: ::std::option::Option<bool>,
21    /// <p>The KMS key ID to use to encrypt the logs.</p>
22    pub kms_key_id: ::std::option::Option<::std::string::String>,
23    /// <p>Indicates whether CloudTrail log file validation is enabled.</p>
24    pub log_file_validation_enabled: ::std::option::Option<bool>,
25    /// <p>The name of the trail.</p>
26    pub name: ::std::option::Option<::std::string::String>,
27    /// <p>The name of the S3 bucket where the log files are published.</p>
28    pub s3_bucket_name: ::std::option::Option<::std::string::String>,
29    /// <p>The S3 key prefix. The key prefix is added after the name of the S3 bucket where the log files are published.</p>
30    pub s3_key_prefix: ::std::option::Option<::std::string::String>,
31    /// <p>The ARN of the SNS topic that is used for notifications of log file delivery.</p>
32    pub sns_topic_arn: ::std::option::Option<::std::string::String>,
33    /// <p>The name of the SNS topic that is used for notifications of log file delivery.</p>
34    pub sns_topic_name: ::std::option::Option<::std::string::String>,
35    /// <p>The ARN of the trail.</p>
36    pub trail_arn: ::std::option::Option<::std::string::String>,
37}
38impl AwsCloudTrailTrailDetails {
39    /// <p>The ARN of the log group that CloudTrail logs are delivered to.</p>
40    pub fn cloud_watch_logs_log_group_arn(&self) -> ::std::option::Option<&str> {
41        self.cloud_watch_logs_log_group_arn.as_deref()
42    }
43    /// <p>The ARN of the role that the CloudWatch Events endpoint assumes when it writes to the log group.</p>
44    pub fn cloud_watch_logs_role_arn(&self) -> ::std::option::Option<&str> {
45        self.cloud_watch_logs_role_arn.as_deref()
46    }
47    /// <p>Indicates whether the trail has custom event selectors.</p>
48    pub fn has_custom_event_selectors(&self) -> ::std::option::Option<bool> {
49        self.has_custom_event_selectors
50    }
51    /// <p>The Region where the trail was created.</p>
52    pub fn home_region(&self) -> ::std::option::Option<&str> {
53        self.home_region.as_deref()
54    }
55    /// <p>Indicates whether the trail publishes events from global services such as IAM to the log files.</p>
56    pub fn include_global_service_events(&self) -> ::std::option::Option<bool> {
57        self.include_global_service_events
58    }
59    /// <p>Indicates whether the trail applies only to the current Region or to all Regions.</p>
60    pub fn is_multi_region_trail(&self) -> ::std::option::Option<bool> {
61        self.is_multi_region_trail
62    }
63    /// <p>Whether the trail is created for all accounts in an organization in Organizations, or only for the current Amazon Web Services account.</p>
64    pub fn is_organization_trail(&self) -> ::std::option::Option<bool> {
65        self.is_organization_trail
66    }
67    /// <p>The KMS key ID to use to encrypt the logs.</p>
68    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
69        self.kms_key_id.as_deref()
70    }
71    /// <p>Indicates whether CloudTrail log file validation is enabled.</p>
72    pub fn log_file_validation_enabled(&self) -> ::std::option::Option<bool> {
73        self.log_file_validation_enabled
74    }
75    /// <p>The name of the trail.</p>
76    pub fn name(&self) -> ::std::option::Option<&str> {
77        self.name.as_deref()
78    }
79    /// <p>The name of the S3 bucket where the log files are published.</p>
80    pub fn s3_bucket_name(&self) -> ::std::option::Option<&str> {
81        self.s3_bucket_name.as_deref()
82    }
83    /// <p>The S3 key prefix. The key prefix is added after the name of the S3 bucket where the log files are published.</p>
84    pub fn s3_key_prefix(&self) -> ::std::option::Option<&str> {
85        self.s3_key_prefix.as_deref()
86    }
87    /// <p>The ARN of the SNS topic that is used for notifications of log file delivery.</p>
88    pub fn sns_topic_arn(&self) -> ::std::option::Option<&str> {
89        self.sns_topic_arn.as_deref()
90    }
91    /// <p>The name of the SNS topic that is used for notifications of log file delivery.</p>
92    pub fn sns_topic_name(&self) -> ::std::option::Option<&str> {
93        self.sns_topic_name.as_deref()
94    }
95    /// <p>The ARN of the trail.</p>
96    pub fn trail_arn(&self) -> ::std::option::Option<&str> {
97        self.trail_arn.as_deref()
98    }
99}
100impl AwsCloudTrailTrailDetails {
101    /// Creates a new builder-style object to manufacture [`AwsCloudTrailTrailDetails`](crate::types::AwsCloudTrailTrailDetails).
102    pub fn builder() -> crate::types::builders::AwsCloudTrailTrailDetailsBuilder {
103        crate::types::builders::AwsCloudTrailTrailDetailsBuilder::default()
104    }
105}
106
107/// A builder for [`AwsCloudTrailTrailDetails`](crate::types::AwsCloudTrailTrailDetails).
108#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
109#[non_exhaustive]
110pub struct AwsCloudTrailTrailDetailsBuilder {
111    pub(crate) cloud_watch_logs_log_group_arn: ::std::option::Option<::std::string::String>,
112    pub(crate) cloud_watch_logs_role_arn: ::std::option::Option<::std::string::String>,
113    pub(crate) has_custom_event_selectors: ::std::option::Option<bool>,
114    pub(crate) home_region: ::std::option::Option<::std::string::String>,
115    pub(crate) include_global_service_events: ::std::option::Option<bool>,
116    pub(crate) is_multi_region_trail: ::std::option::Option<bool>,
117    pub(crate) is_organization_trail: ::std::option::Option<bool>,
118    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
119    pub(crate) log_file_validation_enabled: ::std::option::Option<bool>,
120    pub(crate) name: ::std::option::Option<::std::string::String>,
121    pub(crate) s3_bucket_name: ::std::option::Option<::std::string::String>,
122    pub(crate) s3_key_prefix: ::std::option::Option<::std::string::String>,
123    pub(crate) sns_topic_arn: ::std::option::Option<::std::string::String>,
124    pub(crate) sns_topic_name: ::std::option::Option<::std::string::String>,
125    pub(crate) trail_arn: ::std::option::Option<::std::string::String>,
126}
127impl AwsCloudTrailTrailDetailsBuilder {
128    /// <p>The ARN of the log group that CloudTrail logs are delivered to.</p>
129    pub fn cloud_watch_logs_log_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.cloud_watch_logs_log_group_arn = ::std::option::Option::Some(input.into());
131        self
132    }
133    /// <p>The ARN of the log group that CloudTrail logs are delivered to.</p>
134    pub fn set_cloud_watch_logs_log_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.cloud_watch_logs_log_group_arn = input;
136        self
137    }
138    /// <p>The ARN of the log group that CloudTrail logs are delivered to.</p>
139    pub fn get_cloud_watch_logs_log_group_arn(&self) -> &::std::option::Option<::std::string::String> {
140        &self.cloud_watch_logs_log_group_arn
141    }
142    /// <p>The ARN of the role that the CloudWatch Events endpoint assumes when it writes to the log group.</p>
143    pub fn cloud_watch_logs_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.cloud_watch_logs_role_arn = ::std::option::Option::Some(input.into());
145        self
146    }
147    /// <p>The ARN of the role that the CloudWatch Events endpoint assumes when it writes to the log group.</p>
148    pub fn set_cloud_watch_logs_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.cloud_watch_logs_role_arn = input;
150        self
151    }
152    /// <p>The ARN of the role that the CloudWatch Events endpoint assumes when it writes to the log group.</p>
153    pub fn get_cloud_watch_logs_role_arn(&self) -> &::std::option::Option<::std::string::String> {
154        &self.cloud_watch_logs_role_arn
155    }
156    /// <p>Indicates whether the trail has custom event selectors.</p>
157    pub fn has_custom_event_selectors(mut self, input: bool) -> Self {
158        self.has_custom_event_selectors = ::std::option::Option::Some(input);
159        self
160    }
161    /// <p>Indicates whether the trail has custom event selectors.</p>
162    pub fn set_has_custom_event_selectors(mut self, input: ::std::option::Option<bool>) -> Self {
163        self.has_custom_event_selectors = input;
164        self
165    }
166    /// <p>Indicates whether the trail has custom event selectors.</p>
167    pub fn get_has_custom_event_selectors(&self) -> &::std::option::Option<bool> {
168        &self.has_custom_event_selectors
169    }
170    /// <p>The Region where the trail was created.</p>
171    pub fn home_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.home_region = ::std::option::Option::Some(input.into());
173        self
174    }
175    /// <p>The Region where the trail was created.</p>
176    pub fn set_home_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.home_region = input;
178        self
179    }
180    /// <p>The Region where the trail was created.</p>
181    pub fn get_home_region(&self) -> &::std::option::Option<::std::string::String> {
182        &self.home_region
183    }
184    /// <p>Indicates whether the trail publishes events from global services such as IAM to the log files.</p>
185    pub fn include_global_service_events(mut self, input: bool) -> Self {
186        self.include_global_service_events = ::std::option::Option::Some(input);
187        self
188    }
189    /// <p>Indicates whether the trail publishes events from global services such as IAM to the log files.</p>
190    pub fn set_include_global_service_events(mut self, input: ::std::option::Option<bool>) -> Self {
191        self.include_global_service_events = input;
192        self
193    }
194    /// <p>Indicates whether the trail publishes events from global services such as IAM to the log files.</p>
195    pub fn get_include_global_service_events(&self) -> &::std::option::Option<bool> {
196        &self.include_global_service_events
197    }
198    /// <p>Indicates whether the trail applies only to the current Region or to all Regions.</p>
199    pub fn is_multi_region_trail(mut self, input: bool) -> Self {
200        self.is_multi_region_trail = ::std::option::Option::Some(input);
201        self
202    }
203    /// <p>Indicates whether the trail applies only to the current Region or to all Regions.</p>
204    pub fn set_is_multi_region_trail(mut self, input: ::std::option::Option<bool>) -> Self {
205        self.is_multi_region_trail = input;
206        self
207    }
208    /// <p>Indicates whether the trail applies only to the current Region or to all Regions.</p>
209    pub fn get_is_multi_region_trail(&self) -> &::std::option::Option<bool> {
210        &self.is_multi_region_trail
211    }
212    /// <p>Whether the trail is created for all accounts in an organization in Organizations, or only for the current Amazon Web Services account.</p>
213    pub fn is_organization_trail(mut self, input: bool) -> Self {
214        self.is_organization_trail = ::std::option::Option::Some(input);
215        self
216    }
217    /// <p>Whether the trail is created for all accounts in an organization in Organizations, or only for the current Amazon Web Services account.</p>
218    pub fn set_is_organization_trail(mut self, input: ::std::option::Option<bool>) -> Self {
219        self.is_organization_trail = input;
220        self
221    }
222    /// <p>Whether the trail is created for all accounts in an organization in Organizations, or only for the current Amazon Web Services account.</p>
223    pub fn get_is_organization_trail(&self) -> &::std::option::Option<bool> {
224        &self.is_organization_trail
225    }
226    /// <p>The KMS key ID to use to encrypt the logs.</p>
227    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
228        self.kms_key_id = ::std::option::Option::Some(input.into());
229        self
230    }
231    /// <p>The KMS key ID to use to encrypt the logs.</p>
232    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
233        self.kms_key_id = input;
234        self
235    }
236    /// <p>The KMS key ID to use to encrypt the logs.</p>
237    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
238        &self.kms_key_id
239    }
240    /// <p>Indicates whether CloudTrail log file validation is enabled.</p>
241    pub fn log_file_validation_enabled(mut self, input: bool) -> Self {
242        self.log_file_validation_enabled = ::std::option::Option::Some(input);
243        self
244    }
245    /// <p>Indicates whether CloudTrail log file validation is enabled.</p>
246    pub fn set_log_file_validation_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
247        self.log_file_validation_enabled = input;
248        self
249    }
250    /// <p>Indicates whether CloudTrail log file validation is enabled.</p>
251    pub fn get_log_file_validation_enabled(&self) -> &::std::option::Option<bool> {
252        &self.log_file_validation_enabled
253    }
254    /// <p>The name of the trail.</p>
255    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
256        self.name = ::std::option::Option::Some(input.into());
257        self
258    }
259    /// <p>The name of the trail.</p>
260    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
261        self.name = input;
262        self
263    }
264    /// <p>The name of the trail.</p>
265    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
266        &self.name
267    }
268    /// <p>The name of the S3 bucket where the log files are published.</p>
269    pub fn s3_bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
270        self.s3_bucket_name = ::std::option::Option::Some(input.into());
271        self
272    }
273    /// <p>The name of the S3 bucket where the log files are published.</p>
274    pub fn set_s3_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
275        self.s3_bucket_name = input;
276        self
277    }
278    /// <p>The name of the S3 bucket where the log files are published.</p>
279    pub fn get_s3_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
280        &self.s3_bucket_name
281    }
282    /// <p>The S3 key prefix. The key prefix is added after the name of the S3 bucket where the log files are published.</p>
283    pub fn s3_key_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
284        self.s3_key_prefix = ::std::option::Option::Some(input.into());
285        self
286    }
287    /// <p>The S3 key prefix. The key prefix is added after the name of the S3 bucket where the log files are published.</p>
288    pub fn set_s3_key_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
289        self.s3_key_prefix = input;
290        self
291    }
292    /// <p>The S3 key prefix. The key prefix is added after the name of the S3 bucket where the log files are published.</p>
293    pub fn get_s3_key_prefix(&self) -> &::std::option::Option<::std::string::String> {
294        &self.s3_key_prefix
295    }
296    /// <p>The ARN of the SNS topic that is used for notifications of log file delivery.</p>
297    pub fn sns_topic_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
298        self.sns_topic_arn = ::std::option::Option::Some(input.into());
299        self
300    }
301    /// <p>The ARN of the SNS topic that is used for notifications of log file delivery.</p>
302    pub fn set_sns_topic_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
303        self.sns_topic_arn = input;
304        self
305    }
306    /// <p>The ARN of the SNS topic that is used for notifications of log file delivery.</p>
307    pub fn get_sns_topic_arn(&self) -> &::std::option::Option<::std::string::String> {
308        &self.sns_topic_arn
309    }
310    /// <p>The name of the SNS topic that is used for notifications of log file delivery.</p>
311    pub fn sns_topic_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
312        self.sns_topic_name = ::std::option::Option::Some(input.into());
313        self
314    }
315    /// <p>The name of the SNS topic that is used for notifications of log file delivery.</p>
316    pub fn set_sns_topic_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
317        self.sns_topic_name = input;
318        self
319    }
320    /// <p>The name of the SNS topic that is used for notifications of log file delivery.</p>
321    pub fn get_sns_topic_name(&self) -> &::std::option::Option<::std::string::String> {
322        &self.sns_topic_name
323    }
324    /// <p>The ARN of the trail.</p>
325    pub fn trail_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
326        self.trail_arn = ::std::option::Option::Some(input.into());
327        self
328    }
329    /// <p>The ARN of the trail.</p>
330    pub fn set_trail_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
331        self.trail_arn = input;
332        self
333    }
334    /// <p>The ARN of the trail.</p>
335    pub fn get_trail_arn(&self) -> &::std::option::Option<::std::string::String> {
336        &self.trail_arn
337    }
338    /// Consumes the builder and constructs a [`AwsCloudTrailTrailDetails`](crate::types::AwsCloudTrailTrailDetails).
339    pub fn build(self) -> crate::types::AwsCloudTrailTrailDetails {
340        crate::types::AwsCloudTrailTrailDetails {
341            cloud_watch_logs_log_group_arn: self.cloud_watch_logs_log_group_arn,
342            cloud_watch_logs_role_arn: self.cloud_watch_logs_role_arn,
343            has_custom_event_selectors: self.has_custom_event_selectors,
344            home_region: self.home_region,
345            include_global_service_events: self.include_global_service_events,
346            is_multi_region_trail: self.is_multi_region_trail,
347            is_organization_trail: self.is_organization_trail,
348            kms_key_id: self.kms_key_id,
349            log_file_validation_enabled: self.log_file_validation_enabled,
350            name: self.name,
351            s3_bucket_name: self.s3_bucket_name,
352            s3_key_prefix: self.s3_key_prefix,
353            sns_topic_arn: self.sns_topic_arn,
354            sns_topic_name: self.sns_topic_name,
355            trail_arn: self.trail_arn,
356        }
357    }
358}