aws_sdk_sagemaker/operation/create_presigned_domain_url/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_presigned_domain_url::_create_presigned_domain_url_output::CreatePresignedDomainUrlOutputBuilder;
3
4pub use crate::operation::create_presigned_domain_url::_create_presigned_domain_url_input::CreatePresignedDomainUrlInputBuilder;
5
6impl crate::operation::create_presigned_domain_url::builders::CreatePresignedDomainUrlInputBuilder {
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_presigned_domain_url::CreatePresignedDomainUrlOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_presigned_domain_url::CreatePresignedDomainUrlError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_presigned_domain_url();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreatePresignedDomainUrl`.
24///
25/// <p>Creates a URL for a specified UserProfile in a Domain. When accessed in a web browser, the user will be automatically signed in to the domain, and granted access to all of the Apps and files associated with the Domain's Amazon Elastic File System volume. This operation can only be called when the authentication mode equals IAM.</p>
26/// <p>The IAM role or user passed to this API defines the permissions to access the app. Once the presigned URL is created, no additional permission is required to access this URL. IAM authorization policies for this API are also enforced for every HTTP request and WebSocket frame that attempts to connect to the app.</p>
27/// <p>You can restrict access to this API and to the URL that it returns to a list of IP addresses, Amazon VPCs or Amazon VPC Endpoints that you specify. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/studio-interface-endpoint.html">Connect to Amazon SageMaker AI Studio Through an Interface VPC Endpoint</a> .</p><note>
28/// <ul>
29/// <li>
30/// <p>The URL that you get from a call to <code>CreatePresignedDomainUrl</code> has a default timeout of 5 minutes. You can configure this value using <code>ExpiresInSeconds</code>. If you try to use the URL after the timeout limit expires, you are directed to the Amazon Web Services console sign-in page.</p></li>
31/// <li>
32/// <p>The JupyterLab session default expiration time is 12 hours. You can configure this value using SessionExpirationDurationInSeconds.</p></li>
33/// </ul>
34/// </note>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct CreatePresignedDomainUrlFluentBuilder {
37 handle: ::std::sync::Arc<crate::client::Handle>,
38 inner: crate::operation::create_presigned_domain_url::builders::CreatePresignedDomainUrlInputBuilder,
39 config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42 crate::client::customize::internal::CustomizableSend<
43 crate::operation::create_presigned_domain_url::CreatePresignedDomainUrlOutput,
44 crate::operation::create_presigned_domain_url::CreatePresignedDomainUrlError,
45 > for CreatePresignedDomainUrlFluentBuilder
46{
47 fn send(
48 self,
49 config_override: crate::config::Builder,
50 ) -> crate::client::customize::internal::BoxFuture<
51 crate::client::customize::internal::SendResult<
52 crate::operation::create_presigned_domain_url::CreatePresignedDomainUrlOutput,
53 crate::operation::create_presigned_domain_url::CreatePresignedDomainUrlError,
54 >,
55 > {
56 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57 }
58}
59impl CreatePresignedDomainUrlFluentBuilder {
60 /// Creates a new `CreatePresignedDomainUrlFluentBuilder`.
61 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62 Self {
63 handle,
64 inner: ::std::default::Default::default(),
65 config_override: ::std::option::Option::None,
66 }
67 }
68 /// Access the CreatePresignedDomainUrl as a reference.
69 pub fn as_input(&self) -> &crate::operation::create_presigned_domain_url::builders::CreatePresignedDomainUrlInputBuilder {
70 &self.inner
71 }
72 /// Sends the request and returns the response.
73 ///
74 /// If an error occurs, an `SdkError` will be returned with additional details that
75 /// can be matched against.
76 ///
77 /// By default, any retryable failures will be retried twice. Retry behavior
78 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79 /// set when configuring the client.
80 pub async fn send(
81 self,
82 ) -> ::std::result::Result<
83 crate::operation::create_presigned_domain_url::CreatePresignedDomainUrlOutput,
84 ::aws_smithy_runtime_api::client::result::SdkError<
85 crate::operation::create_presigned_domain_url::CreatePresignedDomainUrlError,
86 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87 >,
88 > {
89 let input = self
90 .inner
91 .build()
92 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93 let runtime_plugins = crate::operation::create_presigned_domain_url::CreatePresignedDomainUrl::operation_runtime_plugins(
94 self.handle.runtime_plugins.clone(),
95 &self.handle.conf,
96 self.config_override,
97 );
98 crate::operation::create_presigned_domain_url::CreatePresignedDomainUrl::orchestrate(&runtime_plugins, input).await
99 }
100
101 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102 pub fn customize(
103 self,
104 ) -> crate::client::customize::CustomizableOperation<
105 crate::operation::create_presigned_domain_url::CreatePresignedDomainUrlOutput,
106 crate::operation::create_presigned_domain_url::CreatePresignedDomainUrlError,
107 Self,
108 > {
109 crate::client::customize::CustomizableOperation::new(self)
110 }
111 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112 self.set_config_override(::std::option::Option::Some(config_override.into()));
113 self
114 }
115
116 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117 self.config_override = config_override;
118 self
119 }
120 /// <p>The domain ID.</p>
121 pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122 self.inner = self.inner.domain_id(input.into());
123 self
124 }
125 /// <p>The domain ID.</p>
126 pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127 self.inner = self.inner.set_domain_id(input);
128 self
129 }
130 /// <p>The domain ID.</p>
131 pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
132 self.inner.get_domain_id()
133 }
134 /// <p>The name of the UserProfile to sign-in as.</p>
135 pub fn user_profile_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136 self.inner = self.inner.user_profile_name(input.into());
137 self
138 }
139 /// <p>The name of the UserProfile to sign-in as.</p>
140 pub fn set_user_profile_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141 self.inner = self.inner.set_user_profile_name(input);
142 self
143 }
144 /// <p>The name of the UserProfile to sign-in as.</p>
145 pub fn get_user_profile_name(&self) -> &::std::option::Option<::std::string::String> {
146 self.inner.get_user_profile_name()
147 }
148 /// <p>The session expiration duration in seconds. This value defaults to 43200.</p>
149 pub fn session_expiration_duration_in_seconds(mut self, input: i32) -> Self {
150 self.inner = self.inner.session_expiration_duration_in_seconds(input);
151 self
152 }
153 /// <p>The session expiration duration in seconds. This value defaults to 43200.</p>
154 pub fn set_session_expiration_duration_in_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
155 self.inner = self.inner.set_session_expiration_duration_in_seconds(input);
156 self
157 }
158 /// <p>The session expiration duration in seconds. This value defaults to 43200.</p>
159 pub fn get_session_expiration_duration_in_seconds(&self) -> &::std::option::Option<i32> {
160 self.inner.get_session_expiration_duration_in_seconds()
161 }
162 /// <p>The number of seconds until the pre-signed URL expires. This value defaults to 300.</p>
163 pub fn expires_in_seconds(mut self, input: i32) -> Self {
164 self.inner = self.inner.expires_in_seconds(input);
165 self
166 }
167 /// <p>The number of seconds until the pre-signed URL expires. This value defaults to 300.</p>
168 pub fn set_expires_in_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
169 self.inner = self.inner.set_expires_in_seconds(input);
170 self
171 }
172 /// <p>The number of seconds until the pre-signed URL expires. This value defaults to 300.</p>
173 pub fn get_expires_in_seconds(&self) -> &::std::option::Option<i32> {
174 self.inner.get_expires_in_seconds()
175 }
176 /// <p>The name of the space.</p>
177 pub fn space_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178 self.inner = self.inner.space_name(input.into());
179 self
180 }
181 /// <p>The name of the space.</p>
182 pub fn set_space_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183 self.inner = self.inner.set_space_name(input);
184 self
185 }
186 /// <p>The name of the space.</p>
187 pub fn get_space_name(&self) -> &::std::option::Option<::std::string::String> {
188 self.inner.get_space_name()
189 }
190 /// <p>The landing page that the user is directed to when accessing the presigned URL. Using this value, users can access Studio or Studio Classic, even if it is not the default experience for the domain. The supported values are:</p>
191 /// <ul>
192 /// <li>
193 /// <p><code>studio::relative/path</code>: Directs users to the relative path in Studio.</p></li>
194 /// <li>
195 /// <p><code>app:JupyterServer:relative/path</code>: Directs users to the relative path in the Studio Classic application.</p></li>
196 /// <li>
197 /// <p><code>app:JupyterLab:relative/path</code>: Directs users to the relative path in the JupyterLab application.</p></li>
198 /// <li>
199 /// <p><code>app:RStudioServerPro:relative/path</code>: Directs users to the relative path in the RStudio application.</p></li>
200 /// <li>
201 /// <p><code>app:CodeEditor:relative/path</code>: Directs users to the relative path in the Code Editor, based on Code-OSS, Visual Studio Code - Open Source application.</p></li>
202 /// <li>
203 /// <p><code>app:Canvas:relative/path</code>: Directs users to the relative path in the Canvas application.</p></li>
204 /// </ul>
205 pub fn landing_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
206 self.inner = self.inner.landing_uri(input.into());
207 self
208 }
209 /// <p>The landing page that the user is directed to when accessing the presigned URL. Using this value, users can access Studio or Studio Classic, even if it is not the default experience for the domain. The supported values are:</p>
210 /// <ul>
211 /// <li>
212 /// <p><code>studio::relative/path</code>: Directs users to the relative path in Studio.</p></li>
213 /// <li>
214 /// <p><code>app:JupyterServer:relative/path</code>: Directs users to the relative path in the Studio Classic application.</p></li>
215 /// <li>
216 /// <p><code>app:JupyterLab:relative/path</code>: Directs users to the relative path in the JupyterLab application.</p></li>
217 /// <li>
218 /// <p><code>app:RStudioServerPro:relative/path</code>: Directs users to the relative path in the RStudio application.</p></li>
219 /// <li>
220 /// <p><code>app:CodeEditor:relative/path</code>: Directs users to the relative path in the Code Editor, based on Code-OSS, Visual Studio Code - Open Source application.</p></li>
221 /// <li>
222 /// <p><code>app:Canvas:relative/path</code>: Directs users to the relative path in the Canvas application.</p></li>
223 /// </ul>
224 pub fn set_landing_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
225 self.inner = self.inner.set_landing_uri(input);
226 self
227 }
228 /// <p>The landing page that the user is directed to when accessing the presigned URL. Using this value, users can access Studio or Studio Classic, even if it is not the default experience for the domain. The supported values are:</p>
229 /// <ul>
230 /// <li>
231 /// <p><code>studio::relative/path</code>: Directs users to the relative path in Studio.</p></li>
232 /// <li>
233 /// <p><code>app:JupyterServer:relative/path</code>: Directs users to the relative path in the Studio Classic application.</p></li>
234 /// <li>
235 /// <p><code>app:JupyterLab:relative/path</code>: Directs users to the relative path in the JupyterLab application.</p></li>
236 /// <li>
237 /// <p><code>app:RStudioServerPro:relative/path</code>: Directs users to the relative path in the RStudio application.</p></li>
238 /// <li>
239 /// <p><code>app:CodeEditor:relative/path</code>: Directs users to the relative path in the Code Editor, based on Code-OSS, Visual Studio Code - Open Source application.</p></li>
240 /// <li>
241 /// <p><code>app:Canvas:relative/path</code>: Directs users to the relative path in the Canvas application.</p></li>
242 /// </ul>
243 pub fn get_landing_uri(&self) -> &::std::option::Option<::std::string::String> {
244 self.inner.get_landing_uri()
245 }
246}