aws_sdk_cloudtrail/operation/create_channel/
_create_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 CreateChannelInput {
6    /// <p>The name of the channel.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the partner or external event source. You cannot change this name after you create the channel. A maximum of one channel is allowed per source.</p>
9    /// <p>A source can be either <code>Custom</code> for all valid non-Amazon Web Services events, or the name of a partner event source. For information about the source names for available partners, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store-integration.html#cloudtrail-lake-partner-information">Additional information about integration partners</a> in the CloudTrail User Guide.</p>
10    pub source: ::std::option::Option<::std::string::String>,
11    /// <p>One or more event data stores to which events arriving through a channel will be logged.</p>
12    pub destinations: ::std::option::Option<::std::vec::Vec<crate::types::Destination>>,
13    /// <p>A list of tags.</p>
14    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
15}
16impl CreateChannelInput {
17    /// <p>The name of the channel.</p>
18    pub fn name(&self) -> ::std::option::Option<&str> {
19        self.name.as_deref()
20    }
21    /// <p>The name of the partner or external event source. You cannot change this name after you create the channel. A maximum of one channel is allowed per source.</p>
22    /// <p>A source can be either <code>Custom</code> for all valid non-Amazon Web Services events, or the name of a partner event source. For information about the source names for available partners, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store-integration.html#cloudtrail-lake-partner-information">Additional information about integration partners</a> in the CloudTrail User Guide.</p>
23    pub fn source(&self) -> ::std::option::Option<&str> {
24        self.source.as_deref()
25    }
26    /// <p>One or more event data stores to which events arriving through a channel will be logged.</p>
27    ///
28    /// 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()`.
29    pub fn destinations(&self) -> &[crate::types::Destination] {
30        self.destinations.as_deref().unwrap_or_default()
31    }
32    /// <p>A list of tags.</p>
33    ///
34    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
35    pub fn tags(&self) -> &[crate::types::Tag] {
36        self.tags.as_deref().unwrap_or_default()
37    }
38}
39impl CreateChannelInput {
40    /// Creates a new builder-style object to manufacture [`CreateChannelInput`](crate::operation::create_channel::CreateChannelInput).
41    pub fn builder() -> crate::operation::create_channel::builders::CreateChannelInputBuilder {
42        crate::operation::create_channel::builders::CreateChannelInputBuilder::default()
43    }
44}
45
46/// A builder for [`CreateChannelInput`](crate::operation::create_channel::CreateChannelInput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct CreateChannelInputBuilder {
50    pub(crate) name: ::std::option::Option<::std::string::String>,
51    pub(crate) source: ::std::option::Option<::std::string::String>,
52    pub(crate) destinations: ::std::option::Option<::std::vec::Vec<crate::types::Destination>>,
53    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
54}
55impl CreateChannelInputBuilder {
56    /// <p>The name of the channel.</p>
57    /// This field is required.
58    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        self.name = ::std::option::Option::Some(input.into());
60        self
61    }
62    /// <p>The name of the channel.</p>
63    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64        self.name = input;
65        self
66    }
67    /// <p>The name of the channel.</p>
68    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
69        &self.name
70    }
71    /// <p>The name of the partner or external event source. You cannot change this name after you create the channel. A maximum of one channel is allowed per source.</p>
72    /// <p>A source can be either <code>Custom</code> for all valid non-Amazon Web Services events, or the name of a partner event source. For information about the source names for available partners, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store-integration.html#cloudtrail-lake-partner-information">Additional information about integration partners</a> in the CloudTrail User Guide.</p>
73    /// This field is required.
74    pub fn source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.source = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>The name of the partner or external event source. You cannot change this name after you create the channel. A maximum of one channel is allowed per source.</p>
79    /// <p>A source can be either <code>Custom</code> for all valid non-Amazon Web Services events, or the name of a partner event source. For information about the source names for available partners, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store-integration.html#cloudtrail-lake-partner-information">Additional information about integration partners</a> in the CloudTrail User Guide.</p>
80    pub fn set_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.source = input;
82        self
83    }
84    /// <p>The name of the partner or external event source. You cannot change this name after you create the channel. A maximum of one channel is allowed per source.</p>
85    /// <p>A source can be either <code>Custom</code> for all valid non-Amazon Web Services events, or the name of a partner event source. For information about the source names for available partners, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store-integration.html#cloudtrail-lake-partner-information">Additional information about integration partners</a> in the CloudTrail User Guide.</p>
86    pub fn get_source(&self) -> &::std::option::Option<::std::string::String> {
87        &self.source
88    }
89    /// Appends an item to `destinations`.
90    ///
91    /// To override the contents of this collection use [`set_destinations`](Self::set_destinations).
92    ///
93    /// <p>One or more event data stores to which events arriving through a channel will be logged.</p>
94    pub fn destinations(mut self, input: crate::types::Destination) -> Self {
95        let mut v = self.destinations.unwrap_or_default();
96        v.push(input);
97        self.destinations = ::std::option::Option::Some(v);
98        self
99    }
100    /// <p>One or more event data stores to which events arriving through a channel will be logged.</p>
101    pub fn set_destinations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Destination>>) -> Self {
102        self.destinations = input;
103        self
104    }
105    /// <p>One or more event data stores to which events arriving through a channel will be logged.</p>
106    pub fn get_destinations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Destination>> {
107        &self.destinations
108    }
109    /// Appends an item to `tags`.
110    ///
111    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
112    ///
113    /// <p>A list of tags.</p>
114    pub fn tags(mut self, input: crate::types::Tag) -> Self {
115        let mut v = self.tags.unwrap_or_default();
116        v.push(input);
117        self.tags = ::std::option::Option::Some(v);
118        self
119    }
120    /// <p>A list of tags.</p>
121    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
122        self.tags = input;
123        self
124    }
125    /// <p>A list of tags.</p>
126    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
127        &self.tags
128    }
129    /// Consumes the builder and constructs a [`CreateChannelInput`](crate::operation::create_channel::CreateChannelInput).
130    pub fn build(
131        self,
132    ) -> ::std::result::Result<crate::operation::create_channel::CreateChannelInput, ::aws_smithy_types::error::operation::BuildError> {
133        ::std::result::Result::Ok(crate::operation::create_channel::CreateChannelInput {
134            name: self.name,
135            source: self.source,
136            destinations: self.destinations,
137            tags: self.tags,
138        })
139    }
140}