Skip to main content

aws_sdk_sagemaker/types/
_kernel_gateway_app_settings.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The KernelGateway app settings.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct KernelGatewayAppSettings {
7    /// <p>The default instance type and the Amazon Resource Name (ARN) of the default SageMaker AI image used by the KernelGateway app.</p><note>
8    /// <p>The Amazon SageMaker AI Studio UI does not use the default instance type value set here. The default instance type set here is used when Apps are created using the CLI or CloudFormation and the instance type parameter value is not passed.</p>
9    /// </note>
10    pub default_resource_spec: ::std::option::Option<crate::types::ResourceSpec>,
11    /// <p>A list of custom SageMaker AI images that are configured to run as a KernelGateway app.</p>
12    /// <p>The maximum number of custom images are as follows.</p>
13    /// <ul>
14    /// <li>
15    /// <p>On a domain level: 200</p></li>
16    /// <li>
17    /// <p>On a space level: 5</p></li>
18    /// <li>
19    /// <p>On a user profile level: 5</p></li>
20    /// </ul>
21    pub custom_images: ::std::option::Option<::std::vec::Vec<crate::types::CustomImage>>,
22    /// <p>The Amazon Resource Name (ARN) of the Lifecycle Configurations attached to the the user profile or domain.</p><note>
23    /// <p>To remove a Lifecycle Config, you must set <code>LifecycleConfigArns</code> to an empty list.</p>
24    /// </note>
25    pub lifecycle_config_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
26}
27impl KernelGatewayAppSettings {
28    /// <p>The default instance type and the Amazon Resource Name (ARN) of the default SageMaker AI image used by the KernelGateway app.</p><note>
29    /// <p>The Amazon SageMaker AI Studio UI does not use the default instance type value set here. The default instance type set here is used when Apps are created using the CLI or CloudFormation and the instance type parameter value is not passed.</p>
30    /// </note>
31    pub fn default_resource_spec(&self) -> ::std::option::Option<&crate::types::ResourceSpec> {
32        self.default_resource_spec.as_ref()
33    }
34    /// <p>A list of custom SageMaker AI images that are configured to run as a KernelGateway app.</p>
35    /// <p>The maximum number of custom images are as follows.</p>
36    /// <ul>
37    /// <li>
38    /// <p>On a domain level: 200</p></li>
39    /// <li>
40    /// <p>On a space level: 5</p></li>
41    /// <li>
42    /// <p>On a user profile level: 5</p></li>
43    /// </ul>
44    ///
45    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.custom_images.is_none()`.
46    pub fn custom_images(&self) -> &[crate::types::CustomImage] {
47        self.custom_images.as_deref().unwrap_or_default()
48    }
49    /// <p>The Amazon Resource Name (ARN) of the Lifecycle Configurations attached to the the user profile or domain.</p><note>
50    /// <p>To remove a Lifecycle Config, you must set <code>LifecycleConfigArns</code> to an empty list.</p>
51    /// </note>
52    ///
53    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.lifecycle_config_arns.is_none()`.
54    pub fn lifecycle_config_arns(&self) -> &[::std::string::String] {
55        self.lifecycle_config_arns.as_deref().unwrap_or_default()
56    }
57}
58impl KernelGatewayAppSettings {
59    /// Creates a new builder-style object to manufacture [`KernelGatewayAppSettings`](crate::types::KernelGatewayAppSettings).
60    pub fn builder() -> crate::types::builders::KernelGatewayAppSettingsBuilder {
61        crate::types::builders::KernelGatewayAppSettingsBuilder::default()
62    }
63}
64
65/// A builder for [`KernelGatewayAppSettings`](crate::types::KernelGatewayAppSettings).
66#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
67#[non_exhaustive]
68pub struct KernelGatewayAppSettingsBuilder {
69    pub(crate) default_resource_spec: ::std::option::Option<crate::types::ResourceSpec>,
70    pub(crate) custom_images: ::std::option::Option<::std::vec::Vec<crate::types::CustomImage>>,
71    pub(crate) lifecycle_config_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
72}
73impl KernelGatewayAppSettingsBuilder {
74    /// <p>The default instance type and the Amazon Resource Name (ARN) of the default SageMaker AI image used by the KernelGateway app.</p><note>
75    /// <p>The Amazon SageMaker AI Studio UI does not use the default instance type value set here. The default instance type set here is used when Apps are created using the CLI or CloudFormation and the instance type parameter value is not passed.</p>
76    /// </note>
77    pub fn default_resource_spec(mut self, input: crate::types::ResourceSpec) -> Self {
78        self.default_resource_spec = ::std::option::Option::Some(input);
79        self
80    }
81    /// <p>The default instance type and the Amazon Resource Name (ARN) of the default SageMaker AI image used by the KernelGateway app.</p><note>
82    /// <p>The Amazon SageMaker AI Studio UI does not use the default instance type value set here. The default instance type set here is used when Apps are created using the CLI or CloudFormation and the instance type parameter value is not passed.</p>
83    /// </note>
84    pub fn set_default_resource_spec(mut self, input: ::std::option::Option<crate::types::ResourceSpec>) -> Self {
85        self.default_resource_spec = input;
86        self
87    }
88    /// <p>The default instance type and the Amazon Resource Name (ARN) of the default SageMaker AI image used by the KernelGateway app.</p><note>
89    /// <p>The Amazon SageMaker AI Studio UI does not use the default instance type value set here. The default instance type set here is used when Apps are created using the CLI or CloudFormation and the instance type parameter value is not passed.</p>
90    /// </note>
91    pub fn get_default_resource_spec(&self) -> &::std::option::Option<crate::types::ResourceSpec> {
92        &self.default_resource_spec
93    }
94    /// Appends an item to `custom_images`.
95    ///
96    /// To override the contents of this collection use [`set_custom_images`](Self::set_custom_images).
97    ///
98    /// <p>A list of custom SageMaker AI images that are configured to run as a KernelGateway app.</p>
99    /// <p>The maximum number of custom images are as follows.</p>
100    /// <ul>
101    /// <li>
102    /// <p>On a domain level: 200</p></li>
103    /// <li>
104    /// <p>On a space level: 5</p></li>
105    /// <li>
106    /// <p>On a user profile level: 5</p></li>
107    /// </ul>
108    pub fn custom_images(mut self, input: crate::types::CustomImage) -> Self {
109        let mut v = self.custom_images.unwrap_or_default();
110        v.push(input);
111        self.custom_images = ::std::option::Option::Some(v);
112        self
113    }
114    /// <p>A list of custom SageMaker AI images that are configured to run as a KernelGateway app.</p>
115    /// <p>The maximum number of custom images are as follows.</p>
116    /// <ul>
117    /// <li>
118    /// <p>On a domain level: 200</p></li>
119    /// <li>
120    /// <p>On a space level: 5</p></li>
121    /// <li>
122    /// <p>On a user profile level: 5</p></li>
123    /// </ul>
124    pub fn set_custom_images(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CustomImage>>) -> Self {
125        self.custom_images = input;
126        self
127    }
128    /// <p>A list of custom SageMaker AI images that are configured to run as a KernelGateway app.</p>
129    /// <p>The maximum number of custom images are as follows.</p>
130    /// <ul>
131    /// <li>
132    /// <p>On a domain level: 200</p></li>
133    /// <li>
134    /// <p>On a space level: 5</p></li>
135    /// <li>
136    /// <p>On a user profile level: 5</p></li>
137    /// </ul>
138    pub fn get_custom_images(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CustomImage>> {
139        &self.custom_images
140    }
141    /// Appends an item to `lifecycle_config_arns`.
142    ///
143    /// To override the contents of this collection use [`set_lifecycle_config_arns`](Self::set_lifecycle_config_arns).
144    ///
145    /// <p>The Amazon Resource Name (ARN) of the Lifecycle Configurations attached to the the user profile or domain.</p><note>
146    /// <p>To remove a Lifecycle Config, you must set <code>LifecycleConfigArns</code> to an empty list.</p>
147    /// </note>
148    pub fn lifecycle_config_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        let mut v = self.lifecycle_config_arns.unwrap_or_default();
150        v.push(input.into());
151        self.lifecycle_config_arns = ::std::option::Option::Some(v);
152        self
153    }
154    /// <p>The Amazon Resource Name (ARN) of the Lifecycle Configurations attached to the the user profile or domain.</p><note>
155    /// <p>To remove a Lifecycle Config, you must set <code>LifecycleConfigArns</code> to an empty list.</p>
156    /// </note>
157    pub fn set_lifecycle_config_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
158        self.lifecycle_config_arns = input;
159        self
160    }
161    /// <p>The Amazon Resource Name (ARN) of the Lifecycle Configurations attached to the the user profile or domain.</p><note>
162    /// <p>To remove a Lifecycle Config, you must set <code>LifecycleConfigArns</code> to an empty list.</p>
163    /// </note>
164    pub fn get_lifecycle_config_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
165        &self.lifecycle_config_arns
166    }
167    /// Consumes the builder and constructs a [`KernelGatewayAppSettings`](crate::types::KernelGatewayAppSettings).
168    pub fn build(self) -> crate::types::KernelGatewayAppSettings {
169        crate::types::KernelGatewayAppSettings {
170            default_resource_spec: self.default_resource_spec,
171            custom_images: self.custom_images,
172            lifecycle_config_arns: self.lifecycle_config_arns,
173        }
174    }
175}