aws_sdk_cloudtrail/operation/create_trail/
_create_trail_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Returns the objects or data listed below if successful. Otherwise, returns an error.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateTrailOutput {
7    /// <p>Specifies the name of the trail.</p>
8    pub name: ::std::option::Option<::std::string::String>,
9    /// <p>Specifies the name of the Amazon S3 bucket designated for publishing log files.</p>
10    pub s3_bucket_name: ::std::option::Option<::std::string::String>,
11    /// <p>Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files">Finding Your CloudTrail Log Files</a>.</p>
12    pub s3_key_prefix: ::std::option::Option<::std::string::String>,
13    /// <p>This field is no longer in use. Use <code>SnsTopicARN</code>.</p>
14    #[deprecated]
15    pub sns_topic_name: ::std::option::Option<::std::string::String>,
16    /// <p>Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications when log files are delivered. The format of a topic ARN is:</p>
17    /// <p><code>arn:aws:sns:us-east-2:123456789012:MyTopic</code></p>
18    pub sns_topic_arn: ::std::option::Option<::std::string::String>,
19    /// <p>Specifies whether the trail is publishing events from global services such as IAM to the log files.</p>
20    pub include_global_service_events: ::std::option::Option<bool>,
21    /// <p>Specifies whether the trail exists in one Region or in all Regions.</p>
22    pub is_multi_region_trail: ::std::option::Option<bool>,
23    /// <p>Specifies the ARN of the trail that was created. The format of a trail ARN is:</p>
24    /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
25    pub trail_arn: ::std::option::Option<::std::string::String>,
26    /// <p>Specifies whether log file integrity validation is enabled.</p>
27    pub log_file_validation_enabled: ::std::option::Option<bool>,
28    /// <p>Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs will be delivered.</p>
29    pub cloud_watch_logs_log_group_arn: ::std::option::Option<::std::string::String>,
30    /// <p>Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.</p>
31    pub cloud_watch_logs_role_arn: ::std::option::Option<::std::string::String>,
32    /// <p>Specifies the KMS key ID that encrypts the events delivered by CloudTrail. The value is a fully specified ARN to a KMS key in the following format.</p>
33    /// <p><code>arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012</code></p>
34    pub kms_key_id: ::std::option::Option<::std::string::String>,
35    /// <p>Specifies whether the trail is an organization trail.</p>
36    pub is_organization_trail: ::std::option::Option<bool>,
37    _request_id: Option<String>,
38}
39impl CreateTrailOutput {
40    /// <p>Specifies the name of the trail.</p>
41    pub fn name(&self) -> ::std::option::Option<&str> {
42        self.name.as_deref()
43    }
44    /// <p>Specifies the name of the Amazon S3 bucket designated for publishing log files.</p>
45    pub fn s3_bucket_name(&self) -> ::std::option::Option<&str> {
46        self.s3_bucket_name.as_deref()
47    }
48    /// <p>Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files">Finding Your CloudTrail Log Files</a>.</p>
49    pub fn s3_key_prefix(&self) -> ::std::option::Option<&str> {
50        self.s3_key_prefix.as_deref()
51    }
52    /// <p>This field is no longer in use. Use <code>SnsTopicARN</code>.</p>
53    #[deprecated]
54    pub fn sns_topic_name(&self) -> ::std::option::Option<&str> {
55        self.sns_topic_name.as_deref()
56    }
57    /// <p>Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications when log files are delivered. The format of a topic ARN is:</p>
58    /// <p><code>arn:aws:sns:us-east-2:123456789012:MyTopic</code></p>
59    pub fn sns_topic_arn(&self) -> ::std::option::Option<&str> {
60        self.sns_topic_arn.as_deref()
61    }
62    /// <p>Specifies whether the trail is publishing events from global services such as IAM to the log files.</p>
63    pub fn include_global_service_events(&self) -> ::std::option::Option<bool> {
64        self.include_global_service_events
65    }
66    /// <p>Specifies whether the trail exists in one Region or in all Regions.</p>
67    pub fn is_multi_region_trail(&self) -> ::std::option::Option<bool> {
68        self.is_multi_region_trail
69    }
70    /// <p>Specifies the ARN of the trail that was created. The format of a trail ARN is:</p>
71    /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
72    pub fn trail_arn(&self) -> ::std::option::Option<&str> {
73        self.trail_arn.as_deref()
74    }
75    /// <p>Specifies whether log file integrity validation is enabled.</p>
76    pub fn log_file_validation_enabled(&self) -> ::std::option::Option<bool> {
77        self.log_file_validation_enabled
78    }
79    /// <p>Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs will be delivered.</p>
80    pub fn cloud_watch_logs_log_group_arn(&self) -> ::std::option::Option<&str> {
81        self.cloud_watch_logs_log_group_arn.as_deref()
82    }
83    /// <p>Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.</p>
84    pub fn cloud_watch_logs_role_arn(&self) -> ::std::option::Option<&str> {
85        self.cloud_watch_logs_role_arn.as_deref()
86    }
87    /// <p>Specifies the KMS key ID that encrypts the events delivered by CloudTrail. The value is a fully specified ARN to a KMS key in the following format.</p>
88    /// <p><code>arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012</code></p>
89    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
90        self.kms_key_id.as_deref()
91    }
92    /// <p>Specifies whether the trail is an organization trail.</p>
93    pub fn is_organization_trail(&self) -> ::std::option::Option<bool> {
94        self.is_organization_trail
95    }
96}
97impl ::aws_types::request_id::RequestId for CreateTrailOutput {
98    fn request_id(&self) -> Option<&str> {
99        self._request_id.as_deref()
100    }
101}
102impl CreateTrailOutput {
103    /// Creates a new builder-style object to manufacture [`CreateTrailOutput`](crate::operation::create_trail::CreateTrailOutput).
104    pub fn builder() -> crate::operation::create_trail::builders::CreateTrailOutputBuilder {
105        crate::operation::create_trail::builders::CreateTrailOutputBuilder::default()
106    }
107}
108
109/// A builder for [`CreateTrailOutput`](crate::operation::create_trail::CreateTrailOutput).
110#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
111#[non_exhaustive]
112pub struct CreateTrailOutputBuilder {
113    pub(crate) name: ::std::option::Option<::std::string::String>,
114    pub(crate) s3_bucket_name: ::std::option::Option<::std::string::String>,
115    pub(crate) s3_key_prefix: ::std::option::Option<::std::string::String>,
116    pub(crate) sns_topic_name: ::std::option::Option<::std::string::String>,
117    pub(crate) sns_topic_arn: ::std::option::Option<::std::string::String>,
118    pub(crate) include_global_service_events: ::std::option::Option<bool>,
119    pub(crate) is_multi_region_trail: ::std::option::Option<bool>,
120    pub(crate) trail_arn: ::std::option::Option<::std::string::String>,
121    pub(crate) log_file_validation_enabled: ::std::option::Option<bool>,
122    pub(crate) cloud_watch_logs_log_group_arn: ::std::option::Option<::std::string::String>,
123    pub(crate) cloud_watch_logs_role_arn: ::std::option::Option<::std::string::String>,
124    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
125    pub(crate) is_organization_trail: ::std::option::Option<bool>,
126    _request_id: Option<String>,
127}
128impl CreateTrailOutputBuilder {
129    /// <p>Specifies the name of the trail.</p>
130    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.name = ::std::option::Option::Some(input.into());
132        self
133    }
134    /// <p>Specifies the name of the trail.</p>
135    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.name = input;
137        self
138    }
139    /// <p>Specifies the name of the trail.</p>
140    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
141        &self.name
142    }
143    /// <p>Specifies the name of the Amazon S3 bucket designated for publishing log files.</p>
144    pub fn s3_bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.s3_bucket_name = ::std::option::Option::Some(input.into());
146        self
147    }
148    /// <p>Specifies the name of the Amazon S3 bucket designated for publishing log files.</p>
149    pub fn set_s3_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.s3_bucket_name = input;
151        self
152    }
153    /// <p>Specifies the name of the Amazon S3 bucket designated for publishing log files.</p>
154    pub fn get_s3_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
155        &self.s3_bucket_name
156    }
157    /// <p>Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files">Finding Your CloudTrail Log Files</a>.</p>
158    pub fn s3_key_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.s3_key_prefix = ::std::option::Option::Some(input.into());
160        self
161    }
162    /// <p>Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files">Finding Your CloudTrail Log Files</a>.</p>
163    pub fn set_s3_key_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.s3_key_prefix = input;
165        self
166    }
167    /// <p>Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files">Finding Your CloudTrail Log Files</a>.</p>
168    pub fn get_s3_key_prefix(&self) -> &::std::option::Option<::std::string::String> {
169        &self.s3_key_prefix
170    }
171    /// <p>This field is no longer in use. Use <code>SnsTopicARN</code>.</p>
172    #[deprecated]
173    pub fn sns_topic_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174        self.sns_topic_name = ::std::option::Option::Some(input.into());
175        self
176    }
177    /// <p>This field is no longer in use. Use <code>SnsTopicARN</code>.</p>
178    #[deprecated]
179    pub fn set_sns_topic_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180        self.sns_topic_name = input;
181        self
182    }
183    /// <p>This field is no longer in use. Use <code>SnsTopicARN</code>.</p>
184    #[deprecated]
185    pub fn get_sns_topic_name(&self) -> &::std::option::Option<::std::string::String> {
186        &self.sns_topic_name
187    }
188    /// <p>Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications when log files are delivered. The format of a topic ARN is:</p>
189    /// <p><code>arn:aws:sns:us-east-2:123456789012:MyTopic</code></p>
190    pub fn sns_topic_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.sns_topic_arn = ::std::option::Option::Some(input.into());
192        self
193    }
194    /// <p>Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications when log files are delivered. The format of a topic ARN is:</p>
195    /// <p><code>arn:aws:sns:us-east-2:123456789012:MyTopic</code></p>
196    pub fn set_sns_topic_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197        self.sns_topic_arn = input;
198        self
199    }
200    /// <p>Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications when log files are delivered. The format of a topic ARN is:</p>
201    /// <p><code>arn:aws:sns:us-east-2:123456789012:MyTopic</code></p>
202    pub fn get_sns_topic_arn(&self) -> &::std::option::Option<::std::string::String> {
203        &self.sns_topic_arn
204    }
205    /// <p>Specifies whether the trail is publishing events from global services such as IAM to the log files.</p>
206    pub fn include_global_service_events(mut self, input: bool) -> Self {
207        self.include_global_service_events = ::std::option::Option::Some(input);
208        self
209    }
210    /// <p>Specifies whether the trail is publishing events from global services such as IAM to the log files.</p>
211    pub fn set_include_global_service_events(mut self, input: ::std::option::Option<bool>) -> Self {
212        self.include_global_service_events = input;
213        self
214    }
215    /// <p>Specifies whether the trail is publishing events from global services such as IAM to the log files.</p>
216    pub fn get_include_global_service_events(&self) -> &::std::option::Option<bool> {
217        &self.include_global_service_events
218    }
219    /// <p>Specifies whether the trail exists in one Region or in all Regions.</p>
220    pub fn is_multi_region_trail(mut self, input: bool) -> Self {
221        self.is_multi_region_trail = ::std::option::Option::Some(input);
222        self
223    }
224    /// <p>Specifies whether the trail exists in one Region or in all Regions.</p>
225    pub fn set_is_multi_region_trail(mut self, input: ::std::option::Option<bool>) -> Self {
226        self.is_multi_region_trail = input;
227        self
228    }
229    /// <p>Specifies whether the trail exists in one Region or in all Regions.</p>
230    pub fn get_is_multi_region_trail(&self) -> &::std::option::Option<bool> {
231        &self.is_multi_region_trail
232    }
233    /// <p>Specifies the ARN of the trail that was created. The format of a trail ARN is:</p>
234    /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
235    pub fn trail_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
236        self.trail_arn = ::std::option::Option::Some(input.into());
237        self
238    }
239    /// <p>Specifies the ARN of the trail that was created. The format of a trail ARN is:</p>
240    /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
241    pub fn set_trail_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
242        self.trail_arn = input;
243        self
244    }
245    /// <p>Specifies the ARN of the trail that was created. The format of a trail ARN is:</p>
246    /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
247    pub fn get_trail_arn(&self) -> &::std::option::Option<::std::string::String> {
248        &self.trail_arn
249    }
250    /// <p>Specifies whether log file integrity validation is enabled.</p>
251    pub fn log_file_validation_enabled(mut self, input: bool) -> Self {
252        self.log_file_validation_enabled = ::std::option::Option::Some(input);
253        self
254    }
255    /// <p>Specifies whether log file integrity validation is enabled.</p>
256    pub fn set_log_file_validation_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
257        self.log_file_validation_enabled = input;
258        self
259    }
260    /// <p>Specifies whether log file integrity validation is enabled.</p>
261    pub fn get_log_file_validation_enabled(&self) -> &::std::option::Option<bool> {
262        &self.log_file_validation_enabled
263    }
264    /// <p>Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs will be delivered.</p>
265    pub fn cloud_watch_logs_log_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
266        self.cloud_watch_logs_log_group_arn = ::std::option::Option::Some(input.into());
267        self
268    }
269    /// <p>Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs will be delivered.</p>
270    pub fn set_cloud_watch_logs_log_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
271        self.cloud_watch_logs_log_group_arn = input;
272        self
273    }
274    /// <p>Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs will be delivered.</p>
275    pub fn get_cloud_watch_logs_log_group_arn(&self) -> &::std::option::Option<::std::string::String> {
276        &self.cloud_watch_logs_log_group_arn
277    }
278    /// <p>Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.</p>
279    pub fn cloud_watch_logs_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
280        self.cloud_watch_logs_role_arn = ::std::option::Option::Some(input.into());
281        self
282    }
283    /// <p>Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.</p>
284    pub fn set_cloud_watch_logs_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
285        self.cloud_watch_logs_role_arn = input;
286        self
287    }
288    /// <p>Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.</p>
289    pub fn get_cloud_watch_logs_role_arn(&self) -> &::std::option::Option<::std::string::String> {
290        &self.cloud_watch_logs_role_arn
291    }
292    /// <p>Specifies the KMS key ID that encrypts the events delivered by CloudTrail. The value is a fully specified ARN to a KMS key in the following format.</p>
293    /// <p><code>arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012</code></p>
294    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
295        self.kms_key_id = ::std::option::Option::Some(input.into());
296        self
297    }
298    /// <p>Specifies the KMS key ID that encrypts the events delivered by CloudTrail. The value is a fully specified ARN to a KMS key in the following format.</p>
299    /// <p><code>arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012</code></p>
300    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
301        self.kms_key_id = input;
302        self
303    }
304    /// <p>Specifies the KMS key ID that encrypts the events delivered by CloudTrail. The value is a fully specified ARN to a KMS key in the following format.</p>
305    /// <p><code>arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012</code></p>
306    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
307        &self.kms_key_id
308    }
309    /// <p>Specifies whether the trail is an organization trail.</p>
310    pub fn is_organization_trail(mut self, input: bool) -> Self {
311        self.is_organization_trail = ::std::option::Option::Some(input);
312        self
313    }
314    /// <p>Specifies whether the trail is an organization trail.</p>
315    pub fn set_is_organization_trail(mut self, input: ::std::option::Option<bool>) -> Self {
316        self.is_organization_trail = input;
317        self
318    }
319    /// <p>Specifies whether the trail is an organization trail.</p>
320    pub fn get_is_organization_trail(&self) -> &::std::option::Option<bool> {
321        &self.is_organization_trail
322    }
323    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
324        self._request_id = Some(request_id.into());
325        self
326    }
327
328    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
329        self._request_id = request_id;
330        self
331    }
332    /// Consumes the builder and constructs a [`CreateTrailOutput`](crate::operation::create_trail::CreateTrailOutput).
333    pub fn build(self) -> crate::operation::create_trail::CreateTrailOutput {
334        crate::operation::create_trail::CreateTrailOutput {
335            name: self.name,
336            s3_bucket_name: self.s3_bucket_name,
337            s3_key_prefix: self.s3_key_prefix,
338            sns_topic_name: self.sns_topic_name,
339            sns_topic_arn: self.sns_topic_arn,
340            include_global_service_events: self.include_global_service_events,
341            is_multi_region_trail: self.is_multi_region_trail,
342            trail_arn: self.trail_arn,
343            log_file_validation_enabled: self.log_file_validation_enabled,
344            cloud_watch_logs_log_group_arn: self.cloud_watch_logs_log_group_arn,
345            cloud_watch_logs_role_arn: self.cloud_watch_logs_role_arn,
346            kms_key_id: self.kms_key_id,
347            is_organization_trail: self.is_organization_trail,
348            _request_id: self._request_id,
349        }
350    }
351}