aws_sdk_securityir/operation/create_membership/
_create_membership_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)]
5pub struct CreateMembershipInput {
6    /// <p>An optional element used in combination with CreateMembership.</p>
7    pub client_token: ::std::option::Option<::std::string::String>,
8    /// <p>Required element use in combination with CreateMembership to create a name for the membership.</p>
9    pub membership_name: ::std::option::Option<::std::string::String>,
10    /// <p>Required element use in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.</p>
11    pub incident_response_team: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>,
12    /// <p>Optional element to enable the monitoring and investigation opt-in features for the service.</p>
13    pub opt_in_features: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>,
14    /// <p>Optional element for customer configured tags.</p>
15    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16}
17impl CreateMembershipInput {
18    /// <p>An optional element used in combination with CreateMembership.</p>
19    pub fn client_token(&self) -> ::std::option::Option<&str> {
20        self.client_token.as_deref()
21    }
22    /// <p>Required element use in combination with CreateMembership to create a name for the membership.</p>
23    pub fn membership_name(&self) -> ::std::option::Option<&str> {
24        self.membership_name.as_deref()
25    }
26    /// <p>Required element use in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.</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 `.incident_response_team.is_none()`.
29    pub fn incident_response_team(&self) -> &[crate::types::IncidentResponder] {
30        self.incident_response_team.as_deref().unwrap_or_default()
31    }
32    /// <p>Optional element to enable the monitoring and investigation opt-in features for the service.</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 `.opt_in_features.is_none()`.
35    pub fn opt_in_features(&self) -> &[crate::types::OptInFeature] {
36        self.opt_in_features.as_deref().unwrap_or_default()
37    }
38    /// <p>Optional element for customer configured tags.</p>
39    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
40        self.tags.as_ref()
41    }
42}
43impl ::std::fmt::Debug for CreateMembershipInput {
44    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
45        let mut formatter = f.debug_struct("CreateMembershipInput");
46        formatter.field("client_token", &self.client_token);
47        formatter.field("membership_name", &"*** Sensitive Data Redacted ***");
48        formatter.field("incident_response_team", &self.incident_response_team);
49        formatter.field("opt_in_features", &self.opt_in_features);
50        formatter.field("tags", &self.tags);
51        formatter.finish()
52    }
53}
54impl CreateMembershipInput {
55    /// Creates a new builder-style object to manufacture [`CreateMembershipInput`](crate::operation::create_membership::CreateMembershipInput).
56    pub fn builder() -> crate::operation::create_membership::builders::CreateMembershipInputBuilder {
57        crate::operation::create_membership::builders::CreateMembershipInputBuilder::default()
58    }
59}
60
61/// A builder for [`CreateMembershipInput`](crate::operation::create_membership::CreateMembershipInput).
62#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
63#[non_exhaustive]
64pub struct CreateMembershipInputBuilder {
65    pub(crate) client_token: ::std::option::Option<::std::string::String>,
66    pub(crate) membership_name: ::std::option::Option<::std::string::String>,
67    pub(crate) incident_response_team: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>,
68    pub(crate) opt_in_features: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>,
69    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
70}
71impl CreateMembershipInputBuilder {
72    /// <p>An optional element used in combination with CreateMembership.</p>
73    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.client_token = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// <p>An optional element used in combination with CreateMembership.</p>
78    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.client_token = input;
80        self
81    }
82    /// <p>An optional element used in combination with CreateMembership.</p>
83    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
84        &self.client_token
85    }
86    /// <p>Required element use in combination with CreateMembership to create a name for the membership.</p>
87    /// This field is required.
88    pub fn membership_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.membership_name = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>Required element use in combination with CreateMembership to create a name for the membership.</p>
93    pub fn set_membership_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.membership_name = input;
95        self
96    }
97    /// <p>Required element use in combination with CreateMembership to create a name for the membership.</p>
98    pub fn get_membership_name(&self) -> &::std::option::Option<::std::string::String> {
99        &self.membership_name
100    }
101    /// Appends an item to `incident_response_team`.
102    ///
103    /// To override the contents of this collection use [`set_incident_response_team`](Self::set_incident_response_team).
104    ///
105    /// <p>Required element use in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.</p>
106    pub fn incident_response_team(mut self, input: crate::types::IncidentResponder) -> Self {
107        let mut v = self.incident_response_team.unwrap_or_default();
108        v.push(input);
109        self.incident_response_team = ::std::option::Option::Some(v);
110        self
111    }
112    /// <p>Required element use in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.</p>
113    pub fn set_incident_response_team(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>) -> Self {
114        self.incident_response_team = input;
115        self
116    }
117    /// <p>Required element use in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.</p>
118    pub fn get_incident_response_team(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>> {
119        &self.incident_response_team
120    }
121    /// Appends an item to `opt_in_features`.
122    ///
123    /// To override the contents of this collection use [`set_opt_in_features`](Self::set_opt_in_features).
124    ///
125    /// <p>Optional element to enable the monitoring and investigation opt-in features for the service.</p>
126    pub fn opt_in_features(mut self, input: crate::types::OptInFeature) -> Self {
127        let mut v = self.opt_in_features.unwrap_or_default();
128        v.push(input);
129        self.opt_in_features = ::std::option::Option::Some(v);
130        self
131    }
132    /// <p>Optional element to enable the monitoring and investigation opt-in features for the service.</p>
133    pub fn set_opt_in_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>) -> Self {
134        self.opt_in_features = input;
135        self
136    }
137    /// <p>Optional element to enable the monitoring and investigation opt-in features for the service.</p>
138    pub fn get_opt_in_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>> {
139        &self.opt_in_features
140    }
141    /// Adds a key-value pair to `tags`.
142    ///
143    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
144    ///
145    /// <p>Optional element for customer configured tags.</p>
146    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
147        let mut hash_map = self.tags.unwrap_or_default();
148        hash_map.insert(k.into(), v.into());
149        self.tags = ::std::option::Option::Some(hash_map);
150        self
151    }
152    /// <p>Optional element for customer configured tags.</p>
153    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
154        self.tags = input;
155        self
156    }
157    /// <p>Optional element for customer configured tags.</p>
158    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
159        &self.tags
160    }
161    /// Consumes the builder and constructs a [`CreateMembershipInput`](crate::operation::create_membership::CreateMembershipInput).
162    pub fn build(
163        self,
164    ) -> ::std::result::Result<crate::operation::create_membership::CreateMembershipInput, ::aws_smithy_types::error::operation::BuildError> {
165        ::std::result::Result::Ok(crate::operation::create_membership::CreateMembershipInput {
166            client_token: self.client_token,
167            membership_name: self.membership_name,
168            incident_response_team: self.incident_response_team,
169            opt_in_features: self.opt_in_features,
170            tags: self.tags,
171        })
172    }
173}
174impl ::std::fmt::Debug for CreateMembershipInputBuilder {
175    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
176        let mut formatter = f.debug_struct("CreateMembershipInputBuilder");
177        formatter.field("client_token", &self.client_token);
178        formatter.field("membership_name", &"*** Sensitive Data Redacted ***");
179        formatter.field("incident_response_team", &self.incident_response_team);
180        formatter.field("opt_in_features", &self.opt_in_features);
181        formatter.field("tags", &self.tags);
182        formatter.finish()
183    }
184}