aws_sdk_securitylake/operation/update_subscriber/
_update_subscriber_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateSubscriberInput {
6 pub subscriber_id: ::std::option::Option<::std::string::String>,
8 pub subscriber_identity: ::std::option::Option<crate::types::AwsIdentity>,
10 pub subscriber_name: ::std::option::Option<::std::string::String>,
12 pub subscriber_description: ::std::option::Option<::std::string::String>,
14 pub sources: ::std::option::Option<::std::vec::Vec<crate::types::LogSourceResource>>,
16}
17impl UpdateSubscriberInput {
18 pub fn subscriber_id(&self) -> ::std::option::Option<&str> {
20 self.subscriber_id.as_deref()
21 }
22 pub fn subscriber_identity(&self) -> ::std::option::Option<&crate::types::AwsIdentity> {
24 self.subscriber_identity.as_ref()
25 }
26 pub fn subscriber_name(&self) -> ::std::option::Option<&str> {
28 self.subscriber_name.as_deref()
29 }
30 pub fn subscriber_description(&self) -> ::std::option::Option<&str> {
32 self.subscriber_description.as_deref()
33 }
34 pub fn sources(&self) -> &[crate::types::LogSourceResource] {
38 self.sources.as_deref().unwrap_or_default()
39 }
40}
41impl UpdateSubscriberInput {
42 pub fn builder() -> crate::operation::update_subscriber::builders::UpdateSubscriberInputBuilder {
44 crate::operation::update_subscriber::builders::UpdateSubscriberInputBuilder::default()
45 }
46}
47
48#[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 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 pub fn set_subscriber_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67 self.subscriber_id = input;
68 self
69 }
70 pub fn get_subscriber_id(&self) -> &::std::option::Option<::std::string::String> {
72 &self.subscriber_id
73 }
74 pub fn subscriber_identity(mut self, input: crate::types::AwsIdentity) -> Self {
76 self.subscriber_identity = ::std::option::Option::Some(input);
77 self
78 }
79 pub fn set_subscriber_identity(mut self, input: ::std::option::Option<crate::types::AwsIdentity>) -> Self {
81 self.subscriber_identity = input;
82 self
83 }
84 pub fn get_subscriber_identity(&self) -> &::std::option::Option<crate::types::AwsIdentity> {
86 &self.subscriber_identity
87 }
88 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 pub fn set_subscriber_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95 self.subscriber_name = input;
96 self
97 }
98 pub fn get_subscriber_name(&self) -> &::std::option::Option<::std::string::String> {
100 &self.subscriber_name
101 }
102 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 pub fn set_subscriber_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.subscriber_description = input;
110 self
111 }
112 pub fn get_subscriber_description(&self) -> &::std::option::Option<::std::string::String> {
114 &self.subscriber_description
115 }
116 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 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 pub fn get_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LogSourceResource>> {
134 &self.sources
135 }
136 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}