Skip to main content

aws_sdk_evidently/types/
_launch.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>This structure contains the configuration details of one Evidently launch.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Launch {
7    /// <p>The ARN of the launch.</p>
8    pub arn: ::std::string::String,
9    /// <p>The name of the launch.</p>
10    pub name: ::std::string::String,
11    /// <p>The name or ARN of the project that contains the launch.</p>
12    pub project: ::std::option::Option<::std::string::String>,
13    /// <p>The current state of the launch.</p>
14    pub status: crate::types::LaunchStatus,
15    /// <p>If the launch was stopped, this is the string that was entered by the person who stopped the launch, to explain why it was stopped.</p>
16    pub status_reason: ::std::option::Option<::std::string::String>,
17    /// <p>The description of the launch.</p>
18    pub description: ::std::option::Option<::std::string::String>,
19    /// <p>The date and time that the launch is created.</p>
20    pub created_time: ::aws_smithy_types::DateTime,
21    /// <p>The date and time that the launch was most recently updated.</p>
22    pub last_updated_time: ::aws_smithy_types::DateTime,
23    /// <p>A structure that contains information about the start and end times of the launch.</p>
24    pub execution: ::std::option::Option<crate::types::LaunchExecution>,
25    /// <p>An array of structures that define the feature variations that are being used in the launch.</p>
26    pub groups: ::std::option::Option<::std::vec::Vec<crate::types::LaunchGroup>>,
27    /// <p>An array of structures that define the metrics that are being used to monitor the launch performance.</p>
28    pub metric_monitors: ::std::option::Option<::std::vec::Vec<crate::types::MetricMonitor>>,
29    /// <p>This value is used when Evidently assigns a particular user session to the launch, to help create a randomization ID to determine which variation the user session is served. This randomization ID is a combination of the entity ID and <code>randomizationSalt</code>.</p>
30    pub randomization_salt: ::std::option::Option<::std::string::String>,
31    /// <p>The type of launch.</p>
32    pub r#type: crate::types::LaunchType,
33    /// <p>An array of structures that define the traffic allocation percentages among the feature variations during each step of the launch.</p>
34    pub scheduled_splits_definition: ::std::option::Option<crate::types::ScheduledSplitsLaunchDefinition>,
35    /// <p>The list of tag keys and values associated with this launch.</p>
36    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
37}
38impl Launch {
39    /// <p>The ARN of the launch.</p>
40    pub fn arn(&self) -> &str {
41        use std::ops::Deref;
42        self.arn.deref()
43    }
44    /// <p>The name of the launch.</p>
45    pub fn name(&self) -> &str {
46        use std::ops::Deref;
47        self.name.deref()
48    }
49    /// <p>The name or ARN of the project that contains the launch.</p>
50    pub fn project(&self) -> ::std::option::Option<&str> {
51        self.project.as_deref()
52    }
53    /// <p>The current state of the launch.</p>
54    pub fn status(&self) -> &crate::types::LaunchStatus {
55        &self.status
56    }
57    /// <p>If the launch was stopped, this is the string that was entered by the person who stopped the launch, to explain why it was stopped.</p>
58    pub fn status_reason(&self) -> ::std::option::Option<&str> {
59        self.status_reason.as_deref()
60    }
61    /// <p>The description of the launch.</p>
62    pub fn description(&self) -> ::std::option::Option<&str> {
63        self.description.as_deref()
64    }
65    /// <p>The date and time that the launch is created.</p>
66    pub fn created_time(&self) -> &::aws_smithy_types::DateTime {
67        &self.created_time
68    }
69    /// <p>The date and time that the launch was most recently updated.</p>
70    pub fn last_updated_time(&self) -> &::aws_smithy_types::DateTime {
71        &self.last_updated_time
72    }
73    /// <p>A structure that contains information about the start and end times of the launch.</p>
74    pub fn execution(&self) -> ::std::option::Option<&crate::types::LaunchExecution> {
75        self.execution.as_ref()
76    }
77    /// <p>An array of structures that define the feature variations that are being used in the launch.</p>
78    ///
79    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.groups.is_none()`.
80    pub fn groups(&self) -> &[crate::types::LaunchGroup] {
81        self.groups.as_deref().unwrap_or_default()
82    }
83    /// <p>An array of structures that define the metrics that are being used to monitor the launch performance.</p>
84    ///
85    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.metric_monitors.is_none()`.
86    pub fn metric_monitors(&self) -> &[crate::types::MetricMonitor] {
87        self.metric_monitors.as_deref().unwrap_or_default()
88    }
89    /// <p>This value is used when Evidently assigns a particular user session to the launch, to help create a randomization ID to determine which variation the user session is served. This randomization ID is a combination of the entity ID and <code>randomizationSalt</code>.</p>
90    pub fn randomization_salt(&self) -> ::std::option::Option<&str> {
91        self.randomization_salt.as_deref()
92    }
93    /// <p>The type of launch.</p>
94    pub fn r#type(&self) -> &crate::types::LaunchType {
95        &self.r#type
96    }
97    /// <p>An array of structures that define the traffic allocation percentages among the feature variations during each step of the launch.</p>
98    pub fn scheduled_splits_definition(&self) -> ::std::option::Option<&crate::types::ScheduledSplitsLaunchDefinition> {
99        self.scheduled_splits_definition.as_ref()
100    }
101    /// <p>The list of tag keys and values associated with this launch.</p>
102    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    /// Creates a new builder-style object to manufacture [`Launch`](crate::types::Launch).
108    pub fn builder() -> crate::types::builders::LaunchBuilder {
109        crate::types::builders::LaunchBuilder::default()
110    }
111}
112
113/// A builder for [`Launch`](crate::types::Launch).
114#[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    /// <p>The ARN of the launch.</p>
135    /// This field is required.
136    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    /// <p>The ARN of the launch.</p>
141    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.arn = input;
143        self
144    }
145    /// <p>The ARN of the launch.</p>
146    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
147        &self.arn
148    }
149    /// <p>The name of the launch.</p>
150    /// This field is required.
151    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    /// <p>The name of the launch.</p>
156    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157        self.name = input;
158        self
159    }
160    /// <p>The name of the launch.</p>
161    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
162        &self.name
163    }
164    /// <p>The name or ARN of the project that contains the launch.</p>
165    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    /// <p>The name or ARN of the project that contains the launch.</p>
170    pub fn set_project(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171        self.project = input;
172        self
173    }
174    /// <p>The name or ARN of the project that contains the launch.</p>
175    pub fn get_project(&self) -> &::std::option::Option<::std::string::String> {
176        &self.project
177    }
178    /// <p>The current state of the launch.</p>
179    /// This field is required.
180    pub fn status(mut self, input: crate::types::LaunchStatus) -> Self {
181        self.status = ::std::option::Option::Some(input);
182        self
183    }
184    /// <p>The current state of the launch.</p>
185    pub fn set_status(mut self, input: ::std::option::Option<crate::types::LaunchStatus>) -> Self {
186        self.status = input;
187        self
188    }
189    /// <p>The current state of the launch.</p>
190    pub fn get_status(&self) -> &::std::option::Option<crate::types::LaunchStatus> {
191        &self.status
192    }
193    /// <p>If the launch was stopped, this is the string that was entered by the person who stopped the launch, to explain why it was stopped.</p>
194    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    /// <p>If the launch was stopped, this is the string that was entered by the person who stopped the launch, to explain why it was stopped.</p>
199    pub fn set_status_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
200        self.status_reason = input;
201        self
202    }
203    /// <p>If the launch was stopped, this is the string that was entered by the person who stopped the launch, to explain why it was stopped.</p>
204    pub fn get_status_reason(&self) -> &::std::option::Option<::std::string::String> {
205        &self.status_reason
206    }
207    /// <p>The description of the launch.</p>
208    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    /// <p>The description of the launch.</p>
213    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
214        self.description = input;
215        self
216    }
217    /// <p>The description of the launch.</p>
218    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
219        &self.description
220    }
221    /// <p>The date and time that the launch is created.</p>
222    /// This field is required.
223    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    /// <p>The date and time that the launch is created.</p>
228    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    /// <p>The date and time that the launch is created.</p>
233    pub fn get_created_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
234        &self.created_time
235    }
236    /// <p>The date and time that the launch was most recently updated.</p>
237    /// This field is required.
238    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    /// <p>The date and time that the launch was most recently updated.</p>
243    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    /// <p>The date and time that the launch was most recently updated.</p>
248    pub fn get_last_updated_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
249        &self.last_updated_time
250    }
251    /// <p>A structure that contains information about the start and end times of the launch.</p>
252    pub fn execution(mut self, input: crate::types::LaunchExecution) -> Self {
253        self.execution = ::std::option::Option::Some(input);
254        self
255    }
256    /// <p>A structure that contains information about the start and end times of the launch.</p>
257    pub fn set_execution(mut self, input: ::std::option::Option<crate::types::LaunchExecution>) -> Self {
258        self.execution = input;
259        self
260    }
261    /// <p>A structure that contains information about the start and end times of the launch.</p>
262    pub fn get_execution(&self) -> &::std::option::Option<crate::types::LaunchExecution> {
263        &self.execution
264    }
265    /// Appends an item to `groups`.
266    ///
267    /// To override the contents of this collection use [`set_groups`](Self::set_groups).
268    ///
269    /// <p>An array of structures that define the feature variations that are being used in the launch.</p>
270    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    /// <p>An array of structures that define the feature variations that are being used in the launch.</p>
277    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    /// <p>An array of structures that define the feature variations that are being used in the launch.</p>
282    pub fn get_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LaunchGroup>> {
283        &self.groups
284    }
285    /// Appends an item to `metric_monitors`.
286    ///
287    /// To override the contents of this collection use [`set_metric_monitors`](Self::set_metric_monitors).
288    ///
289    /// <p>An array of structures that define the metrics that are being used to monitor the launch performance.</p>
290    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    /// <p>An array of structures that define the metrics that are being used to monitor the launch performance.</p>
297    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    /// <p>An array of structures that define the metrics that are being used to monitor the launch performance.</p>
302    pub fn get_metric_monitors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MetricMonitor>> {
303        &self.metric_monitors
304    }
305    /// <p>This value is used when Evidently assigns a particular user session to the launch, to help create a randomization ID to determine which variation the user session is served. This randomization ID is a combination of the entity ID and <code>randomizationSalt</code>.</p>
306    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    /// <p>This value is used when Evidently assigns a particular user session to the launch, to help create a randomization ID to determine which variation the user session is served. This randomization ID is a combination of the entity ID and <code>randomizationSalt</code>.</p>
311    pub fn set_randomization_salt(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
312        self.randomization_salt = input;
313        self
314    }
315    /// <p>This value is used when Evidently assigns a particular user session to the launch, to help create a randomization ID to determine which variation the user session is served. This randomization ID is a combination of the entity ID and <code>randomizationSalt</code>.</p>
316    pub fn get_randomization_salt(&self) -> &::std::option::Option<::std::string::String> {
317        &self.randomization_salt
318    }
319    /// <p>The type of launch.</p>
320    /// This field is required.
321    pub fn r#type(mut self, input: crate::types::LaunchType) -> Self {
322        self.r#type = ::std::option::Option::Some(input);
323        self
324    }
325    /// <p>The type of launch.</p>
326    pub fn set_type(mut self, input: ::std::option::Option<crate::types::LaunchType>) -> Self {
327        self.r#type = input;
328        self
329    }
330    /// <p>The type of launch.</p>
331    pub fn get_type(&self) -> &::std::option::Option<crate::types::LaunchType> {
332        &self.r#type
333    }
334    /// <p>An array of structures that define the traffic allocation percentages among the feature variations during each step of the launch.</p>
335    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    /// <p>An array of structures that define the traffic allocation percentages among the feature variations during each step of the launch.</p>
340    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    /// <p>An array of structures that define the traffic allocation percentages among the feature variations during each step of the launch.</p>
345    pub fn get_scheduled_splits_definition(&self) -> &::std::option::Option<crate::types::ScheduledSplitsLaunchDefinition> {
346        &self.scheduled_splits_definition
347    }
348    /// Adds a key-value pair to `tags`.
349    ///
350    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
351    ///
352    /// <p>The list of tag keys and values associated with this launch.</p>
353    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    /// <p>The list of tag keys and values associated with this launch.</p>
360    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    /// <p>The list of tag keys and values associated with this launch.</p>
365    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
366        &self.tags
367    }
368    /// Consumes the builder and constructs a [`Launch`](crate::types::Launch).
369    /// This method will fail if any of the following fields are not set:
370    /// - [`arn`](crate::types::builders::LaunchBuilder::arn)
371    /// - [`name`](crate::types::builders::LaunchBuilder::name)
372    /// - [`status`](crate::types::builders::LaunchBuilder::status)
373    /// - [`created_time`](crate::types::builders::LaunchBuilder::created_time)
374    /// - [`last_updated_time`](crate::types::builders::LaunchBuilder::last_updated_time)
375    /// - [`r#type`](crate::types::builders::LaunchBuilder::type)
376    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}