aws_sdk_cloudtrail/operation/create_channel/
_create_channel_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateChannelOutput {
6 pub channel_arn: ::std::option::Option<::std::string::String>,
8 pub name: ::std::option::Option<::std::string::String>,
10 pub source: ::std::option::Option<::std::string::String>,
12 pub destinations: ::std::option::Option<::std::vec::Vec<crate::types::Destination>>,
14 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
16 _request_id: Option<String>,
17}
18impl CreateChannelOutput {
19 pub fn channel_arn(&self) -> ::std::option::Option<&str> {
21 self.channel_arn.as_deref()
22 }
23 pub fn name(&self) -> ::std::option::Option<&str> {
25 self.name.as_deref()
26 }
27 pub fn source(&self) -> ::std::option::Option<&str> {
29 self.source.as_deref()
30 }
31 pub fn destinations(&self) -> &[crate::types::Destination] {
35 self.destinations.as_deref().unwrap_or_default()
36 }
37 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 pub fn builder() -> crate::operation::create_channel::builders::CreateChannelOutputBuilder {
52 crate::operation::create_channel::builders::CreateChannelOutputBuilder::default()
53 }
54}
55
56#[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 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 pub fn set_channel_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75 self.channel_arn = input;
76 self
77 }
78 pub fn get_channel_arn(&self) -> &::std::option::Option<::std::string::String> {
80 &self.channel_arn
81 }
82 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89 self.name = input;
90 self
91 }
92 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
94 &self.name
95 }
96 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 pub fn set_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103 self.source = input;
104 self
105 }
106 pub fn get_source(&self) -> &::std::option::Option<::std::string::String> {
108 &self.source
109 }
110 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 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 pub fn get_destinations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Destination>> {
128 &self.destinations
129 }
130 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 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 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 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}