aws_sdk_securityir/operation/create_membership/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_membership::_create_membership_output::CreateMembershipOutputBuilder;
3
4pub use crate::operation::create_membership::_create_membership_input::CreateMembershipInputBuilder;
5
6impl crate::operation::create_membership::builders::CreateMembershipInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::create_membership::CreateMembershipOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_membership::CreateMembershipError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_membership();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateMembership`.
24///
25/// <p>Creates a new membership.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateMembershipFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::create_membership::builders::CreateMembershipInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::create_membership::CreateMembershipOutput,
35 crate::operation::create_membership::CreateMembershipError,
36 > for CreateMembershipFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::create_membership::CreateMembershipOutput,
44 crate::operation::create_membership::CreateMembershipError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl CreateMembershipFluentBuilder {
51 /// Creates a new `CreateMembershipFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the CreateMembership as a reference.
60 pub fn as_input(&self) -> &crate::operation::create_membership::builders::CreateMembershipInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::create_membership::CreateMembershipOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::create_membership::CreateMembershipError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::create_membership::CreateMembership::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::create_membership::CreateMembership::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::create_membership::CreateMembershipOutput,
97 crate::operation::create_membership::CreateMembershipError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// <note>
112 /// <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>
113 /// </note>
114 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.inner = self.inner.client_token(input.into());
116 self
117 }
118 /// <note>
119 /// <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>
120 /// </note>
121 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.inner = self.inner.set_client_token(input);
123 self
124 }
125 /// <note>
126 /// <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>
127 /// </note>
128 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
129 self.inner.get_client_token()
130 }
131 /// <p>Required element used in combination with CreateMembership to create a name for the membership.</p>
132 pub fn membership_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133 self.inner = self.inner.membership_name(input.into());
134 self
135 }
136 /// <p>Required element used in combination with CreateMembership to create a name for the membership.</p>
137 pub fn set_membership_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138 self.inner = self.inner.set_membership_name(input);
139 self
140 }
141 /// <p>Required element used in combination with CreateMembership to create a name for the membership.</p>
142 pub fn get_membership_name(&self) -> &::std::option::Option<::std::string::String> {
143 self.inner.get_membership_name()
144 }
145 ///
146 /// Appends an item to `incidentResponseTeam`.
147 ///
148 /// To override the contents of this collection use [`set_incident_response_team`](Self::set_incident_response_team).
149 ///
150 /// <p>Required element used in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.</p>
151 pub fn incident_response_team(mut self, input: crate::types::IncidentResponder) -> Self {
152 self.inner = self.inner.incident_response_team(input);
153 self
154 }
155 /// <p>Required element used in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.</p>
156 pub fn set_incident_response_team(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>) -> Self {
157 self.inner = self.inner.set_incident_response_team(input);
158 self
159 }
160 /// <p>Required element used in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.</p>
161 pub fn get_incident_response_team(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>> {
162 self.inner.get_incident_response_team()
163 }
164 ///
165 /// Appends an item to `optInFeatures`.
166 ///
167 /// To override the contents of this collection use [`set_opt_in_features`](Self::set_opt_in_features).
168 ///
169 /// <p>Optional element to enable the monitoring and investigation opt-in features for the service.</p>
170 pub fn opt_in_features(mut self, input: crate::types::OptInFeature) -> Self {
171 self.inner = self.inner.opt_in_features(input);
172 self
173 }
174 /// <p>Optional element to enable the monitoring and investigation opt-in features for the service.</p>
175 pub fn set_opt_in_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>) -> Self {
176 self.inner = self.inner.set_opt_in_features(input);
177 self
178 }
179 /// <p>Optional element to enable the monitoring and investigation opt-in features for the service.</p>
180 pub fn get_opt_in_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>> {
181 self.inner.get_opt_in_features()
182 }
183 ///
184 /// Adds a key-value pair to `tags`.
185 ///
186 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
187 ///
188 /// <p>Optional element for customer configured tags.</p>
189 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
190 self.inner = self.inner.tags(k.into(), v.into());
191 self
192 }
193 /// <p>Optional element for customer configured tags.</p>
194 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
195 self.inner = self.inner.set_tags(input);
196 self
197 }
198 /// <p>Optional element for customer configured tags.</p>
199 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
200 self.inner.get_tags()
201 }
202 /// <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>
203 /// <p>This parameter is optional. If not specified, the default value is false.</p>
204 /// <ul>
205 /// <li>
206 /// <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>
207 /// <li>
208 /// <p>If set to <i>false</i>: The membership will only apply to explicitly specified accounts.</p></li>
209 /// </ul>
210 pub fn cover_entire_organization(mut self, input: bool) -> Self {
211 self.inner = self.inner.cover_entire_organization(input);
212 self
213 }
214 /// <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>
215 /// <p>This parameter is optional. If not specified, the default value is false.</p>
216 /// <ul>
217 /// <li>
218 /// <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>
219 /// <li>
220 /// <p>If set to <i>false</i>: The membership will only apply to explicitly specified accounts.</p></li>
221 /// </ul>
222 pub fn set_cover_entire_organization(mut self, input: ::std::option::Option<bool>) -> Self {
223 self.inner = self.inner.set_cover_entire_organization(input);
224 self
225 }
226 /// <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>
227 /// <p>This parameter is optional. If not specified, the default value is false.</p>
228 /// <ul>
229 /// <li>
230 /// <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>
231 /// <li>
232 /// <p>If set to <i>false</i>: The membership will only apply to explicitly specified accounts.</p></li>
233 /// </ul>
234 pub fn get_cover_entire_organization(&self) -> &::std::option::Option<bool> {
235 self.inner.get_cover_entire_organization()
236 }
237}