aws_sdk_appstream/operation/create_application/
_create_application_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateApplicationInput {
6 pub name: ::std::option::Option<::std::string::String>,
8 pub display_name: ::std::option::Option<::std::string::String>,
10 pub description: ::std::option::Option<::std::string::String>,
12 pub icon_s3_location: ::std::option::Option<crate::types::S3Location>,
14 pub launch_path: ::std::option::Option<::std::string::String>,
16 pub working_directory: ::std::option::Option<::std::string::String>,
18 pub launch_parameters: ::std::option::Option<::std::string::String>,
20 pub platforms: ::std::option::Option<::std::vec::Vec<crate::types::PlatformType>>,
22 pub instance_families: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
24 pub app_block_arn: ::std::option::Option<::std::string::String>,
26 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
28}
29impl CreateApplicationInput {
30 pub fn name(&self) -> ::std::option::Option<&str> {
32 self.name.as_deref()
33 }
34 pub fn display_name(&self) -> ::std::option::Option<&str> {
36 self.display_name.as_deref()
37 }
38 pub fn description(&self) -> ::std::option::Option<&str> {
40 self.description.as_deref()
41 }
42 pub fn icon_s3_location(&self) -> ::std::option::Option<&crate::types::S3Location> {
44 self.icon_s3_location.as_ref()
45 }
46 pub fn launch_path(&self) -> ::std::option::Option<&str> {
48 self.launch_path.as_deref()
49 }
50 pub fn working_directory(&self) -> ::std::option::Option<&str> {
52 self.working_directory.as_deref()
53 }
54 pub fn launch_parameters(&self) -> ::std::option::Option<&str> {
56 self.launch_parameters.as_deref()
57 }
58 pub fn platforms(&self) -> &[crate::types::PlatformType] {
62 self.platforms.as_deref().unwrap_or_default()
63 }
64 pub fn instance_families(&self) -> &[::std::string::String] {
68 self.instance_families.as_deref().unwrap_or_default()
69 }
70 pub fn app_block_arn(&self) -> ::std::option::Option<&str> {
72 self.app_block_arn.as_deref()
73 }
74 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 pub fn builder() -> crate::operation::create_application::builders::CreateApplicationInputBuilder {
82 crate::operation::create_application::builders::CreateApplicationInputBuilder::default()
83 }
84}
85
86#[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 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111 self.name = input;
112 self
113 }
114 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
116 &self.name
117 }
118 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 pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125 self.display_name = input;
126 self
127 }
128 pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
130 &self.display_name
131 }
132 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139 self.description = input;
140 self
141 }
142 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
144 &self.description
145 }
146 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 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 pub fn get_icon_s3_location(&self) -> &::std::option::Option<crate::types::S3Location> {
159 &self.icon_s3_location
160 }
161 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 pub fn set_launch_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
169 self.launch_path = input;
170 self
171 }
172 pub fn get_launch_path(&self) -> &::std::option::Option<::std::string::String> {
174 &self.launch_path
175 }
176 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 pub fn set_working_directory(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183 self.working_directory = input;
184 self
185 }
186 pub fn get_working_directory(&self) -> &::std::option::Option<::std::string::String> {
188 &self.working_directory
189 }
190 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 pub fn set_launch_parameters(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197 self.launch_parameters = input;
198 self
199 }
200 pub fn get_launch_parameters(&self) -> &::std::option::Option<::std::string::String> {
202 &self.launch_parameters
203 }
204 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 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 pub fn get_platforms(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PlatformType>> {
222 &self.platforms
223 }
224 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 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 pub fn get_instance_families(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
242 &self.instance_families
243 }
244 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 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 pub fn get_app_block_arn(&self) -> &::std::option::Option<::std::string::String> {
257 &self.app_block_arn
258 }
259 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 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 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
277 &self.tags
278 }
279 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}