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}
23impl CreateAppInput {
24    /// <p>The domain ID.</p>
25    pub fn domain_id(&self) -> ::std::option::Option<&str> {
26        self.domain_id.as_deref()
27    }
28    /// <p>The user profile name. If this value is not set, then <code>SpaceName</code> must be set.</p>
29    pub fn user_profile_name(&self) -> ::std::option::Option<&str> {
30        self.user_profile_name.as_deref()
31    }
32    /// <p>The name of the space. If this value is not set, then <code>UserProfileName</code> must be set.</p>
33    pub fn space_name(&self) -> ::std::option::Option<&str> {
34        self.space_name.as_deref()
35    }
36    /// <p>The type of app.</p>
37    pub fn app_type(&self) -> ::std::option::Option<&crate::types::AppType> {
38        self.app_type.as_ref()
39    }
40    /// <p>The name of the app.</p>
41    pub fn app_name(&self) -> ::std::option::Option<&str> {
42        self.app_name.as_deref()
43    }
44    /// <p>Each tag consists of a key and an optional value. Tag keys must be unique per resource.</p>
45    ///
46    /// 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()`.
47    pub fn tags(&self) -> &[crate::types::Tag] {
48        self.tags.as_deref().unwrap_or_default()
49    }
50    /// <p>The instance type and the Amazon Resource Name (ARN) of the SageMaker AI image created on the instance.</p><note>
51    /// <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>
52    /// </note>
53    pub fn resource_spec(&self) -> ::std::option::Option<&crate::types::ResourceSpec> {
54        self.resource_spec.as_ref()
55    }
56}
57impl CreateAppInput {
58    /// Creates a new builder-style object to manufacture [`CreateAppInput`](crate::operation::create_app::CreateAppInput).
59    pub fn builder() -> crate::operation::create_app::builders::CreateAppInputBuilder {
60        crate::operation::create_app::builders::CreateAppInputBuilder::default()
61    }
62}
63
64/// A builder for [`CreateAppInput`](crate::operation::create_app::CreateAppInput).
65#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
66#[non_exhaustive]
67pub struct CreateAppInputBuilder {
68    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
69    pub(crate) user_profile_name: ::std::option::Option<::std::string::String>,
70    pub(crate) space_name: ::std::option::Option<::std::string::String>,
71    pub(crate) app_type: ::std::option::Option<crate::types::AppType>,
72    pub(crate) app_name: ::std::option::Option<::std::string::String>,
73    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
74    pub(crate) resource_spec: ::std::option::Option<crate::types::ResourceSpec>,
75}
76impl CreateAppInputBuilder {
77    /// <p>The domain ID.</p>
78    /// This field is required.
79    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80        self.domain_id = ::std::option::Option::Some(input.into());
81        self
82    }
83    /// <p>The domain ID.</p>
84    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
85        self.domain_id = input;
86        self
87    }
88    /// <p>The domain ID.</p>
89    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
90        &self.domain_id
91    }
92    /// <p>The user profile name. If this value is not set, then <code>SpaceName</code> must be set.</p>
93    pub fn user_profile_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        self.user_profile_name = ::std::option::Option::Some(input.into());
95        self
96    }
97    /// <p>The user profile name. If this value is not set, then <code>SpaceName</code> must be set.</p>
98    pub fn set_user_profile_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99        self.user_profile_name = input;
100        self
101    }
102    /// <p>The user profile name. If this value is not set, then <code>SpaceName</code> must be set.</p>
103    pub fn get_user_profile_name(&self) -> &::std::option::Option<::std::string::String> {
104        &self.user_profile_name
105    }
106    /// <p>The name of the space. If this value is not set, then <code>UserProfileName</code> must be set.</p>
107    pub fn space_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108        self.space_name = ::std::option::Option::Some(input.into());
109        self
110    }
111    /// <p>The name of the space. If this value is not set, then <code>UserProfileName</code> must be set.</p>
112    pub fn set_space_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113        self.space_name = input;
114        self
115    }
116    /// <p>The name of the space. If this value is not set, then <code>UserProfileName</code> must be set.</p>
117    pub fn get_space_name(&self) -> &::std::option::Option<::std::string::String> {
118        &self.space_name
119    }
120    /// <p>The type of app.</p>
121    /// This field is required.
122    pub fn app_type(mut self, input: crate::types::AppType) -> Self {
123        self.app_type = ::std::option::Option::Some(input);
124        self
125    }
126    /// <p>The type of app.</p>
127    pub fn set_app_type(mut self, input: ::std::option::Option<crate::types::AppType>) -> Self {
128        self.app_type = input;
129        self
130    }
131    /// <p>The type of app.</p>
132    pub fn get_app_type(&self) -> &::std::option::Option<crate::types::AppType> {
133        &self.app_type
134    }
135    /// <p>The name of the app.</p>
136    /// This field is required.
137    pub fn app_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.app_name = ::std::option::Option::Some(input.into());
139        self
140    }
141    /// <p>The name of the app.</p>
142    pub fn set_app_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.app_name = input;
144        self
145    }
146    /// <p>The name of the app.</p>
147    pub fn get_app_name(&self) -> &::std::option::Option<::std::string::String> {
148        &self.app_name
149    }
150    /// Appends an item to `tags`.
151    ///
152    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
153    ///
154    /// <p>Each tag consists of a key and an optional value. Tag keys must be unique per resource.</p>
155    pub fn tags(mut self, input: crate::types::Tag) -> Self {
156        let mut v = self.tags.unwrap_or_default();
157        v.push(input);
158        self.tags = ::std::option::Option::Some(v);
159        self
160    }
161    /// <p>Each tag consists of a key and an optional value. Tag keys must be unique per resource.</p>
162    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
163        self.tags = input;
164        self
165    }
166    /// <p>Each tag consists of a key and an optional value. Tag keys must be unique per resource.</p>
167    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
168        &self.tags
169    }
170    /// <p>The instance type and the Amazon Resource Name (ARN) of the SageMaker AI image created on the instance.</p><note>
171    /// <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>
172    /// </note>
173    pub fn resource_spec(mut self, input: crate::types::ResourceSpec) -> Self {
174        self.resource_spec = ::std::option::Option::Some(input);
175        self
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 set_resource_spec(mut self, input: ::std::option::Option<crate::types::ResourceSpec>) -> Self {
181        self.resource_spec = 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 get_resource_spec(&self) -> &::std::option::Option<crate::types::ResourceSpec> {
188        &self.resource_spec
189    }
190    /// Consumes the builder and constructs a [`CreateAppInput`](crate::operation::create_app::CreateAppInput).
191    pub fn build(self) -> ::std::result::Result<crate::operation::create_app::CreateAppInput, ::aws_smithy_types::error::operation::BuildError> {
192        ::std::result::Result::Ok(crate::operation::create_app::CreateAppInput {
193            domain_id: self.domain_id,
194            user_profile_name: self.user_profile_name,
195            space_name: self.space_name,
196            app_type: self.app_type,
197            app_name: self.app_name,
198            tags: self.tags,
199            resource_spec: self.resource_spec,
200        })
201    }
202}