aws_sdk_sagemaker/operation/create_app/_create_app_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateAppInput {
6 /// <p>The domain ID.</p>
7 pub domain_id: ::std::option::Option<::std::string::String>,
8 /// <p>The user profile name. If this value is not set, then <code>SpaceName</code> must be set.</p>
9 pub user_profile_name: ::std::option::Option<::std::string::String>,
10 /// <p>The name of the space. If this value is not set, then <code>UserProfileName</code> must be set.</p>
11 pub space_name: ::std::option::Option<::std::string::String>,
12 /// <p>The type of app.</p>
13 pub app_type: ::std::option::Option<crate::types::AppType>,
14 /// <p>The name of the app.</p>
15 pub app_name: ::std::option::Option<::std::string::String>,
16 /// <p>Each tag consists of a key and an optional value. Tag keys must be unique per resource.</p>
17 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
18 /// <p>The instance type and the Amazon Resource Name (ARN) of the SageMaker AI image created on the instance.</p><note>
19 /// <p>The value of <code>InstanceType</code> passed as part of the <code>ResourceSpec</code> in the <code>CreateApp</code> call overrides the value passed as part of the <code>ResourceSpec</code> configured for the user profile or the domain. If <code>InstanceType</code> is not specified in any of those three <code>ResourceSpec</code> values for a <code>KernelGateway</code> app, the <code>CreateApp</code> call fails with a request validation error.</p>
20 /// </note>
21 pub resource_spec: ::std::option::Option<crate::types::ResourceSpec>,
22 /// <p>Indicates whether the application is launched in recovery mode.</p>
23 pub recovery_mode: ::std::option::Option<bool>,
24}
25impl CreateAppInput {
26 /// <p>The domain ID.</p>
27 pub fn domain_id(&self) -> ::std::option::Option<&str> {
28 self.domain_id.as_deref()
29 }
30 /// <p>The user profile name. If this value is not set, then <code>SpaceName</code> must be set.</p>
31 pub fn user_profile_name(&self) -> ::std::option::Option<&str> {
32 self.user_profile_name.as_deref()
33 }
34 /// <p>The name of the space. If this value is not set, then <code>UserProfileName</code> must be set.</p>
35 pub fn space_name(&self) -> ::std::option::Option<&str> {
36 self.space_name.as_deref()
37 }
38 /// <p>The type of app.</p>
39 pub fn app_type(&self) -> ::std::option::Option<&crate::types::AppType> {
40 self.app_type.as_ref()
41 }
42 /// <p>The name of the app.</p>
43 pub fn app_name(&self) -> ::std::option::Option<&str> {
44 self.app_name.as_deref()
45 }
46 /// <p>Each tag consists of a key and an optional value. Tag keys must be unique per resource.</p>
47 ///
48 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
49 pub fn tags(&self) -> &[crate::types::Tag] {
50 self.tags.as_deref().unwrap_or_default()
51 }
52 /// <p>The instance type and the Amazon Resource Name (ARN) of the SageMaker AI image created on the instance.</p><note>
53 /// <p>The value of <code>InstanceType</code> passed as part of the <code>ResourceSpec</code> in the <code>CreateApp</code> call overrides the value passed as part of the <code>ResourceSpec</code> configured for the user profile or the domain. If <code>InstanceType</code> is not specified in any of those three <code>ResourceSpec</code> values for a <code>KernelGateway</code> app, the <code>CreateApp</code> call fails with a request validation error.</p>
54 /// </note>
55 pub fn resource_spec(&self) -> ::std::option::Option<&crate::types::ResourceSpec> {
56 self.resource_spec.as_ref()
57 }
58 /// <p>Indicates whether the application is launched in recovery mode.</p>
59 pub fn recovery_mode(&self) -> ::std::option::Option<bool> {
60 self.recovery_mode
61 }
62}
63impl CreateAppInput {
64 /// Creates a new builder-style object to manufacture [`CreateAppInput`](crate::operation::create_app::CreateAppInput).
65 pub fn builder() -> crate::operation::create_app::builders::CreateAppInputBuilder {
66 crate::operation::create_app::builders::CreateAppInputBuilder::default()
67 }
68}
69
70/// A builder for [`CreateAppInput`](crate::operation::create_app::CreateAppInput).
71#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
72#[non_exhaustive]
73pub struct CreateAppInputBuilder {
74 pub(crate) domain_id: ::std::option::Option<::std::string::String>,
75 pub(crate) user_profile_name: ::std::option::Option<::std::string::String>,
76 pub(crate) space_name: ::std::option::Option<::std::string::String>,
77 pub(crate) app_type: ::std::option::Option<crate::types::AppType>,
78 pub(crate) app_name: ::std::option::Option<::std::string::String>,
79 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
80 pub(crate) resource_spec: ::std::option::Option<crate::types::ResourceSpec>,
81 pub(crate) recovery_mode: ::std::option::Option<bool>,
82}
83impl CreateAppInputBuilder {
84 /// <p>The domain ID.</p>
85 /// This field is required.
86 pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87 self.domain_id = ::std::option::Option::Some(input.into());
88 self
89 }
90 /// <p>The domain ID.</p>
91 pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92 self.domain_id = input;
93 self
94 }
95 /// <p>The domain ID.</p>
96 pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
97 &self.domain_id
98 }
99 /// <p>The user profile name. If this value is not set, then <code>SpaceName</code> must be set.</p>
100 pub fn user_profile_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101 self.user_profile_name = ::std::option::Option::Some(input.into());
102 self
103 }
104 /// <p>The user profile name. If this value is not set, then <code>SpaceName</code> must be set.</p>
105 pub fn set_user_profile_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106 self.user_profile_name = input;
107 self
108 }
109 /// <p>The user profile name. If this value is not set, then <code>SpaceName</code> must be set.</p>
110 pub fn get_user_profile_name(&self) -> &::std::option::Option<::std::string::String> {
111 &self.user_profile_name
112 }
113 /// <p>The name of the space. If this value is not set, then <code>UserProfileName</code> must be set.</p>
114 pub fn space_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.space_name = ::std::option::Option::Some(input.into());
116 self
117 }
118 /// <p>The name of the space. If this value is not set, then <code>UserProfileName</code> must be set.</p>
119 pub fn set_space_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.space_name = input;
121 self
122 }
123 /// <p>The name of the space. If this value is not set, then <code>UserProfileName</code> must be set.</p>
124 pub fn get_space_name(&self) -> &::std::option::Option<::std::string::String> {
125 &self.space_name
126 }
127 /// <p>The type of app.</p>
128 /// This field is required.
129 pub fn app_type(mut self, input: crate::types::AppType) -> Self {
130 self.app_type = ::std::option::Option::Some(input);
131 self
132 }
133 /// <p>The type of app.</p>
134 pub fn set_app_type(mut self, input: ::std::option::Option<crate::types::AppType>) -> Self {
135 self.app_type = input;
136 self
137 }
138 /// <p>The type of app.</p>
139 pub fn get_app_type(&self) -> &::std::option::Option<crate::types::AppType> {
140 &self.app_type
141 }
142 /// <p>The name of the app.</p>
143 /// This field is required.
144 pub fn app_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145 self.app_name = ::std::option::Option::Some(input.into());
146 self
147 }
148 /// <p>The name of the app.</p>
149 pub fn set_app_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150 self.app_name = input;
151 self
152 }
153 /// <p>The name of the app.</p>
154 pub fn get_app_name(&self) -> &::std::option::Option<::std::string::String> {
155 &self.app_name
156 }
157 /// Appends an item to `tags`.
158 ///
159 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
160 ///
161 /// <p>Each tag consists of a key and an optional value. Tag keys must be unique per resource.</p>
162 pub fn tags(mut self, input: crate::types::Tag) -> Self {
163 let mut v = self.tags.unwrap_or_default();
164 v.push(input);
165 self.tags = ::std::option::Option::Some(v);
166 self
167 }
168 /// <p>Each tag consists of a key and an optional value. Tag keys must be unique per resource.</p>
169 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
170 self.tags = input;
171 self
172 }
173 /// <p>Each tag consists of a key and an optional value. Tag keys must be unique per resource.</p>
174 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
175 &self.tags
176 }
177 /// <p>The instance type and the Amazon Resource Name (ARN) of the SageMaker AI image created on the instance.</p><note>
178 /// <p>The value of <code>InstanceType</code> passed as part of the <code>ResourceSpec</code> in the <code>CreateApp</code> call overrides the value passed as part of the <code>ResourceSpec</code> configured for the user profile or the domain. If <code>InstanceType</code> is not specified in any of those three <code>ResourceSpec</code> values for a <code>KernelGateway</code> app, the <code>CreateApp</code> call fails with a request validation error.</p>
179 /// </note>
180 pub fn resource_spec(mut self, input: crate::types::ResourceSpec) -> Self {
181 self.resource_spec = ::std::option::Option::Some(input);
182 self
183 }
184 /// <p>The instance type and the Amazon Resource Name (ARN) of the SageMaker AI image created on the instance.</p><note>
185 /// <p>The value of <code>InstanceType</code> passed as part of the <code>ResourceSpec</code> in the <code>CreateApp</code> call overrides the value passed as part of the <code>ResourceSpec</code> configured for the user profile or the domain. If <code>InstanceType</code> is not specified in any of those three <code>ResourceSpec</code> values for a <code>KernelGateway</code> app, the <code>CreateApp</code> call fails with a request validation error.</p>
186 /// </note>
187 pub fn set_resource_spec(mut self, input: ::std::option::Option<crate::types::ResourceSpec>) -> Self {
188 self.resource_spec = input;
189 self
190 }
191 /// <p>The instance type and the Amazon Resource Name (ARN) of the SageMaker AI image created on the instance.</p><note>
192 /// <p>The value of <code>InstanceType</code> passed as part of the <code>ResourceSpec</code> in the <code>CreateApp</code> call overrides the value passed as part of the <code>ResourceSpec</code> configured for the user profile or the domain. If <code>InstanceType</code> is not specified in any of those three <code>ResourceSpec</code> values for a <code>KernelGateway</code> app, the <code>CreateApp</code> call fails with a request validation error.</p>
193 /// </note>
194 pub fn get_resource_spec(&self) -> &::std::option::Option<crate::types::ResourceSpec> {
195 &self.resource_spec
196 }
197 /// <p>Indicates whether the application is launched in recovery mode.</p>
198 pub fn recovery_mode(mut self, input: bool) -> Self {
199 self.recovery_mode = ::std::option::Option::Some(input);
200 self
201 }
202 /// <p>Indicates whether the application is launched in recovery mode.</p>
203 pub fn set_recovery_mode(mut self, input: ::std::option::Option<bool>) -> Self {
204 self.recovery_mode = input;
205 self
206 }
207 /// <p>Indicates whether the application is launched in recovery mode.</p>
208 pub fn get_recovery_mode(&self) -> &::std::option::Option<bool> {
209 &self.recovery_mode
210 }
211 /// Consumes the builder and constructs a [`CreateAppInput`](crate::operation::create_app::CreateAppInput).
212 pub fn build(self) -> ::std::result::Result<crate::operation::create_app::CreateAppInput, ::aws_smithy_types::error::operation::BuildError> {
213 ::std::result::Result::Ok(crate::operation::create_app::CreateAppInput {
214 domain_id: self.domain_id,
215 user_profile_name: self.user_profile_name,
216 space_name: self.space_name,
217 app_type: self.app_type,
218 app_name: self.app_name,
219 tags: self.tags,
220 resource_spec: self.resource_spec,
221 recovery_mode: self.recovery_mode,
222 })
223 }
224}