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    /// <note>
7    /// <p>The <code>clientToken</code> field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided.</p>
8    /// </note>
9    pub client_token: ::std::option::Option<::std::string::String>,
10    /// <p>Required element used in combination with CreateMembership to create a name for the membership.</p>
11    pub membership_name: ::std::option::Option<::std::string::String>,
12    /// <p>Required element used in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.</p>
13    pub incident_response_team: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>,
14    /// <p>Optional element to enable the monitoring and investigation opt-in features for the service.</p>
15    pub opt_in_features: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>,
16    /// <p>Optional element for customer configured tags.</p>
17    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
18    /// <p>The <code>coverEntireOrganization</code> parameter is a boolean flag that determines whether the membership should be applied to the entire Amazon Web Services Organization. When set to true, the membership will be created for all accounts within the organization. When set to false, the membership will only be created for specified accounts.</p>
19    /// <p>This parameter is optional. If not specified, the default value is false.</p>
20    /// <ul>
21    /// <li>
22    /// <p>If set to <i>true</i>: The membership will automatically include all existing and future accounts in the Amazon Web Services Organization.</p></li>
23    /// <li>
24    /// <p>If set to <i>false</i>: The membership will only apply to explicitly specified accounts.</p></li>
25    /// </ul>
26    pub cover_entire_organization: ::std::option::Option<bool>,
27}
28impl CreateMembershipInput {
29    /// <note>
30    /// <p>The <code>clientToken</code> field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided.</p>
31    /// </note>
32    pub fn client_token(&self) -> ::std::option::Option<&str> {
33        self.client_token.as_deref()
34    }
35    /// <p>Required element used in combination with CreateMembership to create a name for the membership.</p>
36    pub fn membership_name(&self) -> ::std::option::Option<&str> {
37        self.membership_name.as_deref()
38    }
39    /// <p>Required element used in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.</p>
40    ///
41    /// 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()`.
42    pub fn incident_response_team(&self) -> &[crate::types::IncidentResponder] {
43        self.incident_response_team.as_deref().unwrap_or_default()
44    }
45    /// <p>Optional element to enable the monitoring and investigation opt-in features for the service.</p>
46    ///
47    /// 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()`.
48    pub fn opt_in_features(&self) -> &[crate::types::OptInFeature] {
49        self.opt_in_features.as_deref().unwrap_or_default()
50    }
51    /// <p>Optional element for customer configured tags.</p>
52    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
53        self.tags.as_ref()
54    }
55    /// <p>The <code>coverEntireOrganization</code> parameter is a boolean flag that determines whether the membership should be applied to the entire Amazon Web Services Organization. When set to true, the membership will be created for all accounts within the organization. When set to false, the membership will only be created for specified accounts.</p>
56    /// <p>This parameter is optional. If not specified, the default value is false.</p>
57    /// <ul>
58    /// <li>
59    /// <p>If set to <i>true</i>: The membership will automatically include all existing and future accounts in the Amazon Web Services Organization.</p></li>
60    /// <li>
61    /// <p>If set to <i>false</i>: The membership will only apply to explicitly specified accounts.</p></li>
62    /// </ul>
63    pub fn cover_entire_organization(&self) -> ::std::option::Option<bool> {
64        self.cover_entire_organization
65    }
66}
67impl ::std::fmt::Debug for CreateMembershipInput {
68    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
69        let mut formatter = f.debug_struct("CreateMembershipInput");
70        formatter.field("client_token", &self.client_token);
71        formatter.field("membership_name", &"*** Sensitive Data Redacted ***");
72        formatter.field("incident_response_team", &self.incident_response_team);
73        formatter.field("opt_in_features", &self.opt_in_features);
74        formatter.field("tags", &self.tags);
75        formatter.field("cover_entire_organization", &self.cover_entire_organization);
76        formatter.finish()
77    }
78}
79impl CreateMembershipInput {
80    /// Creates a new builder-style object to manufacture [`CreateMembershipInput`](crate::operation::create_membership::CreateMembershipInput).
81    pub fn builder() -> crate::operation::create_membership::builders::CreateMembershipInputBuilder {
82        crate::operation::create_membership::builders::CreateMembershipInputBuilder::default()
83    }
84}
85
86/// A builder for [`CreateMembershipInput`](crate::operation::create_membership::CreateMembershipInput).
87#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
88#[non_exhaustive]
89pub struct CreateMembershipInputBuilder {
90    pub(crate) client_token: ::std::option::Option<::std::string::String>,
91    pub(crate) membership_name: ::std::option::Option<::std::string::String>,
92    pub(crate) incident_response_team: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>,
93    pub(crate) opt_in_features: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>,
94    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
95    pub(crate) cover_entire_organization: ::std::option::Option<bool>,
96}
97impl CreateMembershipInputBuilder {
98    /// <note>
99    /// <p>The <code>clientToken</code> field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided.</p>
100    /// </note>
101    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        self.client_token = ::std::option::Option::Some(input.into());
103        self
104    }
105    /// <note>
106    /// <p>The <code>clientToken</code> field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided.</p>
107    /// </note>
108    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.client_token = input;
110        self
111    }
112    /// <note>
113    /// <p>The <code>clientToken</code> field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided.</p>
114    /// </note>
115    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
116        &self.client_token
117    }
118    /// <p>Required element used in combination with CreateMembership to create a name for the membership.</p>
119    /// This field is required.
120    pub fn membership_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.membership_name = ::std::option::Option::Some(input.into());
122        self
123    }
124    /// <p>Required element used in combination with CreateMembership to create a name for the membership.</p>
125    pub fn set_membership_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.membership_name = input;
127        self
128    }
129    /// <p>Required element used in combination with CreateMembership to create a name for the membership.</p>
130    pub fn get_membership_name(&self) -> &::std::option::Option<::std::string::String> {
131        &self.membership_name
132    }
133    /// Appends an item to `incident_response_team`.
134    ///
135    /// To override the contents of this collection use [`set_incident_response_team`](Self::set_incident_response_team).
136    ///
137    /// <p>Required element used in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.</p>
138    pub fn incident_response_team(mut self, input: crate::types::IncidentResponder) -> Self {
139        let mut v = self.incident_response_team.unwrap_or_default();
140        v.push(input);
141        self.incident_response_team = ::std::option::Option::Some(v);
142        self
143    }
144    /// <p>Required element used in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.</p>
145    pub fn set_incident_response_team(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>) -> Self {
146        self.incident_response_team = input;
147        self
148    }
149    /// <p>Required element used in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.</p>
150    pub fn get_incident_response_team(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>> {
151        &self.incident_response_team
152    }
153    /// Appends an item to `opt_in_features`.
154    ///
155    /// To override the contents of this collection use [`set_opt_in_features`](Self::set_opt_in_features).
156    ///
157    /// <p>Optional element to enable the monitoring and investigation opt-in features for the service.</p>
158    pub fn opt_in_features(mut self, input: crate::types::OptInFeature) -> Self {
159        let mut v = self.opt_in_features.unwrap_or_default();
160        v.push(input);
161        self.opt_in_features = ::std::option::Option::Some(v);
162        self
163    }
164    /// <p>Optional element to enable the monitoring and investigation opt-in features for the service.</p>
165    pub fn set_opt_in_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>) -> Self {
166        self.opt_in_features = input;
167        self
168    }
169    /// <p>Optional element to enable the monitoring and investigation opt-in features for the service.</p>
170    pub fn get_opt_in_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>> {
171        &self.opt_in_features
172    }
173    /// Adds a key-value pair to `tags`.
174    ///
175    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
176    ///
177    /// <p>Optional element for customer configured tags.</p>
178    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
179        let mut hash_map = self.tags.unwrap_or_default();
180        hash_map.insert(k.into(), v.into());
181        self.tags = ::std::option::Option::Some(hash_map);
182        self
183    }
184    /// <p>Optional element for customer configured tags.</p>
185    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
186        self.tags = input;
187        self
188    }
189    /// <p>Optional element for customer configured tags.</p>
190    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
191        &self.tags
192    }
193    /// <p>The <code>coverEntireOrganization</code> parameter is a boolean flag that determines whether the membership should be applied to the entire Amazon Web Services Organization. When set to true, the membership will be created for all accounts within the organization. When set to false, the membership will only be created for specified accounts.</p>
194    /// <p>This parameter is optional. If not specified, the default value is false.</p>
195    /// <ul>
196    /// <li>
197    /// <p>If set to <i>true</i>: The membership will automatically include all existing and future accounts in the Amazon Web Services Organization.</p></li>
198    /// <li>
199    /// <p>If set to <i>false</i>: The membership will only apply to explicitly specified accounts.</p></li>
200    /// </ul>
201    pub fn cover_entire_organization(mut self, input: bool) -> Self {
202        self.cover_entire_organization = ::std::option::Option::Some(input);
203        self
204    }
205    /// <p>The <code>coverEntireOrganization</code> parameter is a boolean flag that determines whether the membership should be applied to the entire Amazon Web Services Organization. When set to true, the membership will be created for all accounts within the organization. When set to false, the membership will only be created for specified accounts.</p>
206    /// <p>This parameter is optional. If not specified, the default value is false.</p>
207    /// <ul>
208    /// <li>
209    /// <p>If set to <i>true</i>: The membership will automatically include all existing and future accounts in the Amazon Web Services Organization.</p></li>
210    /// <li>
211    /// <p>If set to <i>false</i>: The membership will only apply to explicitly specified accounts.</p></li>
212    /// </ul>
213    pub fn set_cover_entire_organization(mut self, input: ::std::option::Option<bool>) -> Self {
214        self.cover_entire_organization = input;
215        self
216    }
217    /// <p>The <code>coverEntireOrganization</code> parameter is a boolean flag that determines whether the membership should be applied to the entire Amazon Web Services Organization. When set to true, the membership will be created for all accounts within the organization. When set to false, the membership will only be created for specified accounts.</p>
218    /// <p>This parameter is optional. If not specified, the default value is false.</p>
219    /// <ul>
220    /// <li>
221    /// <p>If set to <i>true</i>: The membership will automatically include all existing and future accounts in the Amazon Web Services Organization.</p></li>
222    /// <li>
223    /// <p>If set to <i>false</i>: The membership will only apply to explicitly specified accounts.</p></li>
224    /// </ul>
225    pub fn get_cover_entire_organization(&self) -> &::std::option::Option<bool> {
226        &self.cover_entire_organization
227    }
228    /// Consumes the builder and constructs a [`CreateMembershipInput`](crate::operation::create_membership::CreateMembershipInput).
229    pub fn build(
230        self,
231    ) -> ::std::result::Result<crate::operation::create_membership::CreateMembershipInput, ::aws_smithy_types::error::operation::BuildError> {
232        ::std::result::Result::Ok(crate::operation::create_membership::CreateMembershipInput {
233            client_token: self.client_token,
234            membership_name: self.membership_name,
235            incident_response_team: self.incident_response_team,
236            opt_in_features: self.opt_in_features,
237            tags: self.tags,
238            cover_entire_organization: self.cover_entire_organization,
239        })
240    }
241}
242impl ::std::fmt::Debug for CreateMembershipInputBuilder {
243    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
244        let mut formatter = f.debug_struct("CreateMembershipInputBuilder");
245        formatter.field("client_token", &self.client_token);
246        formatter.field("membership_name", &"*** Sensitive Data Redacted ***");
247        formatter.field("incident_response_team", &self.incident_response_team);
248        formatter.field("opt_in_features", &self.opt_in_features);
249        formatter.field("tags", &self.tags);
250        formatter.field("cover_entire_organization", &self.cover_entire_organization);
251        formatter.finish()
252    }
253}