aws_sdk_appstream/operation/create_app_block_builder/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_app_block_builder::_create_app_block_builder_output::CreateAppBlockBuilderOutputBuilder;
3
4pub use crate::operation::create_app_block_builder::_create_app_block_builder_input::CreateAppBlockBuilderInputBuilder;
5
6impl crate::operation::create_app_block_builder::builders::CreateAppBlockBuilderInputBuilder {
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_app_block_builder::CreateAppBlockBuilderOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_app_block_builder::CreateAppBlockBuilderError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_app_block_builder();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateAppBlockBuilder`.
24///
25/// <p>Creates an app block builder.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateAppBlockBuilderFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_app_block_builder::builders::CreateAppBlockBuilderInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_app_block_builder::CreateAppBlockBuilderOutput,
35        crate::operation::create_app_block_builder::CreateAppBlockBuilderError,
36    > for CreateAppBlockBuilderFluentBuilder
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_app_block_builder::CreateAppBlockBuilderOutput,
44            crate::operation::create_app_block_builder::CreateAppBlockBuilderError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateAppBlockBuilderFluentBuilder {
51    /// Creates a new `CreateAppBlockBuilderFluentBuilder`.
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 CreateAppBlockBuilder as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_app_block_builder::builders::CreateAppBlockBuilderInputBuilder {
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_app_block_builder::CreateAppBlockBuilderOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_app_block_builder::CreateAppBlockBuilderError,
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_app_block_builder::CreateAppBlockBuilder::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_app_block_builder::CreateAppBlockBuilder::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_app_block_builder::CreateAppBlockBuilderOutput,
97        crate::operation::create_app_block_builder::CreateAppBlockBuilderError,
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    /// <p>The unique name for the app block builder.</p>
112    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.name(input.into());
114        self
115    }
116    /// <p>The unique name for the app block builder.</p>
117    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_name(input);
119        self
120    }
121    /// <p>The unique name for the app block builder.</p>
122    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_name()
124    }
125    /// <p>The description of the app block builder.</p>
126    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.description(input.into());
128        self
129    }
130    /// <p>The description of the app block builder.</p>
131    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_description(input);
133        self
134    }
135    /// <p>The description of the app block builder.</p>
136    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_description()
138    }
139    /// <p>The display name of the app block builder.</p>
140    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.display_name(input.into());
142        self
143    }
144    /// <p>The display name of the app block builder.</p>
145    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_display_name(input);
147        self
148    }
149    /// <p>The display name of the app block builder.</p>
150    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_display_name()
152    }
153    ///
154    /// Adds a key-value pair to `Tags`.
155    ///
156    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
157    ///
158    /// <p>The tags to associate with the app block builder. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=.</p>
159    /// <p>If you do not specify a value, the value is set to an empty string.</p>
160    /// <p>Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters:</p>
161    /// <p>_ . : / = + \ - @</p>
162    /// <p>For more information, see <a href="https://docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html">Tagging Your Resources</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>
163    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
164        self.inner = self.inner.tags(k.into(), v.into());
165        self
166    }
167    /// <p>The tags to associate with the app block builder. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=.</p>
168    /// <p>If you do not specify a value, the value is set to an empty string.</p>
169    /// <p>Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters:</p>
170    /// <p>_ . : / = + \ - @</p>
171    /// <p>For more information, see <a href="https://docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html">Tagging Your Resources</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>
172    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
173        self.inner = self.inner.set_tags(input);
174        self
175    }
176    /// <p>The tags to associate with the app block builder. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=.</p>
177    /// <p>If you do not specify a value, the value is set to an empty string.</p>
178    /// <p>Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters:</p>
179    /// <p>_ . : / = + \ - @</p>
180    /// <p>For more information, see <a href="https://docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html">Tagging Your Resources</a> in the <i>Amazon AppStream 2.0 Administration Guide</i>.</p>
181    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
182        self.inner.get_tags()
183    }
184    /// <p>The platform of the app block builder.</p>
185    /// <p><code>WINDOWS_SERVER_2019</code> is the only valid value.</p>
186    pub fn platform(mut self, input: crate::types::AppBlockBuilderPlatformType) -> Self {
187        self.inner = self.inner.platform(input);
188        self
189    }
190    /// <p>The platform of the app block builder.</p>
191    /// <p><code>WINDOWS_SERVER_2019</code> is the only valid value.</p>
192    pub fn set_platform(mut self, input: ::std::option::Option<crate::types::AppBlockBuilderPlatformType>) -> Self {
193        self.inner = self.inner.set_platform(input);
194        self
195    }
196    /// <p>The platform of the app block builder.</p>
197    /// <p><code>WINDOWS_SERVER_2019</code> is the only valid value.</p>
198    pub fn get_platform(&self) -> &::std::option::Option<crate::types::AppBlockBuilderPlatformType> {
199        self.inner.get_platform()
200    }
201    /// <p>The instance type to use when launching the app block builder. The following instance types are available:</p>
202    /// <ul>
203    /// <li>
204    /// <p>stream.standard.small</p></li>
205    /// <li>
206    /// <p>stream.standard.medium</p></li>
207    /// <li>
208    /// <p>stream.standard.large</p></li>
209    /// <li>
210    /// <p>stream.standard.xlarge</p></li>
211    /// <li>
212    /// <p>stream.standard.2xlarge</p></li>
213    /// </ul>
214    pub fn instance_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
215        self.inner = self.inner.instance_type(input.into());
216        self
217    }
218    /// <p>The instance type to use when launching the app block builder. The following instance types are available:</p>
219    /// <ul>
220    /// <li>
221    /// <p>stream.standard.small</p></li>
222    /// <li>
223    /// <p>stream.standard.medium</p></li>
224    /// <li>
225    /// <p>stream.standard.large</p></li>
226    /// <li>
227    /// <p>stream.standard.xlarge</p></li>
228    /// <li>
229    /// <p>stream.standard.2xlarge</p></li>
230    /// </ul>
231    pub fn set_instance_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
232        self.inner = self.inner.set_instance_type(input);
233        self
234    }
235    /// <p>The instance type to use when launching the app block builder. The following instance types are available:</p>
236    /// <ul>
237    /// <li>
238    /// <p>stream.standard.small</p></li>
239    /// <li>
240    /// <p>stream.standard.medium</p></li>
241    /// <li>
242    /// <p>stream.standard.large</p></li>
243    /// <li>
244    /// <p>stream.standard.xlarge</p></li>
245    /// <li>
246    /// <p>stream.standard.2xlarge</p></li>
247    /// </ul>
248    pub fn get_instance_type(&self) -> &::std::option::Option<::std::string::String> {
249        self.inner.get_instance_type()
250    }
251    /// <p>The VPC configuration for the app block builder.</p>
252    /// <p>App block builders require that you specify at least two subnets in different availability zones.</p>
253    pub fn vpc_config(mut self, input: crate::types::VpcConfig) -> Self {
254        self.inner = self.inner.vpc_config(input);
255        self
256    }
257    /// <p>The VPC configuration for the app block builder.</p>
258    /// <p>App block builders require that you specify at least two subnets in different availability zones.</p>
259    pub fn set_vpc_config(mut self, input: ::std::option::Option<crate::types::VpcConfig>) -> Self {
260        self.inner = self.inner.set_vpc_config(input);
261        self
262    }
263    /// <p>The VPC configuration for the app block builder.</p>
264    /// <p>App block builders require that you specify at least two subnets in different availability zones.</p>
265    pub fn get_vpc_config(&self) -> &::std::option::Option<crate::types::VpcConfig> {
266        self.inner.get_vpc_config()
267    }
268    /// <p>Enables or disables default internet access for the app block builder.</p>
269    pub fn enable_default_internet_access(mut self, input: bool) -> Self {
270        self.inner = self.inner.enable_default_internet_access(input);
271        self
272    }
273    /// <p>Enables or disables default internet access for the app block builder.</p>
274    pub fn set_enable_default_internet_access(mut self, input: ::std::option::Option<bool>) -> Self {
275        self.inner = self.inner.set_enable_default_internet_access(input);
276        self
277    }
278    /// <p>Enables or disables default internet access for the app block builder.</p>
279    pub fn get_enable_default_internet_access(&self) -> &::std::option::Option<bool> {
280        self.inner.get_enable_default_internet_access()
281    }
282    /// <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>
283    /// <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>
284    pub fn iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
285        self.inner = self.inner.iam_role_arn(input.into());
286        self
287    }
288    /// <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>
289    /// <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>
290    pub fn set_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
291        self.inner = self.inner.set_iam_role_arn(input);
292        self
293    }
294    /// <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>
295    /// <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>
296    pub fn get_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> {
297        self.inner.get_iam_role_arn()
298    }
299    ///
300    /// Appends an item to `AccessEndpoints`.
301    ///
302    /// To override the contents of this collection use [`set_access_endpoints`](Self::set_access_endpoints).
303    ///
304    /// <p>The list of interface VPC endpoint (interface endpoint) objects. Administrators can connect to the app block builder only through the specified endpoints.</p>
305    pub fn access_endpoints(mut self, input: crate::types::AccessEndpoint) -> Self {
306        self.inner = self.inner.access_endpoints(input);
307        self
308    }
309    /// <p>The list of interface VPC endpoint (interface endpoint) objects. Administrators can connect to the app block builder only through the specified endpoints.</p>
310    pub fn set_access_endpoints(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AccessEndpoint>>) -> Self {
311        self.inner = self.inner.set_access_endpoints(input);
312        self
313    }
314    /// <p>The list of interface VPC endpoint (interface endpoint) objects. Administrators can connect to the app block builder only through the specified endpoints.</p>
315    pub fn get_access_endpoints(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AccessEndpoint>> {
316        self.inner.get_access_endpoints()
317    }
318}