aws_sdk_securitylake/operation/create_subscriber/
_create_subscriber_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 CreateSubscriberInput {
6    /// <p>The Amazon Web Services identity used to access your data.</p>
7    pub subscriber_identity: ::std::option::Option<crate::types::AwsIdentity>,
8    /// <p>The name of your Security Lake subscriber account.</p>
9    pub subscriber_name: ::std::option::Option<::std::string::String>,
10    /// <p>The description for your subscriber account in Security Lake.</p>
11    pub subscriber_description: ::std::option::Option<::std::string::String>,
12    /// <p>The supported Amazon Web Services services from which logs and events are collected. Security Lake supports log and event collection for natively supported Amazon Web Services services.</p>
13    pub sources: ::std::option::Option<::std::vec::Vec<crate::types::LogSourceResource>>,
14    /// <p>The Amazon S3 or Lake Formation access type.</p>
15    pub access_types: ::std::option::Option<::std::vec::Vec<crate::types::AccessType>>,
16    /// <p>An array of objects, one for each tag to associate with the subscriber. For each tag, you must specify both a tag key and a tag value. A tag value cannot be null, but it can be an empty string.</p>
17    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
18}
19impl CreateSubscriberInput {
20    /// <p>The Amazon Web Services identity used to access your data.</p>
21    pub fn subscriber_identity(&self) -> ::std::option::Option<&crate::types::AwsIdentity> {
22        self.subscriber_identity.as_ref()
23    }
24    /// <p>The name of your Security Lake subscriber account.</p>
25    pub fn subscriber_name(&self) -> ::std::option::Option<&str> {
26        self.subscriber_name.as_deref()
27    }
28    /// <p>The description for your subscriber account in Security Lake.</p>
29    pub fn subscriber_description(&self) -> ::std::option::Option<&str> {
30        self.subscriber_description.as_deref()
31    }
32    /// <p>The supported Amazon Web Services services from which logs and events are collected. Security Lake supports log and event collection for natively supported Amazon Web Services services.</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 `.sources.is_none()`.
35    pub fn sources(&self) -> &[crate::types::LogSourceResource] {
36        self.sources.as_deref().unwrap_or_default()
37    }
38    /// <p>The Amazon S3 or Lake Formation access type.</p>
39    ///
40    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.access_types.is_none()`.
41    pub fn access_types(&self) -> &[crate::types::AccessType] {
42        self.access_types.as_deref().unwrap_or_default()
43    }
44    /// <p>An array of objects, one for each tag to associate with the subscriber. For each tag, you must specify both a tag key and a tag value. A tag value cannot be null, but it can be an empty string.</p>
45    ///
46    /// 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()`.
47    pub fn tags(&self) -> &[crate::types::Tag] {
48        self.tags.as_deref().unwrap_or_default()
49    }
50}
51impl CreateSubscriberInput {
52    /// Creates a new builder-style object to manufacture [`CreateSubscriberInput`](crate::operation::create_subscriber::CreateSubscriberInput).
53    pub fn builder() -> crate::operation::create_subscriber::builders::CreateSubscriberInputBuilder {
54        crate::operation::create_subscriber::builders::CreateSubscriberInputBuilder::default()
55    }
56}
57
58/// A builder for [`CreateSubscriberInput`](crate::operation::create_subscriber::CreateSubscriberInput).
59#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
60#[non_exhaustive]
61pub struct CreateSubscriberInputBuilder {
62    pub(crate) subscriber_identity: ::std::option::Option<crate::types::AwsIdentity>,
63    pub(crate) subscriber_name: ::std::option::Option<::std::string::String>,
64    pub(crate) subscriber_description: ::std::option::Option<::std::string::String>,
65    pub(crate) sources: ::std::option::Option<::std::vec::Vec<crate::types::LogSourceResource>>,
66    pub(crate) access_types: ::std::option::Option<::std::vec::Vec<crate::types::AccessType>>,
67    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
68}
69impl CreateSubscriberInputBuilder {
70    /// <p>The Amazon Web Services identity used to access your data.</p>
71    /// This field is required.
72    pub fn subscriber_identity(mut self, input: crate::types::AwsIdentity) -> Self {
73        self.subscriber_identity = ::std::option::Option::Some(input);
74        self
75    }
76    /// <p>The Amazon Web Services identity used to access your data.</p>
77    pub fn set_subscriber_identity(mut self, input: ::std::option::Option<crate::types::AwsIdentity>) -> Self {
78        self.subscriber_identity = input;
79        self
80    }
81    /// <p>The Amazon Web Services identity used to access your data.</p>
82    pub fn get_subscriber_identity(&self) -> &::std::option::Option<crate::types::AwsIdentity> {
83        &self.subscriber_identity
84    }
85    /// <p>The name of your Security Lake subscriber account.</p>
86    /// This field is required.
87    pub fn subscriber_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88        self.subscriber_name = ::std::option::Option::Some(input.into());
89        self
90    }
91    /// <p>The name of your Security Lake subscriber account.</p>
92    pub fn set_subscriber_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93        self.subscriber_name = input;
94        self
95    }
96    /// <p>The name of your Security Lake subscriber account.</p>
97    pub fn get_subscriber_name(&self) -> &::std::option::Option<::std::string::String> {
98        &self.subscriber_name
99    }
100    /// <p>The description for your subscriber account in Security Lake.</p>
101    pub fn subscriber_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        self.subscriber_description = ::std::option::Option::Some(input.into());
103        self
104    }
105    /// <p>The description for your subscriber account in Security Lake.</p>
106    pub fn set_subscriber_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107        self.subscriber_description = input;
108        self
109    }
110    /// <p>The description for your subscriber account in Security Lake.</p>
111    pub fn get_subscriber_description(&self) -> &::std::option::Option<::std::string::String> {
112        &self.subscriber_description
113    }
114    /// Appends an item to `sources`.
115    ///
116    /// To override the contents of this collection use [`set_sources`](Self::set_sources).
117    ///
118    /// <p>The supported Amazon Web Services services from which logs and events are collected. Security Lake supports log and event collection for natively supported Amazon Web Services services.</p>
119    pub fn sources(mut self, input: crate::types::LogSourceResource) -> Self {
120        let mut v = self.sources.unwrap_or_default();
121        v.push(input);
122        self.sources = ::std::option::Option::Some(v);
123        self
124    }
125    /// <p>The supported Amazon Web Services services from which logs and events are collected. Security Lake supports log and event collection for natively supported Amazon Web Services services.</p>
126    pub fn set_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LogSourceResource>>) -> Self {
127        self.sources = input;
128        self
129    }
130    /// <p>The supported Amazon Web Services services from which logs and events are collected. Security Lake supports log and event collection for natively supported Amazon Web Services services.</p>
131    pub fn get_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LogSourceResource>> {
132        &self.sources
133    }
134    /// Appends an item to `access_types`.
135    ///
136    /// To override the contents of this collection use [`set_access_types`](Self::set_access_types).
137    ///
138    /// <p>The Amazon S3 or Lake Formation access type.</p>
139    pub fn access_types(mut self, input: crate::types::AccessType) -> Self {
140        let mut v = self.access_types.unwrap_or_default();
141        v.push(input);
142        self.access_types = ::std::option::Option::Some(v);
143        self
144    }
145    /// <p>The Amazon S3 or Lake Formation access type.</p>
146    pub fn set_access_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AccessType>>) -> Self {
147        self.access_types = input;
148        self
149    }
150    /// <p>The Amazon S3 or Lake Formation access type.</p>
151    pub fn get_access_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AccessType>> {
152        &self.access_types
153    }
154    /// Appends an item to `tags`.
155    ///
156    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
157    ///
158    /// <p>An array of objects, one for each tag to associate with the subscriber. For each tag, you must specify both a tag key and a tag value. A tag value cannot be null, but it can be an empty string.</p>
159    pub fn tags(mut self, input: crate::types::Tag) -> Self {
160        let mut v = self.tags.unwrap_or_default();
161        v.push(input);
162        self.tags = ::std::option::Option::Some(v);
163        self
164    }
165    /// <p>An array of objects, one for each tag to associate with the subscriber. For each tag, you must specify both a tag key and a tag value. A tag value cannot be null, but it can be an empty string.</p>
166    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
167        self.tags = input;
168        self
169    }
170    /// <p>An array of objects, one for each tag to associate with the subscriber. For each tag, you must specify both a tag key and a tag value. A tag value cannot be null, but it can be an empty string.</p>
171    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
172        &self.tags
173    }
174    /// Consumes the builder and constructs a [`CreateSubscriberInput`](crate::operation::create_subscriber::CreateSubscriberInput).
175    pub fn build(
176        self,
177    ) -> ::std::result::Result<crate::operation::create_subscriber::CreateSubscriberInput, ::aws_smithy_types::error::operation::BuildError> {
178        ::std::result::Result::Ok(crate::operation::create_subscriber::CreateSubscriberInput {
179            subscriber_identity: self.subscriber_identity,
180            subscriber_name: self.subscriber_name,
181            subscriber_description: self.subscriber_description,
182            sources: self.sources,
183            access_types: self.access_types,
184            tags: self.tags,
185        })
186    }
187}