aws_sdk_securitylake/operation/update_subscriber/
_update_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 UpdateSubscriberInput {
6    /// <p>A value created by Security Lake that uniquely identifies your subscription.</p>
7    pub subscriber_id: ::std::option::Option<::std::string::String>,
8    /// <p>The Amazon Web Services identity used to access your data.</p>
9    pub subscriber_identity: ::std::option::Option<crate::types::AwsIdentity>,
10    /// <p>The name of the Security Lake account subscriber.</p>
11    pub subscriber_name: ::std::option::Option<::std::string::String>,
12    /// <p>The description of the Security Lake account subscriber.</p>
13    pub subscriber_description: ::std::option::Option<::std::string::String>,
14    /// <p>The supported Amazon Web Services services from which logs and events are collected. For the list of supported Amazon Web Services services, see the <a href="https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html">Amazon Security Lake User Guide</a>.</p>
15    pub sources: ::std::option::Option<::std::vec::Vec<crate::types::LogSourceResource>>,
16}
17impl UpdateSubscriberInput {
18    /// <p>A value created by Security Lake that uniquely identifies your subscription.</p>
19    pub fn subscriber_id(&self) -> ::std::option::Option<&str> {
20        self.subscriber_id.as_deref()
21    }
22    /// <p>The Amazon Web Services identity used to access your data.</p>
23    pub fn subscriber_identity(&self) -> ::std::option::Option<&crate::types::AwsIdentity> {
24        self.subscriber_identity.as_ref()
25    }
26    /// <p>The name of the Security Lake account subscriber.</p>
27    pub fn subscriber_name(&self) -> ::std::option::Option<&str> {
28        self.subscriber_name.as_deref()
29    }
30    /// <p>The description of the Security Lake account subscriber.</p>
31    pub fn subscriber_description(&self) -> ::std::option::Option<&str> {
32        self.subscriber_description.as_deref()
33    }
34    /// <p>The supported Amazon Web Services services from which logs and events are collected. For the list of supported Amazon Web Services services, see the <a href="https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html">Amazon Security Lake User Guide</a>.</p>
35    ///
36    /// 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()`.
37    pub fn sources(&self) -> &[crate::types::LogSourceResource] {
38        self.sources.as_deref().unwrap_or_default()
39    }
40}
41impl UpdateSubscriberInput {
42    /// Creates a new builder-style object to manufacture [`UpdateSubscriberInput`](crate::operation::update_subscriber::UpdateSubscriberInput).
43    pub fn builder() -> crate::operation::update_subscriber::builders::UpdateSubscriberInputBuilder {
44        crate::operation::update_subscriber::builders::UpdateSubscriberInputBuilder::default()
45    }
46}
47
48/// A builder for [`UpdateSubscriberInput`](crate::operation::update_subscriber::UpdateSubscriberInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct UpdateSubscriberInputBuilder {
52    pub(crate) subscriber_id: ::std::option::Option<::std::string::String>,
53    pub(crate) subscriber_identity: ::std::option::Option<crate::types::AwsIdentity>,
54    pub(crate) subscriber_name: ::std::option::Option<::std::string::String>,
55    pub(crate) subscriber_description: ::std::option::Option<::std::string::String>,
56    pub(crate) sources: ::std::option::Option<::std::vec::Vec<crate::types::LogSourceResource>>,
57}
58impl UpdateSubscriberInputBuilder {
59    /// <p>A value created by Security Lake that uniquely identifies your subscription.</p>
60    /// This field is required.
61    pub fn subscriber_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.subscriber_id = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>A value created by Security Lake that uniquely identifies your subscription.</p>
66    pub fn set_subscriber_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.subscriber_id = input;
68        self
69    }
70    /// <p>A value created by Security Lake that uniquely identifies your subscription.</p>
71    pub fn get_subscriber_id(&self) -> &::std::option::Option<::std::string::String> {
72        &self.subscriber_id
73    }
74    /// <p>The Amazon Web Services identity used to access your data.</p>
75    pub fn subscriber_identity(mut self, input: crate::types::AwsIdentity) -> Self {
76        self.subscriber_identity = ::std::option::Option::Some(input);
77        self
78    }
79    /// <p>The Amazon Web Services identity used to access your data.</p>
80    pub fn set_subscriber_identity(mut self, input: ::std::option::Option<crate::types::AwsIdentity>) -> Self {
81        self.subscriber_identity = input;
82        self
83    }
84    /// <p>The Amazon Web Services identity used to access your data.</p>
85    pub fn get_subscriber_identity(&self) -> &::std::option::Option<crate::types::AwsIdentity> {
86        &self.subscriber_identity
87    }
88    /// <p>The name of the Security Lake account subscriber.</p>
89    pub fn subscriber_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90        self.subscriber_name = ::std::option::Option::Some(input.into());
91        self
92    }
93    /// <p>The name of the Security Lake account subscriber.</p>
94    pub fn set_subscriber_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95        self.subscriber_name = input;
96        self
97    }
98    /// <p>The name of the Security Lake account subscriber.</p>
99    pub fn get_subscriber_name(&self) -> &::std::option::Option<::std::string::String> {
100        &self.subscriber_name
101    }
102    /// <p>The description of the Security Lake account subscriber.</p>
103    pub fn subscriber_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.subscriber_description = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// <p>The description of the Security Lake account subscriber.</p>
108    pub fn set_subscriber_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.subscriber_description = input;
110        self
111    }
112    /// <p>The description of the Security Lake account subscriber.</p>
113    pub fn get_subscriber_description(&self) -> &::std::option::Option<::std::string::String> {
114        &self.subscriber_description
115    }
116    /// Appends an item to `sources`.
117    ///
118    /// To override the contents of this collection use [`set_sources`](Self::set_sources).
119    ///
120    /// <p>The supported Amazon Web Services services from which logs and events are collected. For the list of supported Amazon Web Services services, see the <a href="https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html">Amazon Security Lake User Guide</a>.</p>
121    pub fn sources(mut self, input: crate::types::LogSourceResource) -> Self {
122        let mut v = self.sources.unwrap_or_default();
123        v.push(input);
124        self.sources = ::std::option::Option::Some(v);
125        self
126    }
127    /// <p>The supported Amazon Web Services services from which logs and events are collected. For the list of supported Amazon Web Services services, see the <a href="https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html">Amazon Security Lake User Guide</a>.</p>
128    pub fn set_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LogSourceResource>>) -> Self {
129        self.sources = input;
130        self
131    }
132    /// <p>The supported Amazon Web Services services from which logs and events are collected. For the list of supported Amazon Web Services services, see the <a href="https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html">Amazon Security Lake User Guide</a>.</p>
133    pub fn get_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LogSourceResource>> {
134        &self.sources
135    }
136    /// Consumes the builder and constructs a [`UpdateSubscriberInput`](crate::operation::update_subscriber::UpdateSubscriberInput).
137    pub fn build(
138        self,
139    ) -> ::std::result::Result<crate::operation::update_subscriber::UpdateSubscriberInput, ::aws_smithy_types::error::operation::BuildError> {
140        ::std::result::Result::Ok(crate::operation::update_subscriber::UpdateSubscriberInput {
141            subscriber_id: self.subscriber_id,
142            subscriber_identity: self.subscriber_identity,
143            subscriber_name: self.subscriber_name,
144            subscriber_description: self.subscriber_description,
145            sources: self.sources,
146        })
147    }
148}