aws_sdk_nimble/operation/create_studio/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_studio::_create_studio_output::CreateStudioOutputBuilder;
3
4pub use crate::operation::create_studio::_create_studio_input::CreateStudioInputBuilder;
5
6impl crate::operation::create_studio::builders::CreateStudioInputBuilder {
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_studio::CreateStudioOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_studio::CreateStudioError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_studio();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateStudio`.
24///
25/// <p>Create a new studio.</p>
26/// <p>When creating a studio, two IAM roles must be provided: the admin role and the user role. These roles are assumed by your users when they log in to the Nimble Studio portal.</p>
27/// <p>The user role must have the <code>AmazonNimbleStudio-StudioUser</code> managed policy attached for the portal to function properly.</p>
28/// <p>The admin role must have the <code>AmazonNimbleStudio-StudioAdmin</code> managed policy attached for the portal to function properly.</p>
29/// <p>You may optionally specify a KMS key in the <code>StudioEncryptionConfiguration</code>.</p>
30/// <p>In Nimble Studio, resource names, descriptions, initialization scripts, and other data you provide are always encrypted at rest using an KMS key. By default, this key is owned by Amazon Web Services and managed on your behalf. You may provide your own KMS key when calling <code>CreateStudio</code> to encrypt this data using a key you own and manage.</p>
31/// <p>When providing an KMS key during studio creation, Nimble Studio creates KMS grants in your account to provide your studio user and admin roles access to these KMS keys.</p>
32/// <p>If you delete this grant, the studio will no longer be accessible to your portal users.</p>
33/// <p>If you delete the studio KMS key, your studio will no longer be accessible.</p>
34#[derive(::std::clone::Clone, ::std::fmt::Debug)]
35pub struct CreateStudioFluentBuilder {
36    handle: ::std::sync::Arc<crate::client::Handle>,
37    inner: crate::operation::create_studio::builders::CreateStudioInputBuilder,
38    config_override: ::std::option::Option<crate::config::Builder>,
39}
40impl
41    crate::client::customize::internal::CustomizableSend<
42        crate::operation::create_studio::CreateStudioOutput,
43        crate::operation::create_studio::CreateStudioError,
44    > for CreateStudioFluentBuilder
45{
46    fn send(
47        self,
48        config_override: crate::config::Builder,
49    ) -> crate::client::customize::internal::BoxFuture<
50        crate::client::customize::internal::SendResult<
51            crate::operation::create_studio::CreateStudioOutput,
52            crate::operation::create_studio::CreateStudioError,
53        >,
54    > {
55        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56    }
57}
58impl CreateStudioFluentBuilder {
59    /// Creates a new `CreateStudioFluentBuilder`.
60    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61        Self {
62            handle,
63            inner: ::std::default::Default::default(),
64            config_override: ::std::option::Option::None,
65        }
66    }
67    /// Access the CreateStudio as a reference.
68    pub fn as_input(&self) -> &crate::operation::create_studio::builders::CreateStudioInputBuilder {
69        &self.inner
70    }
71    /// Sends the request and returns the response.
72    ///
73    /// If an error occurs, an `SdkError` will be returned with additional details that
74    /// can be matched against.
75    ///
76    /// By default, any retryable failures will be retried twice. Retry behavior
77    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78    /// set when configuring the client.
79    pub async fn send(
80        self,
81    ) -> ::std::result::Result<
82        crate::operation::create_studio::CreateStudioOutput,
83        ::aws_smithy_runtime_api::client::result::SdkError<
84            crate::operation::create_studio::CreateStudioError,
85            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
86        >,
87    > {
88        let input = self
89            .inner
90            .build()
91            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
92        let runtime_plugins = crate::operation::create_studio::CreateStudio::operation_runtime_plugins(
93            self.handle.runtime_plugins.clone(),
94            &self.handle.conf,
95            self.config_override,
96        );
97        crate::operation::create_studio::CreateStudio::orchestrate(&runtime_plugins, input).await
98    }
99
100    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101    pub fn customize(
102        self,
103    ) -> crate::client::customize::CustomizableOperation<
104        crate::operation::create_studio::CreateStudioOutput,
105        crate::operation::create_studio::CreateStudioError,
106        Self,
107    > {
108        crate::client::customize::CustomizableOperation::new(self)
109    }
110    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111        self.set_config_override(::std::option::Option::Some(config_override.into()));
112        self
113    }
114
115    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116        self.config_override = config_override;
117        self
118    }
119    /// <p>The IAM role that studio admins will assume when logging in to the Nimble Studio portal.</p>
120    pub fn admin_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.admin_role_arn(input.into());
122        self
123    }
124    /// <p>The IAM role that studio admins will assume when logging in to the Nimble Studio portal.</p>
125    pub fn set_admin_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_admin_role_arn(input);
127        self
128    }
129    /// <p>The IAM role that studio admins will assume when logging in to the Nimble Studio portal.</p>
130    pub fn get_admin_role_arn(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_admin_role_arn()
132    }
133    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don’t specify a client token, the Amazon Web Services SDK automatically generates a client token and uses it for the request to ensure idempotency.</p>
134    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.client_token(input.into());
136        self
137    }
138    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don’t specify a client token, the Amazon Web Services SDK automatically generates a client token and uses it for the request to ensure idempotency.</p>
139    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_client_token(input);
141        self
142    }
143    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don’t specify a client token, the Amazon Web Services SDK automatically generates a client token and uses it for the request to ensure idempotency.</p>
144    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_client_token()
146    }
147    /// <p>A friendly name for the studio.</p>
148    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.inner = self.inner.display_name(input.into());
150        self
151    }
152    /// <p>A friendly name for the studio.</p>
153    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_display_name(input);
155        self
156    }
157    /// <p>A friendly name for the studio.</p>
158    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_display_name()
160    }
161    /// <p>The studio encryption configuration.</p>
162    pub fn studio_encryption_configuration(mut self, input: crate::types::StudioEncryptionConfiguration) -> Self {
163        self.inner = self.inner.studio_encryption_configuration(input);
164        self
165    }
166    /// <p>The studio encryption configuration.</p>
167    pub fn set_studio_encryption_configuration(mut self, input: ::std::option::Option<crate::types::StudioEncryptionConfiguration>) -> Self {
168        self.inner = self.inner.set_studio_encryption_configuration(input);
169        self
170    }
171    /// <p>The studio encryption configuration.</p>
172    pub fn get_studio_encryption_configuration(&self) -> &::std::option::Option<crate::types::StudioEncryptionConfiguration> {
173        self.inner.get_studio_encryption_configuration()
174    }
175    /// <p>The studio name that is used in the URL of the Nimble Studio portal when accessed by Nimble Studio users.</p>
176    pub fn studio_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177        self.inner = self.inner.studio_name(input.into());
178        self
179    }
180    /// <p>The studio name that is used in the URL of the Nimble Studio portal when accessed by Nimble Studio users.</p>
181    pub fn set_studio_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182        self.inner = self.inner.set_studio_name(input);
183        self
184    }
185    /// <p>The studio name that is used in the URL of the Nimble Studio portal when accessed by Nimble Studio users.</p>
186    pub fn get_studio_name(&self) -> &::std::option::Option<::std::string::String> {
187        self.inner.get_studio_name()
188    }
189    ///
190    /// Adds a key-value pair to `tags`.
191    ///
192    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
193    ///
194    /// <p>A collection of labels, in the form of key-value pairs, that apply to this resource.</p>
195    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
196        self.inner = self.inner.tags(k.into(), v.into());
197        self
198    }
199    /// <p>A collection of labels, in the form of key-value pairs, that apply to this resource.</p>
200    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
201        self.inner = self.inner.set_tags(input);
202        self
203    }
204    /// <p>A collection of labels, in the form of key-value pairs, that apply to this resource.</p>
205    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
206        self.inner.get_tags()
207    }
208    /// <p>The IAM role that studio users will assume when logging in to the Nimble Studio portal.</p>
209    pub fn user_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
210        self.inner = self.inner.user_role_arn(input.into());
211        self
212    }
213    /// <p>The IAM role that studio users will assume when logging in to the Nimble Studio portal.</p>
214    pub fn set_user_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
215        self.inner = self.inner.set_user_role_arn(input);
216        self
217    }
218    /// <p>The IAM role that studio users will assume when logging in to the Nimble Studio portal.</p>
219    pub fn get_user_role_arn(&self) -> &::std::option::Option<::std::string::String> {
220        self.inner.get_user_role_arn()
221    }
222}