aws_sdk_appstream/operation/create_application/
_create_application_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 CreateApplicationInput {
6    /// <p>The name of the application. This name is visible to users when display name is not specified.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The display name of the application. This name is visible to users in the application catalog.</p>
9    pub display_name: ::std::option::Option<::std::string::String>,
10    /// <p>The description of the application.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>The location in S3 of the application icon.</p>
13    pub icon_s3_location: ::std::option::Option<crate::types::S3Location>,
14    /// <p>The launch path of the application.</p>
15    pub launch_path: ::std::option::Option<::std::string::String>,
16    /// <p>The working directory of the application.</p>
17    pub working_directory: ::std::option::Option<::std::string::String>,
18    /// <p>The launch parameters of the application.</p>
19    pub launch_parameters: ::std::option::Option<::std::string::String>,
20    /// <p>The platforms the application supports. WINDOWS_SERVER_2019 and AMAZON_LINUX2 are supported for Elastic fleets.</p>
21    pub platforms: ::std::option::Option<::std::vec::Vec<crate::types::PlatformType>>,
22    /// <p>The instance families the application supports. Valid values are GENERAL_PURPOSE and GRAPHICS_G4.</p>
23    pub instance_families: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
24    /// <p>The app block ARN to which the application should be associated</p>
25    pub app_block_arn: ::std::option::Option<::std::string::String>,
26    /// <p>The tags assigned to the application.</p>
27    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
28}
29impl CreateApplicationInput {
30    /// <p>The name of the application. This name is visible to users when display name is not specified.</p>
31    pub fn name(&self) -> ::std::option::Option<&str> {
32        self.name.as_deref()
33    }
34    /// <p>The display name of the application. This name is visible to users in the application catalog.</p>
35    pub fn display_name(&self) -> ::std::option::Option<&str> {
36        self.display_name.as_deref()
37    }
38    /// <p>The description of the application.</p>
39    pub fn description(&self) -> ::std::option::Option<&str> {
40        self.description.as_deref()
41    }
42    /// <p>The location in S3 of the application icon.</p>
43    pub fn icon_s3_location(&self) -> ::std::option::Option<&crate::types::S3Location> {
44        self.icon_s3_location.as_ref()
45    }
46    /// <p>The launch path of the application.</p>
47    pub fn launch_path(&self) -> ::std::option::Option<&str> {
48        self.launch_path.as_deref()
49    }
50    /// <p>The working directory of the application.</p>
51    pub fn working_directory(&self) -> ::std::option::Option<&str> {
52        self.working_directory.as_deref()
53    }
54    /// <p>The launch parameters of the application.</p>
55    pub fn launch_parameters(&self) -> ::std::option::Option<&str> {
56        self.launch_parameters.as_deref()
57    }
58    /// <p>The platforms the application supports. WINDOWS_SERVER_2019 and AMAZON_LINUX2 are supported for Elastic fleets.</p>
59    ///
60    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.platforms.is_none()`.
61    pub fn platforms(&self) -> &[crate::types::PlatformType] {
62        self.platforms.as_deref().unwrap_or_default()
63    }
64    /// <p>The instance families the application supports. Valid values are GENERAL_PURPOSE and GRAPHICS_G4.</p>
65    ///
66    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.instance_families.is_none()`.
67    pub fn instance_families(&self) -> &[::std::string::String] {
68        self.instance_families.as_deref().unwrap_or_default()
69    }
70    /// <p>The app block ARN to which the application should be associated</p>
71    pub fn app_block_arn(&self) -> ::std::option::Option<&str> {
72        self.app_block_arn.as_deref()
73    }
74    /// <p>The tags assigned to the application.</p>
75    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
76        self.tags.as_ref()
77    }
78}
79impl CreateApplicationInput {
80    /// Creates a new builder-style object to manufacture [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
81    pub fn builder() -> crate::operation::create_application::builders::CreateApplicationInputBuilder {
82        crate::operation::create_application::builders::CreateApplicationInputBuilder::default()
83    }
84}
85
86/// A builder for [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
87#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
88#[non_exhaustive]
89pub struct CreateApplicationInputBuilder {
90    pub(crate) name: ::std::option::Option<::std::string::String>,
91    pub(crate) display_name: ::std::option::Option<::std::string::String>,
92    pub(crate) description: ::std::option::Option<::std::string::String>,
93    pub(crate) icon_s3_location: ::std::option::Option<crate::types::S3Location>,
94    pub(crate) launch_path: ::std::option::Option<::std::string::String>,
95    pub(crate) working_directory: ::std::option::Option<::std::string::String>,
96    pub(crate) launch_parameters: ::std::option::Option<::std::string::String>,
97    pub(crate) platforms: ::std::option::Option<::std::vec::Vec<crate::types::PlatformType>>,
98    pub(crate) instance_families: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
99    pub(crate) app_block_arn: ::std::option::Option<::std::string::String>,
100    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
101}
102impl CreateApplicationInputBuilder {
103    /// <p>The name of the application. This name is visible to users when display name is not specified.</p>
104    /// This field is required.
105    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.name = ::std::option::Option::Some(input.into());
107        self
108    }
109    /// <p>The name of the application. This name is visible to users when display name is not specified.</p>
110    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.name = input;
112        self
113    }
114    /// <p>The name of the application. This name is visible to users when display name is not specified.</p>
115    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
116        &self.name
117    }
118    /// <p>The display name of the application. This name is visible to users in the application catalog.</p>
119    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.display_name = ::std::option::Option::Some(input.into());
121        self
122    }
123    /// <p>The display name of the application. This name is visible to users in the application catalog.</p>
124    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.display_name = input;
126        self
127    }
128    /// <p>The display name of the application. This name is visible to users in the application catalog.</p>
129    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
130        &self.display_name
131    }
132    /// <p>The description of the application.</p>
133    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.description = ::std::option::Option::Some(input.into());
135        self
136    }
137    /// <p>The description of the application.</p>
138    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.description = input;
140        self
141    }
142    /// <p>The description of the application.</p>
143    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
144        &self.description
145    }
146    /// <p>The location in S3 of the application icon.</p>
147    /// This field is required.
148    pub fn icon_s3_location(mut self, input: crate::types::S3Location) -> Self {
149        self.icon_s3_location = ::std::option::Option::Some(input);
150        self
151    }
152    /// <p>The location in S3 of the application icon.</p>
153    pub fn set_icon_s3_location(mut self, input: ::std::option::Option<crate::types::S3Location>) -> Self {
154        self.icon_s3_location = input;
155        self
156    }
157    /// <p>The location in S3 of the application icon.</p>
158    pub fn get_icon_s3_location(&self) -> &::std::option::Option<crate::types::S3Location> {
159        &self.icon_s3_location
160    }
161    /// <p>The launch path of the application.</p>
162    /// This field is required.
163    pub fn launch_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164        self.launch_path = ::std::option::Option::Some(input.into());
165        self
166    }
167    /// <p>The launch path of the application.</p>
168    pub fn set_launch_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
169        self.launch_path = input;
170        self
171    }
172    /// <p>The launch path of the application.</p>
173    pub fn get_launch_path(&self) -> &::std::option::Option<::std::string::String> {
174        &self.launch_path
175    }
176    /// <p>The working directory of the application.</p>
177    pub fn working_directory(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178        self.working_directory = ::std::option::Option::Some(input.into());
179        self
180    }
181    /// <p>The working directory of the application.</p>
182    pub fn set_working_directory(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183        self.working_directory = input;
184        self
185    }
186    /// <p>The working directory of the application.</p>
187    pub fn get_working_directory(&self) -> &::std::option::Option<::std::string::String> {
188        &self.working_directory
189    }
190    /// <p>The launch parameters of the application.</p>
191    pub fn launch_parameters(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
192        self.launch_parameters = ::std::option::Option::Some(input.into());
193        self
194    }
195    /// <p>The launch parameters of the application.</p>
196    pub fn set_launch_parameters(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197        self.launch_parameters = input;
198        self
199    }
200    /// <p>The launch parameters of the application.</p>
201    pub fn get_launch_parameters(&self) -> &::std::option::Option<::std::string::String> {
202        &self.launch_parameters
203    }
204    /// Appends an item to `platforms`.
205    ///
206    /// To override the contents of this collection use [`set_platforms`](Self::set_platforms).
207    ///
208    /// <p>The platforms the application supports. WINDOWS_SERVER_2019 and AMAZON_LINUX2 are supported for Elastic fleets.</p>
209    pub fn platforms(mut self, input: crate::types::PlatformType) -> Self {
210        let mut v = self.platforms.unwrap_or_default();
211        v.push(input);
212        self.platforms = ::std::option::Option::Some(v);
213        self
214    }
215    /// <p>The platforms the application supports. WINDOWS_SERVER_2019 and AMAZON_LINUX2 are supported for Elastic fleets.</p>
216    pub fn set_platforms(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PlatformType>>) -> Self {
217        self.platforms = input;
218        self
219    }
220    /// <p>The platforms the application supports. WINDOWS_SERVER_2019 and AMAZON_LINUX2 are supported for Elastic fleets.</p>
221    pub fn get_platforms(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PlatformType>> {
222        &self.platforms
223    }
224    /// Appends an item to `instance_families`.
225    ///
226    /// To override the contents of this collection use [`set_instance_families`](Self::set_instance_families).
227    ///
228    /// <p>The instance families the application supports. Valid values are GENERAL_PURPOSE and GRAPHICS_G4.</p>
229    pub fn instance_families(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
230        let mut v = self.instance_families.unwrap_or_default();
231        v.push(input.into());
232        self.instance_families = ::std::option::Option::Some(v);
233        self
234    }
235    /// <p>The instance families the application supports. Valid values are GENERAL_PURPOSE and GRAPHICS_G4.</p>
236    pub fn set_instance_families(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
237        self.instance_families = input;
238        self
239    }
240    /// <p>The instance families the application supports. Valid values are GENERAL_PURPOSE and GRAPHICS_G4.</p>
241    pub fn get_instance_families(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
242        &self.instance_families
243    }
244    /// <p>The app block ARN to which the application should be associated</p>
245    /// This field is required.
246    pub fn app_block_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
247        self.app_block_arn = ::std::option::Option::Some(input.into());
248        self
249    }
250    /// <p>The app block ARN to which the application should be associated</p>
251    pub fn set_app_block_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
252        self.app_block_arn = input;
253        self
254    }
255    /// <p>The app block ARN to which the application should be associated</p>
256    pub fn get_app_block_arn(&self) -> &::std::option::Option<::std::string::String> {
257        &self.app_block_arn
258    }
259    /// Adds a key-value pair to `tags`.
260    ///
261    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
262    ///
263    /// <p>The tags assigned to the application.</p>
264    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
265        let mut hash_map = self.tags.unwrap_or_default();
266        hash_map.insert(k.into(), v.into());
267        self.tags = ::std::option::Option::Some(hash_map);
268        self
269    }
270    /// <p>The tags assigned to the application.</p>
271    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
272        self.tags = input;
273        self
274    }
275    /// <p>The tags assigned to the application.</p>
276    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
277        &self.tags
278    }
279    /// Consumes the builder and constructs a [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
280    pub fn build(
281        self,
282    ) -> ::std::result::Result<crate::operation::create_application::CreateApplicationInput, ::aws_smithy_types::error::operation::BuildError> {
283        ::std::result::Result::Ok(crate::operation::create_application::CreateApplicationInput {
284            name: self.name,
285            display_name: self.display_name,
286            description: self.description,
287            icon_s3_location: self.icon_s3_location,
288            launch_path: self.launch_path,
289            working_directory: self.working_directory,
290            launch_parameters: self.launch_parameters,
291            platforms: self.platforms,
292            instance_families: self.instance_families,
293            app_block_arn: self.app_block_arn,
294            tags: self.tags,
295        })
296    }
297}