aws_sdk_appstream/operation/update_app_block_builder/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_app_block_builder::_update_app_block_builder_output::UpdateAppBlockBuilderOutputBuilder;
3
4pub use crate::operation::update_app_block_builder::_update_app_block_builder_input::UpdateAppBlockBuilderInputBuilder;
5
6impl crate::operation::update_app_block_builder::builders::UpdateAppBlockBuilderInputBuilder {
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::update_app_block_builder::UpdateAppBlockBuilderOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_app_block_builder::UpdateAppBlockBuilderError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_app_block_builder();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateAppBlockBuilder`.
24///
25/// <p>Updates an app block builder.</p>
26/// <p>If the app block builder is in the <code>STARTING</code> or <code>STOPPING</code> state, you can't update it. If the app block builder is in the <code>RUNNING</code> state, you can only update the DisplayName and Description. If the app block builder is in the <code>STOPPED</code> state, you can update any attribute except the Name.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct UpdateAppBlockBuilderFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::update_app_block_builder::builders::UpdateAppBlockBuilderInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34 crate::client::customize::internal::CustomizableSend<
35 crate::operation::update_app_block_builder::UpdateAppBlockBuilderOutput,
36 crate::operation::update_app_block_builder::UpdateAppBlockBuilderError,
37 > for UpdateAppBlockBuilderFluentBuilder
38{
39 fn send(
40 self,
41 config_override: crate::config::Builder,
42 ) -> crate::client::customize::internal::BoxFuture<
43 crate::client::customize::internal::SendResult<
44 crate::operation::update_app_block_builder::UpdateAppBlockBuilderOutput,
45 crate::operation::update_app_block_builder::UpdateAppBlockBuilderError,
46 >,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl UpdateAppBlockBuilderFluentBuilder {
52 /// Creates a new `UpdateAppBlockBuilderFluentBuilder`.
53 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54 Self {
55 handle,
56 inner: ::std::default::Default::default(),
57 config_override: ::std::option::Option::None,
58 }
59 }
60 /// Access the UpdateAppBlockBuilder as a reference.
61 pub fn as_input(&self) -> &crate::operation::update_app_block_builder::builders::UpdateAppBlockBuilderInputBuilder {
62 &self.inner
63 }
64 /// Sends the request and returns the response.
65 ///
66 /// If an error occurs, an `SdkError` will be returned with additional details that
67 /// can be matched against.
68 ///
69 /// By default, any retryable failures will be retried twice. Retry behavior
70 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71 /// set when configuring the client.
72 pub async fn send(
73 self,
74 ) -> ::std::result::Result<
75 crate::operation::update_app_block_builder::UpdateAppBlockBuilderOutput,
76 ::aws_smithy_runtime_api::client::result::SdkError<
77 crate::operation::update_app_block_builder::UpdateAppBlockBuilderError,
78 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79 >,
80 > {
81 let input = self
82 .inner
83 .build()
84 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85 let runtime_plugins = crate::operation::update_app_block_builder::UpdateAppBlockBuilder::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::update_app_block_builder::UpdateAppBlockBuilder::orchestrate(&runtime_plugins, input).await
91 }
92
93 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94 pub fn customize(
95 self,
96 ) -> crate::client::customize::CustomizableOperation<
97 crate::operation::update_app_block_builder::UpdateAppBlockBuilderOutput,
98 crate::operation::update_app_block_builder::UpdateAppBlockBuilderError,
99 Self,
100 > {
101 crate::client::customize::CustomizableOperation::new(self)
102 }
103 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104 self.set_config_override(::std::option::Option::Some(config_override.into()));
105 self
106 }
107
108 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109 self.config_override = config_override;
110 self
111 }
112 /// <p>The unique name for the app block builder.</p>
113 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.inner = self.inner.name(input.into());
115 self
116 }
117 /// <p>The unique name for the app block builder.</p>
118 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119 self.inner = self.inner.set_name(input);
120 self
121 }
122 /// <p>The unique name for the app block builder.</p>
123 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
124 self.inner.get_name()
125 }
126 /// <p>The description of the app block builder.</p>
127 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128 self.inner = self.inner.description(input.into());
129 self
130 }
131 /// <p>The description of the app block builder.</p>
132 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133 self.inner = self.inner.set_description(input);
134 self
135 }
136 /// <p>The description of the app block builder.</p>
137 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
138 self.inner.get_description()
139 }
140 /// <p>The display name of the app block builder.</p>
141 pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142 self.inner = self.inner.display_name(input.into());
143 self
144 }
145 /// <p>The display name of the app block builder.</p>
146 pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147 self.inner = self.inner.set_display_name(input);
148 self
149 }
150 /// <p>The display name of the app block builder.</p>
151 pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
152 self.inner.get_display_name()
153 }
154 /// <p>The platform of the app block builder.</p>
155 /// <p><code>WINDOWS_SERVER_2019</code> is the only valid value.</p>
156 pub fn platform(mut self, input: crate::types::PlatformType) -> Self {
157 self.inner = self.inner.platform(input);
158 self
159 }
160 /// <p>The platform of the app block builder.</p>
161 /// <p><code>WINDOWS_SERVER_2019</code> is the only valid value.</p>
162 pub fn set_platform(mut self, input: ::std::option::Option<crate::types::PlatformType>) -> Self {
163 self.inner = self.inner.set_platform(input);
164 self
165 }
166 /// <p>The platform of the app block builder.</p>
167 /// <p><code>WINDOWS_SERVER_2019</code> is the only valid value.</p>
168 pub fn get_platform(&self) -> &::std::option::Option<crate::types::PlatformType> {
169 self.inner.get_platform()
170 }
171 /// <p>The instance type to use when launching the app block builder. The following instance types are available:</p>
172 /// <ul>
173 /// <li>
174 /// <p>stream.standard.small</p></li>
175 /// <li>
176 /// <p>stream.standard.medium</p></li>
177 /// <li>
178 /// <p>stream.standard.large</p></li>
179 /// <li>
180 /// <p>stream.standard.xlarge</p></li>
181 /// <li>
182 /// <p>stream.standard.2xlarge</p></li>
183 /// </ul>
184 pub fn instance_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185 self.inner = self.inner.instance_type(input.into());
186 self
187 }
188 /// <p>The instance type to use when launching the app block builder. The following instance types are available:</p>
189 /// <ul>
190 /// <li>
191 /// <p>stream.standard.small</p></li>
192 /// <li>
193 /// <p>stream.standard.medium</p></li>
194 /// <li>
195 /// <p>stream.standard.large</p></li>
196 /// <li>
197 /// <p>stream.standard.xlarge</p></li>
198 /// <li>
199 /// <p>stream.standard.2xlarge</p></li>
200 /// </ul>
201 pub fn set_instance_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202 self.inner = self.inner.set_instance_type(input);
203 self
204 }
205 /// <p>The instance type to use when launching the app block builder. The following instance types are available:</p>
206 /// <ul>
207 /// <li>
208 /// <p>stream.standard.small</p></li>
209 /// <li>
210 /// <p>stream.standard.medium</p></li>
211 /// <li>
212 /// <p>stream.standard.large</p></li>
213 /// <li>
214 /// <p>stream.standard.xlarge</p></li>
215 /// <li>
216 /// <p>stream.standard.2xlarge</p></li>
217 /// </ul>
218 pub fn get_instance_type(&self) -> &::std::option::Option<::std::string::String> {
219 self.inner.get_instance_type()
220 }
221 /// <p>The VPC configuration for the app block builder.</p>
222 /// <p>App block builders require that you specify at least two subnets in different availability zones.</p>
223 pub fn vpc_config(mut self, input: crate::types::VpcConfig) -> Self {
224 self.inner = self.inner.vpc_config(input);
225 self
226 }
227 /// <p>The VPC configuration for the app block builder.</p>
228 /// <p>App block builders require that you specify at least two subnets in different availability zones.</p>
229 pub fn set_vpc_config(mut self, input: ::std::option::Option<crate::types::VpcConfig>) -> Self {
230 self.inner = self.inner.set_vpc_config(input);
231 self
232 }
233 /// <p>The VPC configuration for the app block builder.</p>
234 /// <p>App block builders require that you specify at least two subnets in different availability zones.</p>
235 pub fn get_vpc_config(&self) -> &::std::option::Option<crate::types::VpcConfig> {
236 self.inner.get_vpc_config()
237 }
238 /// <p>Enables or disables default internet access for the app block builder.</p>
239 pub fn enable_default_internet_access(mut self, input: bool) -> Self {
240 self.inner = self.inner.enable_default_internet_access(input);
241 self
242 }
243 /// <p>Enables or disables default internet access for the app block builder.</p>
244 pub fn set_enable_default_internet_access(mut self, input: ::std::option::Option<bool>) -> Self {
245 self.inner = self.inner.set_enable_default_internet_access(input);
246 self
247 }
248 /// <p>Enables or disables default internet access for the app block builder.</p>
249 pub fn get_enable_default_internet_access(&self) -> &::std::option::Option<bool> {
250 self.inner.get_enable_default_internet_access()
251 }
252 /// <p>The Amazon Resource Name (ARN) of the IAM role to apply to the app block builder. To assume a role, the app block builder calls the AWS Security Token Service (STS) <code>AssumeRole</code> API operation and passes the ARN of the role to use. The operation creates a new session with temporary credentials. AppStream 2.0 retrieves the temporary credentials and creates the <b>appstream_machine_role</b> credential profile on the instance.</p>
253 /// <p>For more information, see <a href="https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html">Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>
254 pub fn iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
255 self.inner = self.inner.iam_role_arn(input.into());
256 self
257 }
258 /// <p>The Amazon Resource Name (ARN) of the IAM role to apply to the app block builder. To assume a role, the app block builder calls the AWS Security Token Service (STS) <code>AssumeRole</code> API operation and passes the ARN of the role to use. The operation creates a new session with temporary credentials. AppStream 2.0 retrieves the temporary credentials and creates the <b>appstream_machine_role</b> credential profile on the instance.</p>
259 /// <p>For more information, see <a href="https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html">Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>
260 pub fn set_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
261 self.inner = self.inner.set_iam_role_arn(input);
262 self
263 }
264 /// <p>The Amazon Resource Name (ARN) of the IAM role to apply to the app block builder. To assume a role, the app block builder calls the AWS Security Token Service (STS) <code>AssumeRole</code> API operation and passes the ARN of the role to use. The operation creates a new session with temporary credentials. AppStream 2.0 retrieves the temporary credentials and creates the <b>appstream_machine_role</b> credential profile on the instance.</p>
265 /// <p>For more information, see <a href="https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html">Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>
266 pub fn get_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> {
267 self.inner.get_iam_role_arn()
268 }
269 ///
270 /// Appends an item to `AccessEndpoints`.
271 ///
272 /// To override the contents of this collection use [`set_access_endpoints`](Self::set_access_endpoints).
273 ///
274 /// <p>The list of interface VPC endpoint (interface endpoint) objects. Administrators can connect to the app block builder only through the specified endpoints.</p>
275 pub fn access_endpoints(mut self, input: crate::types::AccessEndpoint) -> Self {
276 self.inner = self.inner.access_endpoints(input);
277 self
278 }
279 /// <p>The list of interface VPC endpoint (interface endpoint) objects. Administrators can connect to the app block builder only through the specified endpoints.</p>
280 pub fn set_access_endpoints(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AccessEndpoint>>) -> Self {
281 self.inner = self.inner.set_access_endpoints(input);
282 self
283 }
284 /// <p>The list of interface VPC endpoint (interface endpoint) objects. Administrators can connect to the app block builder only through the specified endpoints.</p>
285 pub fn get_access_endpoints(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AccessEndpoint>> {
286 self.inner.get_access_endpoints()
287 }
288 ///
289 /// Appends an item to `AttributesToDelete`.
290 ///
291 /// To override the contents of this collection use [`set_attributes_to_delete`](Self::set_attributes_to_delete).
292 ///
293 /// <p>The attributes to delete from the app block builder.</p>
294 pub fn attributes_to_delete(mut self, input: crate::types::AppBlockBuilderAttribute) -> Self {
295 self.inner = self.inner.attributes_to_delete(input);
296 self
297 }
298 /// <p>The attributes to delete from the app block builder.</p>
299 pub fn set_attributes_to_delete(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AppBlockBuilderAttribute>>) -> Self {
300 self.inner = self.inner.set_attributes_to_delete(input);
301 self
302 }
303 /// <p>The attributes to delete from the app block builder.</p>
304 pub fn get_attributes_to_delete(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AppBlockBuilderAttribute>> {
305 self.inner.get_attributes_to_delete()
306 }
307}