aws_sdk_cloudtrail/operation/get_channel/
_get_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 GetChannelOutput {
6    /// <p>The ARN of an channel returned by a <code>GetChannel</code> request.</p>
7    pub channel_arn: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the CloudTrail channel. For service-linked channels, the name is <code>aws-service-channel/service-name/custom-suffix</code> where <code>service-name</code> represents the name of the Amazon Web Services service that created the channel and <code>custom-suffix</code> represents the suffix generated by the Amazon Web Services service.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>The source for the CloudTrail channel.</p>
11    pub source: ::std::option::Option<::std::string::String>,
12    /// <p>Provides information about the advanced event selectors configured for the channel, and whether the channel applies to all Regions or a single Region.</p>
13    pub source_config: ::std::option::Option<crate::types::SourceConfig>,
14    /// <p>The destinations for the channel. For channels created for integrations, the destinations are the event data stores that log events arriving through the channel. For service-linked channels, the destination is the Amazon Web Services service that created the service-linked channel to receive events.</p>
15    pub destinations: ::std::option::Option<::std::vec::Vec<crate::types::Destination>>,
16    /// <p>A table showing information about the most recent successful and failed attempts to ingest events.</p>
17    pub ingestion_status: ::std::option::Option<crate::types::IngestionStatus>,
18    _request_id: Option<String>,
19}
20impl GetChannelOutput {
21    /// <p>The ARN of an channel returned by a <code>GetChannel</code> request.</p>
22    pub fn channel_arn(&self) -> ::std::option::Option<&str> {
23        self.channel_arn.as_deref()
24    }
25    /// <p>The name of the CloudTrail channel. For service-linked channels, the name is <code>aws-service-channel/service-name/custom-suffix</code> where <code>service-name</code> represents the name of the Amazon Web Services service that created the channel and <code>custom-suffix</code> represents the suffix generated by the Amazon Web Services service.</p>
26    pub fn name(&self) -> ::std::option::Option<&str> {
27        self.name.as_deref()
28    }
29    /// <p>The source for the CloudTrail channel.</p>
30    pub fn source(&self) -> ::std::option::Option<&str> {
31        self.source.as_deref()
32    }
33    /// <p>Provides information about the advanced event selectors configured for the channel, and whether the channel applies to all Regions or a single Region.</p>
34    pub fn source_config(&self) -> ::std::option::Option<&crate::types::SourceConfig> {
35        self.source_config.as_ref()
36    }
37    /// <p>The destinations for the channel. For channels created for integrations, the destinations are the event data stores that log events arriving through the channel. For service-linked channels, the destination is the Amazon Web Services service that created the service-linked channel to receive events.</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 `.destinations.is_none()`.
40    pub fn destinations(&self) -> &[crate::types::Destination] {
41        self.destinations.as_deref().unwrap_or_default()
42    }
43    /// <p>A table showing information about the most recent successful and failed attempts to ingest events.</p>
44    pub fn ingestion_status(&self) -> ::std::option::Option<&crate::types::IngestionStatus> {
45        self.ingestion_status.as_ref()
46    }
47}
48impl ::aws_types::request_id::RequestId for GetChannelOutput {
49    fn request_id(&self) -> Option<&str> {
50        self._request_id.as_deref()
51    }
52}
53impl GetChannelOutput {
54    /// Creates a new builder-style object to manufacture [`GetChannelOutput`](crate::operation::get_channel::GetChannelOutput).
55    pub fn builder() -> crate::operation::get_channel::builders::GetChannelOutputBuilder {
56        crate::operation::get_channel::builders::GetChannelOutputBuilder::default()
57    }
58}
59
60/// A builder for [`GetChannelOutput`](crate::operation::get_channel::GetChannelOutput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct GetChannelOutputBuilder {
64    pub(crate) channel_arn: ::std::option::Option<::std::string::String>,
65    pub(crate) name: ::std::option::Option<::std::string::String>,
66    pub(crate) source: ::std::option::Option<::std::string::String>,
67    pub(crate) source_config: ::std::option::Option<crate::types::SourceConfig>,
68    pub(crate) destinations: ::std::option::Option<::std::vec::Vec<crate::types::Destination>>,
69    pub(crate) ingestion_status: ::std::option::Option<crate::types::IngestionStatus>,
70    _request_id: Option<String>,
71}
72impl GetChannelOutputBuilder {
73    /// <p>The ARN of an channel returned by a <code>GetChannel</code> request.</p>
74    pub fn channel_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.channel_arn = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>The ARN of an channel returned by a <code>GetChannel</code> request.</p>
79    pub fn set_channel_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.channel_arn = input;
81        self
82    }
83    /// <p>The ARN of an channel returned by a <code>GetChannel</code> request.</p>
84    pub fn get_channel_arn(&self) -> &::std::option::Option<::std::string::String> {
85        &self.channel_arn
86    }
87    /// <p>The name of the CloudTrail channel. For service-linked channels, the name is <code>aws-service-channel/service-name/custom-suffix</code> where <code>service-name</code> represents the name of the Amazon Web Services service that created the channel and <code>custom-suffix</code> represents the suffix generated by the Amazon Web Services service.</p>
88    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.name = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The name of the CloudTrail channel. For service-linked channels, the name is <code>aws-service-channel/service-name/custom-suffix</code> where <code>service-name</code> represents the name of the Amazon Web Services service that created the channel and <code>custom-suffix</code> represents the suffix generated by the Amazon Web Services service.</p>
93    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.name = input;
95        self
96    }
97    /// <p>The name of the CloudTrail channel. For service-linked channels, the name is <code>aws-service-channel/service-name/custom-suffix</code> where <code>service-name</code> represents the name of the Amazon Web Services service that created the channel and <code>custom-suffix</code> represents the suffix generated by the Amazon Web Services service.</p>
98    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
99        &self.name
100    }
101    /// <p>The source for the CloudTrail channel.</p>
102    pub fn source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.source = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>The source for the CloudTrail channel.</p>
107    pub fn set_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.source = input;
109        self
110    }
111    /// <p>The source for the CloudTrail channel.</p>
112    pub fn get_source(&self) -> &::std::option::Option<::std::string::String> {
113        &self.source
114    }
115    /// <p>Provides information about the advanced event selectors configured for the channel, and whether the channel applies to all Regions or a single Region.</p>
116    pub fn source_config(mut self, input: crate::types::SourceConfig) -> Self {
117        self.source_config = ::std::option::Option::Some(input);
118        self
119    }
120    /// <p>Provides information about the advanced event selectors configured for the channel, and whether the channel applies to all Regions or a single Region.</p>
121    pub fn set_source_config(mut self, input: ::std::option::Option<crate::types::SourceConfig>) -> Self {
122        self.source_config = input;
123        self
124    }
125    /// <p>Provides information about the advanced event selectors configured for the channel, and whether the channel applies to all Regions or a single Region.</p>
126    pub fn get_source_config(&self) -> &::std::option::Option<crate::types::SourceConfig> {
127        &self.source_config
128    }
129    /// Appends an item to `destinations`.
130    ///
131    /// To override the contents of this collection use [`set_destinations`](Self::set_destinations).
132    ///
133    /// <p>The destinations for the channel. For channels created for integrations, the destinations are the event data stores that log events arriving through the channel. For service-linked channels, the destination is the Amazon Web Services service that created the service-linked channel to receive events.</p>
134    pub fn destinations(mut self, input: crate::types::Destination) -> Self {
135        let mut v = self.destinations.unwrap_or_default();
136        v.push(input);
137        self.destinations = ::std::option::Option::Some(v);
138        self
139    }
140    /// <p>The destinations for the channel. For channels created for integrations, the destinations are the event data stores that log events arriving through the channel. For service-linked channels, the destination is the Amazon Web Services service that created the service-linked channel to receive events.</p>
141    pub fn set_destinations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Destination>>) -> Self {
142        self.destinations = input;
143        self
144    }
145    /// <p>The destinations for the channel. For channels created for integrations, the destinations are the event data stores that log events arriving through the channel. For service-linked channels, the destination is the Amazon Web Services service that created the service-linked channel to receive events.</p>
146    pub fn get_destinations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Destination>> {
147        &self.destinations
148    }
149    /// <p>A table showing information about the most recent successful and failed attempts to ingest events.</p>
150    pub fn ingestion_status(mut self, input: crate::types::IngestionStatus) -> Self {
151        self.ingestion_status = ::std::option::Option::Some(input);
152        self
153    }
154    /// <p>A table showing information about the most recent successful and failed attempts to ingest events.</p>
155    pub fn set_ingestion_status(mut self, input: ::std::option::Option<crate::types::IngestionStatus>) -> Self {
156        self.ingestion_status = input;
157        self
158    }
159    /// <p>A table showing information about the most recent successful and failed attempts to ingest events.</p>
160    pub fn get_ingestion_status(&self) -> &::std::option::Option<crate::types::IngestionStatus> {
161        &self.ingestion_status
162    }
163    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
164        self._request_id = Some(request_id.into());
165        self
166    }
167
168    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
169        self._request_id = request_id;
170        self
171    }
172    /// Consumes the builder and constructs a [`GetChannelOutput`](crate::operation::get_channel::GetChannelOutput).
173    pub fn build(self) -> crate::operation::get_channel::GetChannelOutput {
174        crate::operation::get_channel::GetChannelOutput {
175            channel_arn: self.channel_arn,
176            name: self.name,
177            source: self.source,
178            source_config: self.source_config,
179            destinations: self.destinations,
180            ingestion_status: self.ingestion_status,
181            _request_id: self._request_id,
182        }
183    }
184}