aws_sdk_appstream/operation/create_stack/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_stack::_create_stack_output::CreateStackOutputBuilder;
3
4pub use crate::operation::create_stack::_create_stack_input::CreateStackInputBuilder;
5
6impl crate::operation::create_stack::builders::CreateStackInputBuilder {
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_stack::CreateStackOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_stack::CreateStackError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_stack();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateStack`.
24///
25/// <p>Creates a stack to start streaming applications to users. A stack consists of an associated fleet, user access policies, and storage configurations.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateStackFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_stack::builders::CreateStackInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_stack::CreateStackOutput,
35        crate::operation::create_stack::CreateStackError,
36    > for CreateStackFluentBuilder
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_stack::CreateStackOutput,
44            crate::operation::create_stack::CreateStackError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateStackFluentBuilder {
51    /// Creates a new `CreateStackFluentBuilder`.
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 CreateStack as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_stack::builders::CreateStackInputBuilder {
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_stack::CreateStackOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_stack::CreateStackError,
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_stack::CreateStack::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_stack::CreateStack::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_stack::CreateStackOutput,
97        crate::operation::create_stack::CreateStackError,
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 name of the stack.</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 name of the stack.</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 name of the stack.</p>
122    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_name()
124    }
125    /// <p>The description to display.</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 to display.</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 to display.</p>
136    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_description()
138    }
139    /// <p>The stack name to display.</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 stack name to display.</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 stack name to display.</p>
150    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_display_name()
152    }
153    ///
154    /// Appends an item to `StorageConnectors`.
155    ///
156    /// To override the contents of this collection use [`set_storage_connectors`](Self::set_storage_connectors).
157    ///
158    /// <p>The storage connectors to enable.</p>
159    pub fn storage_connectors(mut self, input: crate::types::StorageConnector) -> Self {
160        self.inner = self.inner.storage_connectors(input);
161        self
162    }
163    /// <p>The storage connectors to enable.</p>
164    pub fn set_storage_connectors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StorageConnector>>) -> Self {
165        self.inner = self.inner.set_storage_connectors(input);
166        self
167    }
168    /// <p>The storage connectors to enable.</p>
169    pub fn get_storage_connectors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StorageConnector>> {
170        self.inner.get_storage_connectors()
171    }
172    /// <p>The URL that users are redirected to after their streaming session ends.</p>
173    pub fn redirect_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174        self.inner = self.inner.redirect_url(input.into());
175        self
176    }
177    /// <p>The URL that users are redirected to after their streaming session ends.</p>
178    pub fn set_redirect_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179        self.inner = self.inner.set_redirect_url(input);
180        self
181    }
182    /// <p>The URL that users are redirected to after their streaming session ends.</p>
183    pub fn get_redirect_url(&self) -> &::std::option::Option<::std::string::String> {
184        self.inner.get_redirect_url()
185    }
186    /// <p>The URL that users are redirected to after they click the Send Feedback link. If no URL is specified, no Send Feedback link is displayed.</p>
187    pub fn feedback_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188        self.inner = self.inner.feedback_url(input.into());
189        self
190    }
191    /// <p>The URL that users are redirected to after they click the Send Feedback link. If no URL is specified, no Send Feedback link is displayed.</p>
192    pub fn set_feedback_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193        self.inner = self.inner.set_feedback_url(input);
194        self
195    }
196    /// <p>The URL that users are redirected to after they click the Send Feedback link. If no URL is specified, no Send Feedback link is displayed.</p>
197    pub fn get_feedback_url(&self) -> &::std::option::Option<::std::string::String> {
198        self.inner.get_feedback_url()
199    }
200    ///
201    /// Appends an item to `UserSettings`.
202    ///
203    /// To override the contents of this collection use [`set_user_settings`](Self::set_user_settings).
204    ///
205    /// <p>The actions that are enabled or disabled for users during their streaming sessions. By default, these actions are enabled.</p>
206    pub fn user_settings(mut self, input: crate::types::UserSetting) -> Self {
207        self.inner = self.inner.user_settings(input);
208        self
209    }
210    /// <p>The actions that are enabled or disabled for users during their streaming sessions. By default, these actions are enabled.</p>
211    pub fn set_user_settings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::UserSetting>>) -> Self {
212        self.inner = self.inner.set_user_settings(input);
213        self
214    }
215    /// <p>The actions that are enabled or disabled for users during their streaming sessions. By default, these actions are enabled.</p>
216    pub fn get_user_settings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::UserSetting>> {
217        self.inner.get_user_settings()
218    }
219    /// <p>The persistent application settings for users of a stack. When these settings are enabled, changes that users make to applications and Windows settings are automatically saved after each session and applied to the next session.</p>
220    pub fn application_settings(mut self, input: crate::types::ApplicationSettings) -> Self {
221        self.inner = self.inner.application_settings(input);
222        self
223    }
224    /// <p>The persistent application settings for users of a stack. When these settings are enabled, changes that users make to applications and Windows settings are automatically saved after each session and applied to the next session.</p>
225    pub fn set_application_settings(mut self, input: ::std::option::Option<crate::types::ApplicationSettings>) -> Self {
226        self.inner = self.inner.set_application_settings(input);
227        self
228    }
229    /// <p>The persistent application settings for users of a stack. When these settings are enabled, changes that users make to applications and Windows settings are automatically saved after each session and applied to the next session.</p>
230    pub fn get_application_settings(&self) -> &::std::option::Option<crate::types::ApplicationSettings> {
231        self.inner.get_application_settings()
232    }
233    ///
234    /// Adds a key-value pair to `Tags`.
235    ///
236    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
237    ///
238    /// <p>The tags to associate with the stack. 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>
239    /// <p>If you do not specify a value, the value is set to an empty string.</p>
240    /// <p>Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters:</p>
241    /// <p>_ . : / = + \ - @</p>
242    /// <p>For more information about tags, 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>
243    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
244        self.inner = self.inner.tags(k.into(), v.into());
245        self
246    }
247    /// <p>The tags to associate with the stack. 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>
248    /// <p>If you do not specify a value, the value is set to an empty string.</p>
249    /// <p>Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters:</p>
250    /// <p>_ . : / = + \ - @</p>
251    /// <p>For more information about tags, 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>
252    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
253        self.inner = self.inner.set_tags(input);
254        self
255    }
256    /// <p>The tags to associate with the stack. 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>
257    /// <p>If you do not specify a value, the value is set to an empty string.</p>
258    /// <p>Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters:</p>
259    /// <p>_ . : / = + \ - @</p>
260    /// <p>For more information about tags, 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>
261    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
262        self.inner.get_tags()
263    }
264    ///
265    /// Appends an item to `AccessEndpoints`.
266    ///
267    /// To override the contents of this collection use [`set_access_endpoints`](Self::set_access_endpoints).
268    ///
269    /// <p>The list of interface VPC endpoint (interface endpoint) objects. Users of the stack can connect to AppStream 2.0 only through the specified endpoints.</p>
270    pub fn access_endpoints(mut self, input: crate::types::AccessEndpoint) -> Self {
271        self.inner = self.inner.access_endpoints(input);
272        self
273    }
274    /// <p>The list of interface VPC endpoint (interface endpoint) objects. Users of the stack can connect to AppStream 2.0 only through the specified endpoints.</p>
275    pub fn set_access_endpoints(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AccessEndpoint>>) -> Self {
276        self.inner = self.inner.set_access_endpoints(input);
277        self
278    }
279    /// <p>The list of interface VPC endpoint (interface endpoint) objects. Users of the stack can connect to AppStream 2.0 only through the specified endpoints.</p>
280    pub fn get_access_endpoints(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AccessEndpoint>> {
281        self.inner.get_access_endpoints()
282    }
283    ///
284    /// Appends an item to `EmbedHostDomains`.
285    ///
286    /// To override the contents of this collection use [`set_embed_host_domains`](Self::set_embed_host_domains).
287    ///
288    /// <p>The domains where AppStream 2.0 streaming sessions can be embedded in an iframe. You must approve the domains that you want to host embedded AppStream 2.0 streaming sessions.</p>
289    pub fn embed_host_domains(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
290        self.inner = self.inner.embed_host_domains(input.into());
291        self
292    }
293    /// <p>The domains where AppStream 2.0 streaming sessions can be embedded in an iframe. You must approve the domains that you want to host embedded AppStream 2.0 streaming sessions.</p>
294    pub fn set_embed_host_domains(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
295        self.inner = self.inner.set_embed_host_domains(input);
296        self
297    }
298    /// <p>The domains where AppStream 2.0 streaming sessions can be embedded in an iframe. You must approve the domains that you want to host embedded AppStream 2.0 streaming sessions.</p>
299    pub fn get_embed_host_domains(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
300        self.inner.get_embed_host_domains()
301    }
302    /// <p>The streaming protocol you want your stack to prefer. This can be UDP or TCP. Currently, UDP is only supported in the Windows native client.</p>
303    pub fn streaming_experience_settings(mut self, input: crate::types::StreamingExperienceSettings) -> Self {
304        self.inner = self.inner.streaming_experience_settings(input);
305        self
306    }
307    /// <p>The streaming protocol you want your stack to prefer. This can be UDP or TCP. Currently, UDP is only supported in the Windows native client.</p>
308    pub fn set_streaming_experience_settings(mut self, input: ::std::option::Option<crate::types::StreamingExperienceSettings>) -> Self {
309        self.inner = self.inner.set_streaming_experience_settings(input);
310        self
311    }
312    /// <p>The streaming protocol you want your stack to prefer. This can be UDP or TCP. Currently, UDP is only supported in the Windows native client.</p>
313    pub fn get_streaming_experience_settings(&self) -> &::std::option::Option<crate::types::StreamingExperienceSettings> {
314        self.inner.get_streaming_experience_settings()
315    }
316}