aws_sdk_cloudtrail/operation/update_channel/
_update_channel_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateChannelInput {
6 pub channel: ::std::option::Option<::std::string::String>,
8 pub destinations: ::std::option::Option<::std::vec::Vec<crate::types::Destination>>,
10 pub name: ::std::option::Option<::std::string::String>,
12}
13impl UpdateChannelInput {
14 pub fn channel(&self) -> ::std::option::Option<&str> {
16 self.channel.as_deref()
17 }
18 pub fn destinations(&self) -> &[crate::types::Destination] {
22 self.destinations.as_deref().unwrap_or_default()
23 }
24 pub fn name(&self) -> ::std::option::Option<&str> {
26 self.name.as_deref()
27 }
28}
29impl UpdateChannelInput {
30 pub fn builder() -> crate::operation::update_channel::builders::UpdateChannelInputBuilder {
32 crate::operation::update_channel::builders::UpdateChannelInputBuilder::default()
33 }
34}
35
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct UpdateChannelInputBuilder {
40 pub(crate) channel: ::std::option::Option<::std::string::String>,
41 pub(crate) destinations: ::std::option::Option<::std::vec::Vec<crate::types::Destination>>,
42 pub(crate) name: ::std::option::Option<::std::string::String>,
43}
44impl UpdateChannelInputBuilder {
45 pub fn channel(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48 self.channel = ::std::option::Option::Some(input.into());
49 self
50 }
51 pub fn set_channel(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53 self.channel = input;
54 self
55 }
56 pub fn get_channel(&self) -> &::std::option::Option<::std::string::String> {
58 &self.channel
59 }
60 pub fn destinations(mut self, input: crate::types::Destination) -> Self {
66 let mut v = self.destinations.unwrap_or_default();
67 v.push(input);
68 self.destinations = ::std::option::Option::Some(v);
69 self
70 }
71 pub fn set_destinations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Destination>>) -> Self {
73 self.destinations = input;
74 self
75 }
76 pub fn get_destinations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Destination>> {
78 &self.destinations
79 }
80 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82 self.name = ::std::option::Option::Some(input.into());
83 self
84 }
85 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87 self.name = input;
88 self
89 }
90 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
92 &self.name
93 }
94 pub fn build(
96 self,
97 ) -> ::std::result::Result<crate::operation::update_channel::UpdateChannelInput, ::aws_smithy_types::error::operation::BuildError> {
98 ::std::result::Result::Ok(crate::operation::update_channel::UpdateChannelInput {
99 channel: self.channel,
100 destinations: self.destinations,
101 name: self.name,
102 })
103 }
104}