1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Launch {
7 pub arn: ::std::string::String,
9 pub name: ::std::string::String,
11 pub project: ::std::option::Option<::std::string::String>,
13 pub status: crate::types::LaunchStatus,
15 pub status_reason: ::std::option::Option<::std::string::String>,
17 pub description: ::std::option::Option<::std::string::String>,
19 pub created_time: ::aws_smithy_types::DateTime,
21 pub last_updated_time: ::aws_smithy_types::DateTime,
23 pub execution: ::std::option::Option<crate::types::LaunchExecution>,
25 pub groups: ::std::option::Option<::std::vec::Vec<crate::types::LaunchGroup>>,
27 pub metric_monitors: ::std::option::Option<::std::vec::Vec<crate::types::MetricMonitor>>,
29 pub randomization_salt: ::std::option::Option<::std::string::String>,
31 pub r#type: crate::types::LaunchType,
33 pub scheduled_splits_definition: ::std::option::Option<crate::types::ScheduledSplitsLaunchDefinition>,
35 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
37}
38impl Launch {
39 pub fn arn(&self) -> &str {
41 use std::ops::Deref;
42 self.arn.deref()
43 }
44 pub fn name(&self) -> &str {
46 use std::ops::Deref;
47 self.name.deref()
48 }
49 pub fn project(&self) -> ::std::option::Option<&str> {
51 self.project.as_deref()
52 }
53 pub fn status(&self) -> &crate::types::LaunchStatus {
55 &self.status
56 }
57 pub fn status_reason(&self) -> ::std::option::Option<&str> {
59 self.status_reason.as_deref()
60 }
61 pub fn description(&self) -> ::std::option::Option<&str> {
63 self.description.as_deref()
64 }
65 pub fn created_time(&self) -> &::aws_smithy_types::DateTime {
67 &self.created_time
68 }
69 pub fn last_updated_time(&self) -> &::aws_smithy_types::DateTime {
71 &self.last_updated_time
72 }
73 pub fn execution(&self) -> ::std::option::Option<&crate::types::LaunchExecution> {
75 self.execution.as_ref()
76 }
77 pub fn groups(&self) -> &[crate::types::LaunchGroup] {
81 self.groups.as_deref().unwrap_or_default()
82 }
83 pub fn metric_monitors(&self) -> &[crate::types::MetricMonitor] {
87 self.metric_monitors.as_deref().unwrap_or_default()
88 }
89 pub fn randomization_salt(&self) -> ::std::option::Option<&str> {
91 self.randomization_salt.as_deref()
92 }
93 pub fn r#type(&self) -> &crate::types::LaunchType {
95 &self.r#type
96 }
97 pub fn scheduled_splits_definition(&self) -> ::std::option::Option<&crate::types::ScheduledSplitsLaunchDefinition> {
99 self.scheduled_splits_definition.as_ref()
100 }
101 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
103 self.tags.as_ref()
104 }
105}
106impl Launch {
107 pub fn builder() -> crate::types::builders::LaunchBuilder {
109 crate::types::builders::LaunchBuilder::default()
110 }
111}
112
113#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
115#[non_exhaustive]
116pub struct LaunchBuilder {
117 pub(crate) arn: ::std::option::Option<::std::string::String>,
118 pub(crate) name: ::std::option::Option<::std::string::String>,
119 pub(crate) project: ::std::option::Option<::std::string::String>,
120 pub(crate) status: ::std::option::Option<crate::types::LaunchStatus>,
121 pub(crate) status_reason: ::std::option::Option<::std::string::String>,
122 pub(crate) description: ::std::option::Option<::std::string::String>,
123 pub(crate) created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
124 pub(crate) last_updated_time: ::std::option::Option<::aws_smithy_types::DateTime>,
125 pub(crate) execution: ::std::option::Option<crate::types::LaunchExecution>,
126 pub(crate) groups: ::std::option::Option<::std::vec::Vec<crate::types::LaunchGroup>>,
127 pub(crate) metric_monitors: ::std::option::Option<::std::vec::Vec<crate::types::MetricMonitor>>,
128 pub(crate) randomization_salt: ::std::option::Option<::std::string::String>,
129 pub(crate) r#type: ::std::option::Option<crate::types::LaunchType>,
130 pub(crate) scheduled_splits_definition: ::std::option::Option<crate::types::ScheduledSplitsLaunchDefinition>,
131 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
132}
133impl LaunchBuilder {
134 pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137 self.arn = ::std::option::Option::Some(input.into());
138 self
139 }
140 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142 self.arn = input;
143 self
144 }
145 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
147 &self.arn
148 }
149 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152 self.name = ::std::option::Option::Some(input.into());
153 self
154 }
155 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157 self.name = input;
158 self
159 }
160 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
162 &self.name
163 }
164 pub fn project(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166 self.project = ::std::option::Option::Some(input.into());
167 self
168 }
169 pub fn set_project(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171 self.project = input;
172 self
173 }
174 pub fn get_project(&self) -> &::std::option::Option<::std::string::String> {
176 &self.project
177 }
178 pub fn status(mut self, input: crate::types::LaunchStatus) -> Self {
181 self.status = ::std::option::Option::Some(input);
182 self
183 }
184 pub fn set_status(mut self, input: ::std::option::Option<crate::types::LaunchStatus>) -> Self {
186 self.status = input;
187 self
188 }
189 pub fn get_status(&self) -> &::std::option::Option<crate::types::LaunchStatus> {
191 &self.status
192 }
193 pub fn status_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
195 self.status_reason = ::std::option::Option::Some(input.into());
196 self
197 }
198 pub fn set_status_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
200 self.status_reason = input;
201 self
202 }
203 pub fn get_status_reason(&self) -> &::std::option::Option<::std::string::String> {
205 &self.status_reason
206 }
207 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
209 self.description = ::std::option::Option::Some(input.into());
210 self
211 }
212 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
214 self.description = input;
215 self
216 }
217 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
219 &self.description
220 }
221 pub fn created_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
224 self.created_time = ::std::option::Option::Some(input);
225 self
226 }
227 pub fn set_created_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
229 self.created_time = input;
230 self
231 }
232 pub fn get_created_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
234 &self.created_time
235 }
236 pub fn last_updated_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
239 self.last_updated_time = ::std::option::Option::Some(input);
240 self
241 }
242 pub fn set_last_updated_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
244 self.last_updated_time = input;
245 self
246 }
247 pub fn get_last_updated_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
249 &self.last_updated_time
250 }
251 pub fn execution(mut self, input: crate::types::LaunchExecution) -> Self {
253 self.execution = ::std::option::Option::Some(input);
254 self
255 }
256 pub fn set_execution(mut self, input: ::std::option::Option<crate::types::LaunchExecution>) -> Self {
258 self.execution = input;
259 self
260 }
261 pub fn get_execution(&self) -> &::std::option::Option<crate::types::LaunchExecution> {
263 &self.execution
264 }
265 pub fn groups(mut self, input: crate::types::LaunchGroup) -> Self {
271 let mut v = self.groups.unwrap_or_default();
272 v.push(input);
273 self.groups = ::std::option::Option::Some(v);
274 self
275 }
276 pub fn set_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LaunchGroup>>) -> Self {
278 self.groups = input;
279 self
280 }
281 pub fn get_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LaunchGroup>> {
283 &self.groups
284 }
285 pub fn metric_monitors(mut self, input: crate::types::MetricMonitor) -> Self {
291 let mut v = self.metric_monitors.unwrap_or_default();
292 v.push(input);
293 self.metric_monitors = ::std::option::Option::Some(v);
294 self
295 }
296 pub fn set_metric_monitors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MetricMonitor>>) -> Self {
298 self.metric_monitors = input;
299 self
300 }
301 pub fn get_metric_monitors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MetricMonitor>> {
303 &self.metric_monitors
304 }
305 pub fn randomization_salt(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
307 self.randomization_salt = ::std::option::Option::Some(input.into());
308 self
309 }
310 pub fn set_randomization_salt(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
312 self.randomization_salt = input;
313 self
314 }
315 pub fn get_randomization_salt(&self) -> &::std::option::Option<::std::string::String> {
317 &self.randomization_salt
318 }
319 pub fn r#type(mut self, input: crate::types::LaunchType) -> Self {
322 self.r#type = ::std::option::Option::Some(input);
323 self
324 }
325 pub fn set_type(mut self, input: ::std::option::Option<crate::types::LaunchType>) -> Self {
327 self.r#type = input;
328 self
329 }
330 pub fn get_type(&self) -> &::std::option::Option<crate::types::LaunchType> {
332 &self.r#type
333 }
334 pub fn scheduled_splits_definition(mut self, input: crate::types::ScheduledSplitsLaunchDefinition) -> Self {
336 self.scheduled_splits_definition = ::std::option::Option::Some(input);
337 self
338 }
339 pub fn set_scheduled_splits_definition(mut self, input: ::std::option::Option<crate::types::ScheduledSplitsLaunchDefinition>) -> Self {
341 self.scheduled_splits_definition = input;
342 self
343 }
344 pub fn get_scheduled_splits_definition(&self) -> &::std::option::Option<crate::types::ScheduledSplitsLaunchDefinition> {
346 &self.scheduled_splits_definition
347 }
348 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
354 let mut hash_map = self.tags.unwrap_or_default();
355 hash_map.insert(k.into(), v.into());
356 self.tags = ::std::option::Option::Some(hash_map);
357 self
358 }
359 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
361 self.tags = input;
362 self
363 }
364 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
366 &self.tags
367 }
368 pub fn build(self) -> ::std::result::Result<crate::types::Launch, ::aws_smithy_types::error::operation::BuildError> {
377 ::std::result::Result::Ok(crate::types::Launch {
378 arn: self.arn.ok_or_else(|| {
379 ::aws_smithy_types::error::operation::BuildError::missing_field(
380 "arn",
381 "arn was not specified but it is required when building Launch",
382 )
383 })?,
384 name: self.name.ok_or_else(|| {
385 ::aws_smithy_types::error::operation::BuildError::missing_field(
386 "name",
387 "name was not specified but it is required when building Launch",
388 )
389 })?,
390 project: self.project,
391 status: self.status.ok_or_else(|| {
392 ::aws_smithy_types::error::operation::BuildError::missing_field(
393 "status",
394 "status was not specified but it is required when building Launch",
395 )
396 })?,
397 status_reason: self.status_reason,
398 description: self.description,
399 created_time: self.created_time.ok_or_else(|| {
400 ::aws_smithy_types::error::operation::BuildError::missing_field(
401 "created_time",
402 "created_time was not specified but it is required when building Launch",
403 )
404 })?,
405 last_updated_time: self.last_updated_time.ok_or_else(|| {
406 ::aws_smithy_types::error::operation::BuildError::missing_field(
407 "last_updated_time",
408 "last_updated_time was not specified but it is required when building Launch",
409 )
410 })?,
411 execution: self.execution,
412 groups: self.groups,
413 metric_monitors: self.metric_monitors,
414 randomization_salt: self.randomization_salt,
415 r#type: self.r#type.ok_or_else(|| {
416 ::aws_smithy_types::error::operation::BuildError::missing_field(
417 "r#type",
418 "r#type was not specified but it is required when building Launch",
419 )
420 })?,
421 scheduled_splits_definition: self.scheduled_splits_definition,
422 tags: self.tags,
423 })
424 }
425}