aws_sdk_cloudtrail/operation/describe_trails/_describe_trails_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 DescribeTrailsOutput {
7 /// <p>The list of trail objects. Trail objects with string values are only returned if values for the objects exist in a trail's configuration. For example, <code>SNSTopicName</code> and <code>SNSTopicARN</code> are only returned in results if a trail is configured to send SNS notifications. Similarly, <code>KMSKeyId</code> only appears in results if a trail's log files are encrypted with KMS customer managed keys.</p>
8 pub trail_list: ::std::option::Option<::std::vec::Vec<crate::types::Trail>>,
9 _request_id: Option<String>,
10}
11impl DescribeTrailsOutput {
12 /// <p>The list of trail objects. Trail objects with string values are only returned if values for the objects exist in a trail's configuration. For example, <code>SNSTopicName</code> and <code>SNSTopicARN</code> are only returned in results if a trail is configured to send SNS notifications. Similarly, <code>KMSKeyId</code> only appears in results if a trail's log files are encrypted with KMS customer managed keys.</p>
13 ///
14 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.trail_list.is_none()`.
15 pub fn trail_list(&self) -> &[crate::types::Trail] {
16 self.trail_list.as_deref().unwrap_or_default()
17 }
18}
19impl ::aws_types::request_id::RequestId for DescribeTrailsOutput {
20 fn request_id(&self) -> Option<&str> {
21 self._request_id.as_deref()
22 }
23}
24impl DescribeTrailsOutput {
25 /// Creates a new builder-style object to manufacture [`DescribeTrailsOutput`](crate::operation::describe_trails::DescribeTrailsOutput).
26 pub fn builder() -> crate::operation::describe_trails::builders::DescribeTrailsOutputBuilder {
27 crate::operation::describe_trails::builders::DescribeTrailsOutputBuilder::default()
28 }
29}
30
31/// A builder for [`DescribeTrailsOutput`](crate::operation::describe_trails::DescribeTrailsOutput).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct DescribeTrailsOutputBuilder {
35 pub(crate) trail_list: ::std::option::Option<::std::vec::Vec<crate::types::Trail>>,
36 _request_id: Option<String>,
37}
38impl DescribeTrailsOutputBuilder {
39 /// Appends an item to `trail_list`.
40 ///
41 /// To override the contents of this collection use [`set_trail_list`](Self::set_trail_list).
42 ///
43 /// <p>The list of trail objects. Trail objects with string values are only returned if values for the objects exist in a trail's configuration. For example, <code>SNSTopicName</code> and <code>SNSTopicARN</code> are only returned in results if a trail is configured to send SNS notifications. Similarly, <code>KMSKeyId</code> only appears in results if a trail's log files are encrypted with KMS customer managed keys.</p>
44 pub fn trail_list(mut self, input: crate::types::Trail) -> Self {
45 let mut v = self.trail_list.unwrap_or_default();
46 v.push(input);
47 self.trail_list = ::std::option::Option::Some(v);
48 self
49 }
50 /// <p>The list of trail objects. Trail objects with string values are only returned if values for the objects exist in a trail's configuration. For example, <code>SNSTopicName</code> and <code>SNSTopicARN</code> are only returned in results if a trail is configured to send SNS notifications. Similarly, <code>KMSKeyId</code> only appears in results if a trail's log files are encrypted with KMS customer managed keys.</p>
51 pub fn set_trail_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Trail>>) -> Self {
52 self.trail_list = input;
53 self
54 }
55 /// <p>The list of trail objects. Trail objects with string values are only returned if values for the objects exist in a trail's configuration. For example, <code>SNSTopicName</code> and <code>SNSTopicARN</code> are only returned in results if a trail is configured to send SNS notifications. Similarly, <code>KMSKeyId</code> only appears in results if a trail's log files are encrypted with KMS customer managed keys.</p>
56 pub fn get_trail_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Trail>> {
57 &self.trail_list
58 }
59 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
60 self._request_id = Some(request_id.into());
61 self
62 }
63
64 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
65 self._request_id = request_id;
66 self
67 }
68 /// Consumes the builder and constructs a [`DescribeTrailsOutput`](crate::operation::describe_trails::DescribeTrailsOutput).
69 pub fn build(self) -> crate::operation::describe_trails::DescribeTrailsOutput {
70 crate::operation::describe_trails::DescribeTrailsOutput {
71 trail_list: self.trail_list,
72 _request_id: self._request_id,
73 }
74 }
75}