aws_sdk_sagemaker/operation/update_notebook_instance/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_notebook_instance::_update_notebook_instance_output::UpdateNotebookInstanceOutputBuilder;
3
4pub use crate::operation::update_notebook_instance::_update_notebook_instance_input::UpdateNotebookInstanceInputBuilder;
5
6impl crate::operation::update_notebook_instance::builders::UpdateNotebookInstanceInputBuilder {
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_notebook_instance::UpdateNotebookInstanceOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_notebook_instance::UpdateNotebookInstanceError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_notebook_instance();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateNotebookInstance`.
24///
25/// <p>Updates a notebook instance. NotebookInstance updates include upgrading or downgrading the ML compute instance used for your notebook instance to accommodate changes in your workload requirements.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateNotebookInstanceFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::update_notebook_instance::builders::UpdateNotebookInstanceInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::update_notebook_instance::UpdateNotebookInstanceOutput,
35 crate::operation::update_notebook_instance::UpdateNotebookInstanceError,
36 > for UpdateNotebookInstanceFluentBuilder
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::update_notebook_instance::UpdateNotebookInstanceOutput,
44 crate::operation::update_notebook_instance::UpdateNotebookInstanceError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl UpdateNotebookInstanceFluentBuilder {
51 /// Creates a new `UpdateNotebookInstanceFluentBuilder`.
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 UpdateNotebookInstance as a reference.
60 pub fn as_input(&self) -> &crate::operation::update_notebook_instance::builders::UpdateNotebookInstanceInputBuilder {
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::update_notebook_instance::UpdateNotebookInstanceOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::update_notebook_instance::UpdateNotebookInstanceError,
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::update_notebook_instance::UpdateNotebookInstance::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::update_notebook_instance::UpdateNotebookInstance::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::update_notebook_instance::UpdateNotebookInstanceOutput,
97 crate::operation::update_notebook_instance::UpdateNotebookInstanceError,
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 notebook instance to update.</p>
112 pub fn notebook_instance_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.notebook_instance_name(input.into());
114 self
115 }
116 /// <p>The name of the notebook instance to update.</p>
117 pub fn set_notebook_instance_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_notebook_instance_name(input);
119 self
120 }
121 /// <p>The name of the notebook instance to update.</p>
122 pub fn get_notebook_instance_name(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_notebook_instance_name()
124 }
125 /// <p>The Amazon ML compute instance type.</p>
126 pub fn instance_type(mut self, input: crate::types::InstanceType) -> Self {
127 self.inner = self.inner.instance_type(input);
128 self
129 }
130 /// <p>The Amazon ML compute instance type.</p>
131 pub fn set_instance_type(mut self, input: ::std::option::Option<crate::types::InstanceType>) -> Self {
132 self.inner = self.inner.set_instance_type(input);
133 self
134 }
135 /// <p>The Amazon ML compute instance type.</p>
136 pub fn get_instance_type(&self) -> &::std::option::Option<crate::types::InstanceType> {
137 self.inner.get_instance_type()
138 }
139 /// <p>The Amazon Resource Name (ARN) of the IAM role that SageMaker AI can assume to access the notebook instance. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html">SageMaker AI Roles</a>.</p><note>
140 /// <p>To be able to pass this role to SageMaker AI, the caller of this API must have the <code>iam:PassRole</code> permission.</p>
141 /// </note>
142 pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143 self.inner = self.inner.role_arn(input.into());
144 self
145 }
146 /// <p>The Amazon Resource Name (ARN) of the IAM role that SageMaker AI can assume to access the notebook instance. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html">SageMaker AI Roles</a>.</p><note>
147 /// <p>To be able to pass this role to SageMaker AI, the caller of this API must have the <code>iam:PassRole</code> permission.</p>
148 /// </note>
149 pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150 self.inner = self.inner.set_role_arn(input);
151 self
152 }
153 /// <p>The Amazon Resource Name (ARN) of the IAM role that SageMaker AI can assume to access the notebook instance. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html">SageMaker AI Roles</a>.</p><note>
154 /// <p>To be able to pass this role to SageMaker AI, the caller of this API must have the <code>iam:PassRole</code> permission.</p>
155 /// </note>
156 pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
157 self.inner.get_role_arn()
158 }
159 /// <p>The name of a lifecycle configuration to associate with the notebook instance. For information about lifestyle configurations, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html">Step 2.1: (Optional) Customize a Notebook Instance</a>.</p>
160 pub fn lifecycle_config_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161 self.inner = self.inner.lifecycle_config_name(input.into());
162 self
163 }
164 /// <p>The name of a lifecycle configuration to associate with the notebook instance. For information about lifestyle configurations, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html">Step 2.1: (Optional) Customize a Notebook Instance</a>.</p>
165 pub fn set_lifecycle_config_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166 self.inner = self.inner.set_lifecycle_config_name(input);
167 self
168 }
169 /// <p>The name of a lifecycle configuration to associate with the notebook instance. For information about lifestyle configurations, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html">Step 2.1: (Optional) Customize a Notebook Instance</a>.</p>
170 pub fn get_lifecycle_config_name(&self) -> &::std::option::Option<::std::string::String> {
171 self.inner.get_lifecycle_config_name()
172 }
173 /// <p>Set to <code>true</code> to remove the notebook instance lifecycle configuration currently associated with the notebook instance. This operation is idempotent. If you specify a lifecycle configuration that is not associated with the notebook instance when you call this method, it does not throw an error.</p>
174 pub fn disassociate_lifecycle_config(mut self, input: bool) -> Self {
175 self.inner = self.inner.disassociate_lifecycle_config(input);
176 self
177 }
178 /// <p>Set to <code>true</code> to remove the notebook instance lifecycle configuration currently associated with the notebook instance. This operation is idempotent. If you specify a lifecycle configuration that is not associated with the notebook instance when you call this method, it does not throw an error.</p>
179 pub fn set_disassociate_lifecycle_config(mut self, input: ::std::option::Option<bool>) -> Self {
180 self.inner = self.inner.set_disassociate_lifecycle_config(input);
181 self
182 }
183 /// <p>Set to <code>true</code> to remove the notebook instance lifecycle configuration currently associated with the notebook instance. This operation is idempotent. If you specify a lifecycle configuration that is not associated with the notebook instance when you call this method, it does not throw an error.</p>
184 pub fn get_disassociate_lifecycle_config(&self) -> &::std::option::Option<bool> {
185 self.inner.get_disassociate_lifecycle_config()
186 }
187 /// <p>The size, in GB, of the ML storage volume to attach to the notebook instance. The default value is 5 GB. ML storage volumes are encrypted, so SageMaker AI can't determine the amount of available free space on the volume. Because of this, you can increase the volume size when you update a notebook instance, but you can't decrease the volume size. If you want to decrease the size of the ML storage volume in use, create a new notebook instance with the desired size.</p>
188 pub fn volume_size_in_gb(mut self, input: i32) -> Self {
189 self.inner = self.inner.volume_size_in_gb(input);
190 self
191 }
192 /// <p>The size, in GB, of the ML storage volume to attach to the notebook instance. The default value is 5 GB. ML storage volumes are encrypted, so SageMaker AI can't determine the amount of available free space on the volume. Because of this, you can increase the volume size when you update a notebook instance, but you can't decrease the volume size. If you want to decrease the size of the ML storage volume in use, create a new notebook instance with the desired size.</p>
193 pub fn set_volume_size_in_gb(mut self, input: ::std::option::Option<i32>) -> Self {
194 self.inner = self.inner.set_volume_size_in_gb(input);
195 self
196 }
197 /// <p>The size, in GB, of the ML storage volume to attach to the notebook instance. The default value is 5 GB. ML storage volumes are encrypted, so SageMaker AI can't determine the amount of available free space on the volume. Because of this, you can increase the volume size when you update a notebook instance, but you can't decrease the volume size. If you want to decrease the size of the ML storage volume in use, create a new notebook instance with the desired size.</p>
198 pub fn get_volume_size_in_gb(&self) -> &::std::option::Option<i32> {
199 self.inner.get_volume_size_in_gb()
200 }
201 /// <p>The Git repository to associate with the notebook instance as its default code repository. This can be either the name of a Git repository stored as a resource in your account, or the URL of a Git repository in <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html">Amazon Web Services CodeCommit</a> or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html">Associating Git Repositories with SageMaker AI Notebook Instances</a>.</p>
202 pub fn default_code_repository(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
203 self.inner = self.inner.default_code_repository(input.into());
204 self
205 }
206 /// <p>The Git repository to associate with the notebook instance as its default code repository. This can be either the name of a Git repository stored as a resource in your account, or the URL of a Git repository in <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html">Amazon Web Services CodeCommit</a> or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html">Associating Git Repositories with SageMaker AI Notebook Instances</a>.</p>
207 pub fn set_default_code_repository(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
208 self.inner = self.inner.set_default_code_repository(input);
209 self
210 }
211 /// <p>The Git repository to associate with the notebook instance as its default code repository. This can be either the name of a Git repository stored as a resource in your account, or the URL of a Git repository in <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html">Amazon Web Services CodeCommit</a> or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html">Associating Git Repositories with SageMaker AI Notebook Instances</a>.</p>
212 pub fn get_default_code_repository(&self) -> &::std::option::Option<::std::string::String> {
213 self.inner.get_default_code_repository()
214 }
215 ///
216 /// Appends an item to `AdditionalCodeRepositories`.
217 ///
218 /// To override the contents of this collection use [`set_additional_code_repositories`](Self::set_additional_code_repositories).
219 ///
220 /// <p>An array of up to three Git repositories to associate with the notebook instance. These can be either the names of Git repositories stored as resources in your account, or the URL of Git repositories in <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html">Amazon Web Services CodeCommit</a> or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html">Associating Git Repositories with SageMaker AI Notebook Instances</a>.</p>
221 pub fn additional_code_repositories(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
222 self.inner = self.inner.additional_code_repositories(input.into());
223 self
224 }
225 /// <p>An array of up to three Git repositories to associate with the notebook instance. These can be either the names of Git repositories stored as resources in your account, or the URL of Git repositories in <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html">Amazon Web Services CodeCommit</a> or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html">Associating Git Repositories with SageMaker AI Notebook Instances</a>.</p>
226 pub fn set_additional_code_repositories(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
227 self.inner = self.inner.set_additional_code_repositories(input);
228 self
229 }
230 /// <p>An array of up to three Git repositories to associate with the notebook instance. These can be either the names of Git repositories stored as resources in your account, or the URL of Git repositories in <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html">Amazon Web Services CodeCommit</a> or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html">Associating Git Repositories with SageMaker AI Notebook Instances</a>.</p>
231 pub fn get_additional_code_repositories(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
232 self.inner.get_additional_code_repositories()
233 }
234 ///
235 /// Appends an item to `AcceleratorTypes`.
236 ///
237 /// To override the contents of this collection use [`set_accelerator_types`](Self::set_accelerator_types).
238 ///
239 /// <p>This parameter is no longer supported. Elastic Inference (EI) is no longer available.</p>
240 /// <p>This parameter was used to specify a list of the EI instance types to associate with this notebook instance.</p>
241 pub fn accelerator_types(mut self, input: crate::types::NotebookInstanceAcceleratorType) -> Self {
242 self.inner = self.inner.accelerator_types(input);
243 self
244 }
245 /// <p>This parameter is no longer supported. Elastic Inference (EI) is no longer available.</p>
246 /// <p>This parameter was used to specify a list of the EI instance types to associate with this notebook instance.</p>
247 pub fn set_accelerator_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::NotebookInstanceAcceleratorType>>) -> Self {
248 self.inner = self.inner.set_accelerator_types(input);
249 self
250 }
251 /// <p>This parameter is no longer supported. Elastic Inference (EI) is no longer available.</p>
252 /// <p>This parameter was used to specify a list of the EI instance types to associate with this notebook instance.</p>
253 pub fn get_accelerator_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::NotebookInstanceAcceleratorType>> {
254 self.inner.get_accelerator_types()
255 }
256 /// <p>This parameter is no longer supported. Elastic Inference (EI) is no longer available.</p>
257 /// <p>This parameter was used to specify a list of the EI instance types to remove from this notebook instance.</p>
258 pub fn disassociate_accelerator_types(mut self, input: bool) -> Self {
259 self.inner = self.inner.disassociate_accelerator_types(input);
260 self
261 }
262 /// <p>This parameter is no longer supported. Elastic Inference (EI) is no longer available.</p>
263 /// <p>This parameter was used to specify a list of the EI instance types to remove from this notebook instance.</p>
264 pub fn set_disassociate_accelerator_types(mut self, input: ::std::option::Option<bool>) -> Self {
265 self.inner = self.inner.set_disassociate_accelerator_types(input);
266 self
267 }
268 /// <p>This parameter is no longer supported. Elastic Inference (EI) is no longer available.</p>
269 /// <p>This parameter was used to specify a list of the EI instance types to remove from this notebook instance.</p>
270 pub fn get_disassociate_accelerator_types(&self) -> &::std::option::Option<bool> {
271 self.inner.get_disassociate_accelerator_types()
272 }
273 /// <p>The name or URL of the default Git repository to remove from this notebook instance. This operation is idempotent. If you specify a Git repository that is not associated with the notebook instance when you call this method, it does not throw an error.</p>
274 pub fn disassociate_default_code_repository(mut self, input: bool) -> Self {
275 self.inner = self.inner.disassociate_default_code_repository(input);
276 self
277 }
278 /// <p>The name or URL of the default Git repository to remove from this notebook instance. This operation is idempotent. If you specify a Git repository that is not associated with the notebook instance when you call this method, it does not throw an error.</p>
279 pub fn set_disassociate_default_code_repository(mut self, input: ::std::option::Option<bool>) -> Self {
280 self.inner = self.inner.set_disassociate_default_code_repository(input);
281 self
282 }
283 /// <p>The name or URL of the default Git repository to remove from this notebook instance. This operation is idempotent. If you specify a Git repository that is not associated with the notebook instance when you call this method, it does not throw an error.</p>
284 pub fn get_disassociate_default_code_repository(&self) -> &::std::option::Option<bool> {
285 self.inner.get_disassociate_default_code_repository()
286 }
287 /// <p>A list of names or URLs of the default Git repositories to remove from this notebook instance. This operation is idempotent. If you specify a Git repository that is not associated with the notebook instance when you call this method, it does not throw an error.</p>
288 pub fn disassociate_additional_code_repositories(mut self, input: bool) -> Self {
289 self.inner = self.inner.disassociate_additional_code_repositories(input);
290 self
291 }
292 /// <p>A list of names or URLs of the default Git repositories to remove from this notebook instance. This operation is idempotent. If you specify a Git repository that is not associated with the notebook instance when you call this method, it does not throw an error.</p>
293 pub fn set_disassociate_additional_code_repositories(mut self, input: ::std::option::Option<bool>) -> Self {
294 self.inner = self.inner.set_disassociate_additional_code_repositories(input);
295 self
296 }
297 /// <p>A list of names or URLs of the default Git repositories to remove from this notebook instance. This operation is idempotent. If you specify a Git repository that is not associated with the notebook instance when you call this method, it does not throw an error.</p>
298 pub fn get_disassociate_additional_code_repositories(&self) -> &::std::option::Option<bool> {
299 self.inner.get_disassociate_additional_code_repositories()
300 }
301 /// <p>Whether root access is enabled or disabled for users of the notebook instance. The default value is <code>Enabled</code>.</p><note>
302 /// <p>If you set this to <code>Disabled</code>, users don't have root access on the notebook instance, but lifecycle configuration scripts still run with root permissions.</p>
303 /// </note>
304 pub fn root_access(mut self, input: crate::types::RootAccess) -> Self {
305 self.inner = self.inner.root_access(input);
306 self
307 }
308 /// <p>Whether root access is enabled or disabled for users of the notebook instance. The default value is <code>Enabled</code>.</p><note>
309 /// <p>If you set this to <code>Disabled</code>, users don't have root access on the notebook instance, but lifecycle configuration scripts still run with root permissions.</p>
310 /// </note>
311 pub fn set_root_access(mut self, input: ::std::option::Option<crate::types::RootAccess>) -> Self {
312 self.inner = self.inner.set_root_access(input);
313 self
314 }
315 /// <p>Whether root access is enabled or disabled for users of the notebook instance. The default value is <code>Enabled</code>.</p><note>
316 /// <p>If you set this to <code>Disabled</code>, users don't have root access on the notebook instance, but lifecycle configuration scripts still run with root permissions.</p>
317 /// </note>
318 pub fn get_root_access(&self) -> &::std::option::Option<crate::types::RootAccess> {
319 self.inner.get_root_access()
320 }
321 /// <p>Information on the IMDS configuration of the notebook instance</p>
322 pub fn instance_metadata_service_configuration(mut self, input: crate::types::InstanceMetadataServiceConfiguration) -> Self {
323 self.inner = self.inner.instance_metadata_service_configuration(input);
324 self
325 }
326 /// <p>Information on the IMDS configuration of the notebook instance</p>
327 pub fn set_instance_metadata_service_configuration(
328 mut self,
329 input: ::std::option::Option<crate::types::InstanceMetadataServiceConfiguration>,
330 ) -> Self {
331 self.inner = self.inner.set_instance_metadata_service_configuration(input);
332 self
333 }
334 /// <p>Information on the IMDS configuration of the notebook instance</p>
335 pub fn get_instance_metadata_service_configuration(&self) -> &::std::option::Option<crate::types::InstanceMetadataServiceConfiguration> {
336 self.inner.get_instance_metadata_service_configuration()
337 }
338}