aws_sdk_cloudtrail/operation/update_channel/
_update_channel_input.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 UpdateChannelInput {
6    /// <p>The ARN or ID (the ARN suffix) of the channel that you want to update.</p>
7    pub channel: ::std::option::Option<::std::string::String>,
8    /// <p>The ARNs of event data stores that you want to log events arriving through the channel.</p>
9    pub destinations: ::std::option::Option<::std::vec::Vec<crate::types::Destination>>,
10    /// <p>Changes the name of the channel.</p>
11    pub name: ::std::option::Option<::std::string::String>,
12}
13impl UpdateChannelInput {
14    /// <p>The ARN or ID (the ARN suffix) of the channel that you want to update.</p>
15    pub fn channel(&self) -> ::std::option::Option<&str> {
16        self.channel.as_deref()
17    }
18    /// <p>The ARNs of event data stores that you want to log events arriving through the channel.</p>
19    ///
20    /// 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()`.
21    pub fn destinations(&self) -> &[crate::types::Destination] {
22        self.destinations.as_deref().unwrap_or_default()
23    }
24    /// <p>Changes the name of the channel.</p>
25    pub fn name(&self) -> ::std::option::Option<&str> {
26        self.name.as_deref()
27    }
28}
29impl UpdateChannelInput {
30    /// Creates a new builder-style object to manufacture [`UpdateChannelInput`](crate::operation::update_channel::UpdateChannelInput).
31    pub fn builder() -> crate::operation::update_channel::builders::UpdateChannelInputBuilder {
32        crate::operation::update_channel::builders::UpdateChannelInputBuilder::default()
33    }
34}
35
36/// A builder for [`UpdateChannelInput`](crate::operation::update_channel::UpdateChannelInput).
37#[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    /// <p>The ARN or ID (the ARN suffix) of the channel that you want to update.</p>
46    /// This field is required.
47    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    /// <p>The ARN or ID (the ARN suffix) of the channel that you want to update.</p>
52    pub fn set_channel(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.channel = input;
54        self
55    }
56    /// <p>The ARN or ID (the ARN suffix) of the channel that you want to update.</p>
57    pub fn get_channel(&self) -> &::std::option::Option<::std::string::String> {
58        &self.channel
59    }
60    /// Appends an item to `destinations`.
61    ///
62    /// To override the contents of this collection use [`set_destinations`](Self::set_destinations).
63    ///
64    /// <p>The ARNs of event data stores that you want to log events arriving through the channel.</p>
65    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    /// <p>The ARNs of event data stores that you want to log events arriving through the channel.</p>
72    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    /// <p>The ARNs of event data stores that you want to log events arriving through the channel.</p>
77    pub fn get_destinations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Destination>> {
78        &self.destinations
79    }
80    /// <p>Changes the name of the channel.</p>
81    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    /// <p>Changes the name of the channel.</p>
86    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.name = input;
88        self
89    }
90    /// <p>Changes the name of the channel.</p>
91    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
92        &self.name
93    }
94    /// Consumes the builder and constructs a [`UpdateChannelInput`](crate::operation::update_channel::UpdateChannelInput).
95    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}