aws_sdk_cloudtrail/operation/create_channel/
_create_channel_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateChannelOutput {
6    /// <p>The Amazon Resource Name (ARN) of the new channel.</p>
7    pub channel_arn: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the new channel.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>The partner or external event source name.</p>
11    pub source: ::std::option::Option<::std::string::String>,
12    /// <p>The event data stores that log the events arriving through the channel.</p>
13    pub destinations: ::std::option::Option<::std::vec::Vec<crate::types::Destination>>,
14    /// <p>A list of tags.</p>
15    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
16    _request_id: Option<String>,
17}
18impl CreateChannelOutput {
19    /// <p>The Amazon Resource Name (ARN) of the new channel.</p>
20    pub fn channel_arn(&self) -> ::std::option::Option<&str> {
21        self.channel_arn.as_deref()
22    }
23    /// <p>The name of the new channel.</p>
24    pub fn name(&self) -> ::std::option::Option<&str> {
25        self.name.as_deref()
26    }
27    /// <p>The partner or external event source name.</p>
28    pub fn source(&self) -> ::std::option::Option<&str> {
29        self.source.as_deref()
30    }
31    /// <p>The event data stores that log the events arriving through the channel.</p>
32    ///
33    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.destinations.is_none()`.
34    pub fn destinations(&self) -> &[crate::types::Destination] {
35        self.destinations.as_deref().unwrap_or_default()
36    }
37    /// <p>A list of tags.</p>
38    ///
39    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
40    pub fn tags(&self) -> &[crate::types::Tag] {
41        self.tags.as_deref().unwrap_or_default()
42    }
43}
44impl ::aws_types::request_id::RequestId for CreateChannelOutput {
45    fn request_id(&self) -> Option<&str> {
46        self._request_id.as_deref()
47    }
48}
49impl CreateChannelOutput {
50    /// Creates a new builder-style object to manufacture [`CreateChannelOutput`](crate::operation::create_channel::CreateChannelOutput).
51    pub fn builder() -> crate::operation::create_channel::builders::CreateChannelOutputBuilder {
52        crate::operation::create_channel::builders::CreateChannelOutputBuilder::default()
53    }
54}
55
56/// A builder for [`CreateChannelOutput`](crate::operation::create_channel::CreateChannelOutput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct CreateChannelOutputBuilder {
60    pub(crate) channel_arn: ::std::option::Option<::std::string::String>,
61    pub(crate) name: ::std::option::Option<::std::string::String>,
62    pub(crate) source: ::std::option::Option<::std::string::String>,
63    pub(crate) destinations: ::std::option::Option<::std::vec::Vec<crate::types::Destination>>,
64    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
65    _request_id: Option<String>,
66}
67impl CreateChannelOutputBuilder {
68    /// <p>The Amazon Resource Name (ARN) of the new channel.</p>
69    pub fn channel_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.channel_arn = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>The Amazon Resource Name (ARN) of the new channel.</p>
74    pub fn set_channel_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.channel_arn = input;
76        self
77    }
78    /// <p>The Amazon Resource Name (ARN) of the new channel.</p>
79    pub fn get_channel_arn(&self) -> &::std::option::Option<::std::string::String> {
80        &self.channel_arn
81    }
82    /// <p>The name of the new channel.</p>
83    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.name = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The name of the new channel.</p>
88    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.name = input;
90        self
91    }
92    /// <p>The name of the new channel.</p>
93    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
94        &self.name
95    }
96    /// <p>The partner or external event source name.</p>
97    pub fn source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98        self.source = ::std::option::Option::Some(input.into());
99        self
100    }
101    /// <p>The partner or external event source name.</p>
102    pub fn set_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103        self.source = input;
104        self
105    }
106    /// <p>The partner or external event source name.</p>
107    pub fn get_source(&self) -> &::std::option::Option<::std::string::String> {
108        &self.source
109    }
110    /// Appends an item to `destinations`.
111    ///
112    /// To override the contents of this collection use [`set_destinations`](Self::set_destinations).
113    ///
114    /// <p>The event data stores that log the events arriving through the channel.</p>
115    pub fn destinations(mut self, input: crate::types::Destination) -> Self {
116        let mut v = self.destinations.unwrap_or_default();
117        v.push(input);
118        self.destinations = ::std::option::Option::Some(v);
119        self
120    }
121    /// <p>The event data stores that log the events arriving through the channel.</p>
122    pub fn set_destinations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Destination>>) -> Self {
123        self.destinations = input;
124        self
125    }
126    /// <p>The event data stores that log the events arriving through the channel.</p>
127    pub fn get_destinations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Destination>> {
128        &self.destinations
129    }
130    /// Appends an item to `tags`.
131    ///
132    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
133    ///
134    /// <p>A list of tags.</p>
135    pub fn tags(mut self, input: crate::types::Tag) -> Self {
136        let mut v = self.tags.unwrap_or_default();
137        v.push(input);
138        self.tags = ::std::option::Option::Some(v);
139        self
140    }
141    /// <p>A list of tags.</p>
142    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
143        self.tags = input;
144        self
145    }
146    /// <p>A list of tags.</p>
147    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
148        &self.tags
149    }
150    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
151        self._request_id = Some(request_id.into());
152        self
153    }
154
155    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
156        self._request_id = request_id;
157        self
158    }
159    /// Consumes the builder and constructs a [`CreateChannelOutput`](crate::operation::create_channel::CreateChannelOutput).
160    pub fn build(self) -> crate::operation::create_channel::CreateChannelOutput {
161        crate::operation::create_channel::CreateChannelOutput {
162            channel_arn: self.channel_arn,
163            name: self.name,
164            source: self.source,
165            destinations: self.destinations,
166            tags: self.tags,
167            _request_id: self._request_id,
168        }
169    }
170}