aws_sdk_cloudtrail/operation/update_channel/
_update_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 UpdateChannelOutput {
6    /// <p>The ARN of the channel that was updated.</p>
7    pub channel_arn: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the channel that was updated.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>The event source of the channel that was updated.</p>
11    pub source: ::std::option::Option<::std::string::String>,
12    /// <p>The event data stores that log events arriving through the channel.</p>
13    pub destinations: ::std::option::Option<::std::vec::Vec<crate::types::Destination>>,
14    _request_id: Option<String>,
15}
16impl UpdateChannelOutput {
17    /// <p>The ARN of the channel that was updated.</p>
18    pub fn channel_arn(&self) -> ::std::option::Option<&str> {
19        self.channel_arn.as_deref()
20    }
21    /// <p>The name of the channel that was updated.</p>
22    pub fn name(&self) -> ::std::option::Option<&str> {
23        self.name.as_deref()
24    }
25    /// <p>The event source of the channel that was updated.</p>
26    pub fn source(&self) -> ::std::option::Option<&str> {
27        self.source.as_deref()
28    }
29    /// <p>The event data stores that log events arriving through the channel.</p>
30    ///
31    /// 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()`.
32    pub fn destinations(&self) -> &[crate::types::Destination] {
33        self.destinations.as_deref().unwrap_or_default()
34    }
35}
36impl ::aws_types::request_id::RequestId for UpdateChannelOutput {
37    fn request_id(&self) -> Option<&str> {
38        self._request_id.as_deref()
39    }
40}
41impl UpdateChannelOutput {
42    /// Creates a new builder-style object to manufacture [`UpdateChannelOutput`](crate::operation::update_channel::UpdateChannelOutput).
43    pub fn builder() -> crate::operation::update_channel::builders::UpdateChannelOutputBuilder {
44        crate::operation::update_channel::builders::UpdateChannelOutputBuilder::default()
45    }
46}
47
48/// A builder for [`UpdateChannelOutput`](crate::operation::update_channel::UpdateChannelOutput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct UpdateChannelOutputBuilder {
52    pub(crate) channel_arn: ::std::option::Option<::std::string::String>,
53    pub(crate) name: ::std::option::Option<::std::string::String>,
54    pub(crate) source: ::std::option::Option<::std::string::String>,
55    pub(crate) destinations: ::std::option::Option<::std::vec::Vec<crate::types::Destination>>,
56    _request_id: Option<String>,
57}
58impl UpdateChannelOutputBuilder {
59    /// <p>The ARN of the channel that was updated.</p>
60    pub fn channel_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.channel_arn = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The ARN of the channel that was updated.</p>
65    pub fn set_channel_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.channel_arn = input;
67        self
68    }
69    /// <p>The ARN of the channel that was updated.</p>
70    pub fn get_channel_arn(&self) -> &::std::option::Option<::std::string::String> {
71        &self.channel_arn
72    }
73    /// <p>The name of the channel that was updated.</p>
74    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.name = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>The name of the channel that was updated.</p>
79    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.name = input;
81        self
82    }
83    /// <p>The name of the channel that was updated.</p>
84    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
85        &self.name
86    }
87    /// <p>The event source of the channel that was updated.</p>
88    pub fn source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.source = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The event source of the channel that was updated.</p>
93    pub fn set_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.source = input;
95        self
96    }
97    /// <p>The event source of the channel that was updated.</p>
98    pub fn get_source(&self) -> &::std::option::Option<::std::string::String> {
99        &self.source
100    }
101    /// Appends an item to `destinations`.
102    ///
103    /// To override the contents of this collection use [`set_destinations`](Self::set_destinations).
104    ///
105    /// <p>The event data stores that log events arriving through the channel.</p>
106    pub fn destinations(mut self, input: crate::types::Destination) -> Self {
107        let mut v = self.destinations.unwrap_or_default();
108        v.push(input);
109        self.destinations = ::std::option::Option::Some(v);
110        self
111    }
112    /// <p>The event data stores that log events arriving through the channel.</p>
113    pub fn set_destinations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Destination>>) -> Self {
114        self.destinations = input;
115        self
116    }
117    /// <p>The event data stores that log events arriving through the channel.</p>
118    pub fn get_destinations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Destination>> {
119        &self.destinations
120    }
121    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
122        self._request_id = Some(request_id.into());
123        self
124    }
125
126    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
127        self._request_id = request_id;
128        self
129    }
130    /// Consumes the builder and constructs a [`UpdateChannelOutput`](crate::operation::update_channel::UpdateChannelOutput).
131    pub fn build(self) -> crate::operation::update_channel::UpdateChannelOutput {
132        crate::operation::update_channel::UpdateChannelOutput {
133            channel_arn: self.channel_arn,
134            name: self.name,
135            source: self.source,
136            destinations: self.destinations,
137            _request_id: self._request_id,
138        }
139    }
140}